From 3083413370ff199cce044afbeddf2281d09b71e3 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 14:44:22 -0500 Subject: [PATCH 01/34] update doc urls --- github/actions_artifacts.go | 10 +- github/actions_cache.go | 14 +- github/actions_oidc.go | 8 +- github/actions_required_workflows.go | 20 --- github/actions_runner_groups.go | 26 ++-- github/actions_runners.go | 36 ++--- github/actions_secrets.go | 38 +++--- github/actions_variables.go | 38 +++--- github/actions_workflow_jobs.go | 6 +- github/actions_workflow_runs.go | 30 ++--- github/actions_workflows.go | 22 +-- github/activity.go | 2 + github/activity_events.go | 20 +-- github/activity_notifications.go | 18 +-- github/activity_star.go | 12 +- github/activity_watching.go | 12 +- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/apps.go | 26 ++-- github/apps_hooks.go | 4 +- github/apps_hooks_deliveries.go | 6 +- github/apps_installation.go | 10 +- github/apps_manifest.go | 2 +- github/apps_marketplace.go | 13 +- github/authorizations.go | 12 +- github/billing.go | 14 +- github/checks.go | 24 ++-- github/code-scanning.go | 28 ++-- github/codespaces.go | 12 +- github/codespaces_secrets.go | 46 +++---- github/dependabot_alerts.go | 6 +- github/dependabot_secrets.go | 28 ++-- github/dependency_graph.go | 2 +- github/enterprise_actions_runner_groups.go | 26 ++-- github/enterprise_actions_runners.go | 10 +- github/enterprise_audit_log.go | 2 +- .../enterprise_code_security_and_analysis.go | 6 +- github/gists.go | 30 ++--- github/gists_comments.go | 10 +- github/git_blobs.go | 6 +- github/git_commits.go | 4 +- github/git_refs.go | 10 +- github/git_tags.go | 4 +- github/git_trees.go | 4 +- github/gitignore.go | 4 +- github/interactions_orgs.go | 6 +- github/interactions_repos.go | 6 +- github/issues.go | 20 +-- github/issues_assignees.go | 8 +- github/issues_comments.go | 12 +- github/issues_events.go | 6 +- github/issues_labels.go | 22 +-- github/issues_milestones.go | 10 +- github/issues_timeline.go | 2 +- github/licenses.go | 4 +- github/migrations.go | 12 +- github/migrations_source_import.go | 16 +-- github/migrations_user.go | 12 +- github/misc.go | 16 ++- github/orgs.go | 14 +- github/orgs_actions_allowed.go | 4 +- github/orgs_actions_permissions.go | 4 +- github/orgs_audit_log.go | 2 +- github/orgs_credential_authorizations.go | 4 +- github/orgs_custom_roles.go | 8 +- github/orgs_hooks.go | 12 +- github/orgs_hooks_configuration.go | 4 +- github/orgs_hooks_deliveries.go | 6 +- github/orgs_members.go | 34 ++--- github/orgs_outside_collaborators.go | 6 +- github/orgs_packages.go | 16 +-- github/orgs_personal_access_tokens.go | 2 +- github/orgs_projects.go | 4 +- github/orgs_rules.go | 10 +- github/orgs_security_managers.go | 6 +- github/orgs_users_blocking.go | 8 +- github/projects.go | 38 +++--- github/pulls.go | 22 +-- github/pulls_comments.go | 14 +- github/pulls_reviewers.go | 6 +- github/pulls_reviews.go | 18 +-- github/reactions.go | 50 +++---- github/repos.go | 126 +++++++++--------- github/repos_actions_access.go | 4 +- github/repos_actions_allowed.go | 4 +- github/repos_actions_permissions.go | 4 +- github/repos_autolinks.go | 8 +- github/repos_codeowners.go | 2 +- github/repos_collaborators.go | 10 +- github/repos_comments.go | 12 +- github/repos_commits.go | 15 +-- github/repos_community_health.go | 2 +- github/repos_contents.go | 17 ++- github/repos_deployment_branch_policies.go | 10 +- github/repos_deployments.go | 14 +- github/repos_environments.go | 8 +- github/repos_forks.go | 4 +- github/repos_hooks.go | 18 +-- github/repos_hooks_configuration.go | 4 +- github/repos_hooks_deliveries.go | 6 +- github/repos_invitations.go | 6 +- github/repos_keys.go | 8 +- github/repos_lfs.go | 4 +- github/repos_merging.go | 4 +- github/repos_pages.go | 18 +-- github/repos_prereceive_hooks.go | 8 +- github/repos_projects.go | 4 +- github/repos_releases.go | 28 ++-- github/repos_rules.go | 12 +- github/repos_stats.go | 10 +- github/repos_statuses.go | 6 +- github/repos_tags.go | 6 +- github/repos_traffic.go | 8 +- github/scim.go | 12 +- github/search.go | 14 +- github/secret_scanning.go | 12 +- github/security_advisories.go | 2 +- github/teams.go | 75 ++++++----- github/teams_discussion_comments.go | 20 +-- github/teams_discussions.go | 20 +-- github/teams_members.go | 20 +-- github/users.go | 16 +-- github/users_administration.go | 8 +- github/users_blocking.go | 8 +- github/users_emails.go | 8 +- github/users_followers.go | 16 +-- github/users_gpg_keys.go | 10 +- github/users_keys.go | 10 +- github/users_packages.go | 32 ++--- github/users_projects.go | 4 +- github/users_ssh_signing_keys.go | 10 +- 133 files changed, 901 insertions(+), 911 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 441a53910e3..c45332302ee 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -52,7 +52,7 @@ type ArtifactList struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) @@ -76,7 +76,7 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) u, err := addOptions(u, opts) @@ -100,7 +100,7 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) @@ -120,7 +120,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) @@ -144,7 +144,7 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) diff --git a/github/actions_cache.go b/github/actions_cache.go index 9592d9ab62f..3b6136e82dc 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -77,7 +77,7 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) @@ -127,7 +127,7 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -144,7 +144,7 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +167,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage-by-repository", org) u, err := addOptions(u, opts) @@ -195,7 +195,7 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -217,7 +217,7 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index b7f2d26ae9c..9e463fcf564 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -18,7 +18,7 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -26,7 +26,7 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -49,7 +49,7 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) @@ -57,7 +57,7 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 3566eb9d207..72f25d811df 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -66,8 +66,6 @@ type RepoRequiredWorkflows struct { } // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -90,8 +88,6 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin } // CreateRequiredWorkflow creates the required workflow in an org. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -109,8 +105,6 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, } // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -129,8 +123,6 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri } // UpdateRequiredWorkflow updates a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -148,8 +140,6 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, } // DeleteRequiredWorkflow deletes a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -160,8 +150,6 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, } // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-selected-repositories-for-a-required-workflow func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -183,8 +171,6 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, } // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#sets-repositories-for-a-required-workflow func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -199,8 +185,6 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o } // AddRepoToRequiredWorkflow adds the Repository to a required workflow. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -211,8 +195,6 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri } // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. -// -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -223,8 +205,6 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org } // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. -// -// Github API docs:https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-repository-required-workflows func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 00b9b6ce091..60edab62982 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -104,7 +104,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +123,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -137,7 +137,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -156,7 +156,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -175,7 +175,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -200,7 +200,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -215,7 +215,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -230,7 +230,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -244,7 +244,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -269,7 +269,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -283,7 +283,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -298,7 +298,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/actions_runners.go b/github/actions_runners.go index 7427451ccfa..49bae5d77df 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -28,7 +28,7 @@ type ActionsEnabledOnOrgRepos struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +64,7 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) req, err := s.client.NewRequest("POST", u, request) @@ -83,7 +83,7 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -108,7 +108,7 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) @@ -151,7 +151,7 @@ type Runners struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +200,7 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) @@ -220,7 +220,7 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) @@ -234,7 +234,7 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) req, err := s.client.NewRequest("GET", u, nil) @@ -253,7 +253,7 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) @@ -273,7 +273,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", owner) u, err := addOptions(u, opts) @@ -297,7 +297,7 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) u, err := addOptions(u, opts) @@ -321,7 +321,7 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) @@ -342,7 +342,7 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -361,7 +361,7 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -380,7 +380,7 @@ func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner strin // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -399,7 +399,7 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) @@ -419,7 +419,7 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 49985e12afa..5bab79ee781 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -64,7 +64,7 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -72,7 +72,7 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -80,7 +80,7 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) return s.getPublicKey(ctx, url) @@ -124,7 +124,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -133,7 +133,7 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets", org) return s.listSecrets(ctx, url, opts) @@ -141,7 +141,7 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) return s.listSecrets(ctx, url, opts) @@ -164,7 +164,7 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -172,7 +172,7 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -180,7 +180,7 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.getSecret(ctx, url) @@ -213,7 +213,7 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -221,7 +221,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -229,7 +229,7 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -246,7 +246,7 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -254,7 +254,7 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -262,7 +262,7 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.deleteSecret(ctx, url) @@ -296,7 +296,7 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.listSelectedReposForSecret(ctx, url, opts) @@ -317,7 +317,7 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.setSelectedReposForSecret(ctx, url, ids) @@ -334,7 +334,7 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) @@ -351,7 +351,7 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) diff --git a/github/actions_variables.go b/github/actions_variables.go index 29445edd042..dd70fe4e933 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -51,7 +51,7 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.listVariables(ctx, url, opts) @@ -59,7 +59,7 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.listVariables(ctx, url, opts) @@ -67,7 +67,7 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.listVariables(ctx, url, opts) @@ -90,7 +90,7 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.getVariable(ctx, url) @@ -98,7 +98,7 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.getVariable(ctx, url) @@ -106,7 +106,7 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.getVariable(ctx, url) @@ -122,7 +122,7 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, variable // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.postVariable(ctx, url, variable) @@ -130,7 +130,7 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.postVariable(ctx, url, variable) @@ -138,7 +138,7 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.postVariable(ctx, url, variable) @@ -154,7 +154,7 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) return s.patchVariable(ctx, url, variable) @@ -162,7 +162,7 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) return s.patchVariable(ctx, url, variable) @@ -170,7 +170,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) return s.patchVariable(ctx, url, variable) @@ -187,7 +187,7 @@ func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Respo // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.deleteVariable(ctx, url) @@ -195,7 +195,7 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.deleteVariable(ctx, url) @@ -203,7 +203,7 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.deleteVariable(ctx, url) @@ -231,7 +231,7 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.listSelectedReposForVariable(ctx, url, opts) @@ -252,7 +252,7 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.setSelectedReposForVariable(ctx, url, ids) @@ -269,7 +269,7 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToVariable(ctx, url) @@ -286,7 +286,7 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromVariable(ctx, url) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 1f018b3e48e..176a9fb1383 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -70,7 +70,7 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) u, err := addOptions(u, opts) @@ -94,7 +94,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) @@ -114,7 +114,7 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 00221086116..eda2a61ab7f 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -126,7 +126,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -134,7 +134,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) @@ -142,7 +142,7 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) u, err := addOptions(u, opts) @@ -166,7 +166,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -186,7 +186,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v", owner, repo, runID, attemptNumber) u, err := addOptions(u, opts) @@ -210,7 +210,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) @@ -230,7 +230,7 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r // RerunWorkflowByID re-runs a workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) @@ -244,7 +244,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) @@ -258,7 +258,7 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) @@ -272,7 +272,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) @@ -286,7 +286,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -306,7 +306,7 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str // DeleteWorkflowRun deletes a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -320,7 +320,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // DeleteWorkflowRunLogs deletes all logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -334,7 +334,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) @@ -354,7 +354,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) diff --git a/github/actions_workflows.go b/github/actions_workflows.go index c9b47ed4be4..5f19d474292 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -58,7 +58,7 @@ type CreateWorkflowDispatchEventRequest struct { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows", owner, repo) u, err := addOptions(u, opts) @@ -82,7 +82,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowID) @@ -91,7 +91,7 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowFileName) @@ -115,7 +115,7 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowID) @@ -124,7 +124,7 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowFileName) @@ -148,7 +148,7 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) @@ -157,7 +157,7 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) @@ -175,7 +175,7 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -183,7 +183,7 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) @@ -191,7 +191,7 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -199,7 +199,7 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) diff --git a/github/activity.go b/github/activity.go index 9cd9f9b71d7..f92c8e41a31 100644 --- a/github/activity.go +++ b/github/activity.go @@ -57,6 +57,8 @@ type FeedLinks struct { // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. +// +// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { req, err := s.client.NewRequest("GET", "feeds", nil) if err != nil { diff --git a/github/activity_events.go b/github/activity_events.go index d6f0f043b08..f16312556a5 100644 --- a/github/activity_events.go +++ b/github/activity_events.go @@ -12,7 +12,7 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { u, err := addOptions("events", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("repos/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -59,7 +59,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -83,7 +83,7 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("networks/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,8 +132,8 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -163,8 +163,8 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -194,7 +194,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 03476c2e2c3..e36f2be02f3 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := "notifications" u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -102,7 +102,7 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -118,7 +118,7 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +134,7 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -154,7 +154,7 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +169,7 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -190,7 +190,7 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -211,7 +211,7 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_star.go b/github/activity_star.go index 65a316f5325..3f798ec87e6 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -25,7 +25,7 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo) u, err := addOptions(u, opts) @@ -67,8 +67,8 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -101,7 +101,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -129,7 +129,7 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_watching.go b/github/activity_watching.go index 2d6fafcc793..bdb46465d19 100644 --- a/github/activity_watching.go +++ b/github/activity_watching.go @@ -27,7 +27,7 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscribers", owner, repo) u, err := addOptions(u, opts) @@ -52,8 +52,8 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -84,7 +84,7 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -111,7 +111,7 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -135,7 +135,7 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/admin.go b/github/admin.go index 1b28ef64c7d..f9d85d2b75e 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/en/enterprise-server/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -101,7 +101,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/en/rest/enterprise/ldap/#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 448e51f631e..4a22deb8c98 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +59,14 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, newName) } // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 17e568f62b2..9e0bbf77f6f 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/en/rest/enterprise-admin/admin_stats/ +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index d756a77e20d..5a7c0e8a099 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +44,7 @@ func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*Us // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -115,7 +115,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/apps.go b/github/apps.go index ab83d59ab2f..50836bf358a 100644 --- a/github/apps.go +++ b/github/apps.go @@ -151,8 +151,8 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -177,7 +177,7 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("app/installations", opts) if err != nil { @@ -200,14 +200,14 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -232,7 +232,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -246,7 +246,7 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -260,7 +260,7 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) @@ -274,7 +274,7 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) @@ -294,7 +294,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// TODO: Find GitHub API docs. +// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} @@ -317,14 +317,14 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } @@ -338,7 +338,7 @@ func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } diff --git a/github/apps_hooks.go b/github/apps_hooks.go index e3bd2afc032..a11f688b2a5 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,7 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -31,7 +31,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_hooks_deliveries.go b/github/apps_hooks_deliveries.go index 33102f36d2b..2611ea10564 100644 --- a/github/apps_hooks_deliveries.go +++ b/github/apps_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u, err := addOptions("app/hook/deliveries", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_installation.go b/github/apps_installation.go index b619080713f..0896d744b01 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -19,7 +19,7 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { u, err := addOptions("installation/repositories", opts) if err != nil { @@ -52,7 +52,7 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories", id) u, err := addOptions(u, opts) @@ -84,7 +84,7 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) @@ -103,7 +103,7 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -116,7 +116,7 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/apps_manifest.go b/github/apps_manifest.go index fa4c85379ca..f5a5ab53dbb 100644 --- a/github/apps_manifest.go +++ b/github/apps_manifest.go @@ -31,7 +31,7 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 32889abd240..22bbeb12402 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -89,7 +89,8 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -113,7 +114,8 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -137,7 +139,8 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) @@ -157,8 +160,8 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/github/authorizations.go b/github/authorizations.go index ea0897e3627..f8fbcc28e6c 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -143,7 +143,7 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -176,7 +176,7 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -205,7 +205,7 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -226,7 +226,7 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/grant", clientID) @@ -249,7 +249,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://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -269,7 +269,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/billing.go b/github/billing.go index 7a76bf86fda..b3e44f0566f 100644 --- a/github/billing.go +++ b/github/billing.go @@ -62,7 +62,7 @@ type AdvancedSecurityCommittersBreakdown struct { // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -81,7 +81,7 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -101,7 +101,7 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // GetStorageBillingOrg returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -120,7 +120,7 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -163,7 +163,7 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -183,7 +183,7 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // GetStorageBillingUser returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/checks.go b/github/checks.go index 12d08530ca0..27fec0ff469 100644 --- a/github/checks.go +++ b/github/checks.go @@ -98,7 +98,7 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +161,7 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -194,7 +194,7 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -215,7 +215,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -257,7 +257,7 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -283,7 +283,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/check-runs", owner, repo, checkSuiteID) u, err := addOptions(u, opts) @@ -309,7 +309,7 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) @@ -339,7 +339,7 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -387,7 +387,7 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -414,7 +414,7 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -435,7 +435,7 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/github/code-scanning.go b/github/code-scanning.go index 0ae269be676..521b1e15312 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -235,7 +235,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -263,7 +263,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -292,7 +292,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -317,7 +317,7 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -340,7 +340,7 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) u, err := addOptions(u, opts) @@ -368,7 +368,7 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -400,7 +400,7 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) @@ -424,7 +424,7 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -453,7 +453,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -486,7 +486,7 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -509,7 +509,7 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) @@ -532,7 +532,7 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) @@ -564,7 +564,7 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -605,7 +605,7 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/github/codespaces.go b/github/codespaces.go index cd8b0e5bee5..d3d2b1a9f61 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -90,7 +90,7 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { u := "user/codespaces" u, err := addOptions(u, opts) @@ -172,7 +172,7 @@ type CreateCodespaceOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) @@ -195,7 +195,7 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) @@ -218,7 +218,7 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) @@ -241,7 +241,7 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) diff --git a/github/codespaces_secrets.go b/github/codespaces_secrets.go index e11c679c668..aa2869c88de 100644 --- a/github/codespaces_secrets.go +++ b/github/codespaces_secrets.go @@ -16,7 +16,7 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { u, err := addOptions("user/codespaces/secrets", opts) if err != nil { @@ -29,7 +29,7 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets", org) u, err := addOptions(u, opts) @@ -43,7 +43,7 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets", owner, repo) u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, "user/codespaces/secrets/public-key") } @@ -83,7 +83,7 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("orgs/%v/codespaces/secrets/public-key", org)) } @@ -92,7 +92,7 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("repos/%v/%v/codespaces/secrets/public-key", owner, repo)) } @@ -118,7 +118,7 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.getSecret(ctx, u) @@ -128,7 +128,7 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.getSecret(ctx, u) @@ -138,7 +138,7 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.getSecret(ctx, u) @@ -165,7 +165,7 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -175,7 +175,7 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -185,7 +185,7 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -211,7 +211,7 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.deleteSecret(ctx, u) @@ -221,7 +221,7 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.deleteSecret(ctx, u) @@ -231,7 +231,7 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, u) @@ -256,7 +256,7 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) u, err := addOptions(u, opts) @@ -271,7 +271,7 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) u, err := addOptions(u, opts) @@ -302,7 +302,7 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -312,7 +312,7 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -340,7 +340,7 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -350,7 +350,7 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -374,7 +374,7 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) @@ -384,7 +384,7 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 177316b1dc8..8d90bab8553 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -104,7 +104,7 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo) return s.listAlerts(ctx, url, opts) @@ -112,7 +112,7 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/alerts", org) return s.listAlerts(ctx, url, opts) @@ -120,7 +120,7 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) req, err := s.client.NewRequest("GET", url, nil) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index 685f7bea8ea..362e62a3af5 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -27,7 +27,7 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -35,7 +35,7 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -64,7 +64,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -73,7 +73,7 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) return s.listSecrets(ctx, url, opts) @@ -96,7 +96,7 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -104,7 +104,7 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -134,7 +134,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -142,7 +142,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) for i, secret := range eSecret.SelectedRepositoryIDs { @@ -176,7 +176,7 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -184,7 +184,7 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -192,7 +192,7 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) u, err := addOptions(url, opts) @@ -219,7 +219,7 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { @@ -236,7 +236,7 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) @@ -249,7 +249,7 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index e578965cc12..ba95bd3d5e3 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -61,7 +61,7 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) diff --git a/github/enterprise_actions_runner_groups.go b/github/enterprise_actions_runner_groups.go index b6bb70dae40..a6c1c0ceaae 100644 --- a/github/enterprise_actions_runner_groups.go +++ b/github/enterprise_actions_runner_groups.go @@ -79,7 +79,7 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) u, err := addOptions(u, opts) @@ -103,7 +103,7 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +122,7 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) @@ -136,7 +136,7 @@ func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, ent // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) req, err := s.client.NewRequest("POST", u, createReq) @@ -155,7 +155,7 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -174,7 +174,7 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) u, err := addOptions(u, opts) @@ -199,7 +199,7 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) @@ -214,7 +214,7 @@ func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -229,7 +229,7 @@ func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -243,7 +243,7 @@ func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Cont // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) u, err := addOptions(u, opts) @@ -268,7 +268,7 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) @@ -282,7 +282,7 @@ func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterpris // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) @@ -297,7 +297,7 @@ func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterpris // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index 6fc30d50258..416badd5593 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,7 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) @@ -51,7 +51,7 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -71,7 +71,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -95,7 +95,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index 40648673385..ef56d768e42 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index 3980a86aa4b..e43b4d1acf8 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -20,7 +20,7 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) @@ -40,7 +40,7 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) req, err := s.client.NewRequest("PATCH", u, settings) @@ -61,7 +61,7 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/gists.go b/github/gists.go index 80961fcb908..7fc972256c0 100644 --- a/github/gists.go +++ b/github/gists.go @@ -96,8 +96,8 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -126,7 +126,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -149,7 +149,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -172,7 +172,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -191,7 +191,7 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -210,7 +210,7 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" req, err := s.client.NewRequest("POST", u, gist) @@ -229,7 +229,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) @@ -248,7 +248,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { u := fmt.Sprintf("gists/%v/commits", id) u, err := addOptions(u, opts) @@ -272,7 +272,7 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -285,7 +285,7 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("PUT", u, nil) @@ -298,7 +298,7 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -311,7 +311,7 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("GET", u, nil) @@ -326,7 +326,7 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) req, err := s.client.NewRequest("POST", u, nil) @@ -345,7 +345,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) u, err := addOptions(u, opts) diff --git a/github/gists_comments.go b/github/gists_comments.go index ee0fbfa45f8..bd19e99336d 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -25,7 +25,7 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) u, err := addOptions(u, opts) @@ -49,7 +49,7 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -68,7 +68,7 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) req, err := s.client.NewRequest("POST", u, comment) @@ -87,7 +87,7 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -106,7 +106,7 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/git_blobs.go b/github/git_blobs.go index da0485ccbe2..c32e10efecf 100644 --- a/github/git_blobs.go +++ b/github/git_blobs.go @@ -23,7 +23,7 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +43,7 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +64,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) diff --git a/github/git_commits.go b/github/git_commits.go index 862837c0d59..c52e8ff5713 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -69,7 +69,7 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -103,7 +103,7 @@ type createCommit struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") diff --git a/github/git_refs.go b/github/git_refs.go index e839c30f667..93d522034c1 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -49,7 +49,7 @@ type updateRefRequest struct { // GetRef fetches a single reference in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) @@ -88,7 +88,7 @@ type ReferenceListOptions struct { // ListMatchingRefs lists references in a repository that match a supplied ref. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, opts *ReferenceListOptions) ([]*Reference, *Response, error) { var ref string if opts != nil { @@ -116,7 +116,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ @@ -139,7 +139,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) @@ -162,7 +162,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) diff --git a/github/git_tags.go b/github/git_tags.go index 30d7b2c2d23..f44a0e58d3d 100644 --- a/github/git_tags.go +++ b/github/git_tags.go @@ -35,7 +35,7 @@ type createTagRequest struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) diff --git a/github/git_trees.go b/github/git_trees.go index db28976e032..21d6e1f5a8a 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -93,7 +93,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { @@ -124,7 +124,7 @@ type createTree struct { // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) diff --git a/github/gitignore.go b/github/gitignore.go index a20a868b44a..b0cc5ca684b 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -28,7 +28,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore/#listing-available-templates +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -46,7 +46,7 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index 5c7663f583d..85af9328fa0 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/interactions_repos.go b/github/interactions_repos.go index 41e6c5319d0..ea7e177deed 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues.go b/github/issues.go index 42e58a17a8a..6854a0ecf26 100644 --- a/github/issues.go +++ b/github/issues.go @@ -132,8 +132,8 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -147,7 +147,7 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -218,7 +218,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -245,7 +245,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -267,7 +267,7 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -286,7 +286,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) @@ -307,7 +307,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) req, err := s.client.NewRequest("PATCH", u, &struct { @@ -337,7 +337,7 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) @@ -350,7 +350,7 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_assignees.go b/github/issues_assignees.go index b7f2e802437..04074e803e1 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -13,7 +13,7 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees", owner, repo) u, err := addOptions(u, opts) @@ -37,7 +37,7 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -52,7 +52,7 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` @@ -74,7 +74,7 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 17881c093dc..3feda3f50d3 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -50,8 +50,8 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { @@ -83,7 +83,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) @@ -106,7 +106,7 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -125,7 +125,7 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -143,7 +143,7 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_events.go b/github/issues_events.go index ed076591701..808a5ba97d0 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -99,7 +99,7 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number) u, err := addOptions(u, opts) @@ -125,7 +125,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -149,7 +149,7 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) diff --git a/github/issues_labels.go b/github/issues_labels.go index d0f865c03f1..d89429f7f60 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -27,7 +27,7 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) @@ -70,7 +70,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) @@ -89,7 +89,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) @@ -108,7 +108,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) @@ -120,7 +120,7 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) @@ -163,7 +163,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +176,7 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) @@ -195,7 +195,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) @@ -208,7 +208,7 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/issues_milestones.go b/github/issues_milestones.go index 897c7c0b6da..b40ade99afb 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -54,7 +54,7 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) @@ -78,7 +78,7 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -97,7 +97,7 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) @@ -116,7 +116,7 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) @@ -135,7 +135,7 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 9c73e6176d1..5a205e3ec3b 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -164,7 +164,7 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/timeline", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/licenses.go b/github/licenses.go index 0877b6d1831..fdaae5cfaa9 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -60,7 +60,7 @@ func (l License) String() string { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/en/rest/licenses/#list-all-licenses +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -78,7 +78,7 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-a-license +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/migrations.go b/github/migrations.go index 67989c0789f..6a47d0e0f2c 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -74,7 +74,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +103,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +131,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +155,7 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +192,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +212,7 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index 74a04b22a4e..b20abf0ec98 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -146,7 +146,7 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +165,7 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +184,7 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +213,7 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +234,7 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +255,7 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +274,7 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +293,7 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/migrations_user.go b/github/migrations_user.go index 6586fdb2d3f..28c9258d927 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -67,7 +67,7 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { u := "user/migrations" @@ -96,7 +96,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { u := "user/migrations" u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) @@ -148,7 +148,7 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -182,7 +182,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -202,7 +202,7 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) diff --git a/github/misc.go b/github/misc.go index 89615241570..4910383d858 100644 --- a/github/misc.go +++ b/github/misc.go @@ -39,7 +39,7 @@ type markdownRequest struct { // Markdown renders an arbitrary Markdown document. // -// GitHub API docs: https://docs.github.com/en/rest/markdown/ +// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRequest{Text: String(text)} if opts != nil { @@ -67,7 +67,7 @@ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOption // ListEmojis returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/emojis/ +// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { req, err := c.NewRequest("GET", "emojis", nil) if err != nil { @@ -97,7 +97,7 @@ func (c *CodeOfConduct) String() string { // ListCodesOfConduct returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := c.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -119,6 +119,8 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // GetCodeOfConduct returns an individual code of conduct. // // https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct +// +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := c.NewRequest("GET", u, nil) @@ -190,7 +192,7 @@ type APIMeta struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { req, err := c.NewRequest("GET", "meta", nil) if err != nil { @@ -208,6 +210,8 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used. +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { @@ -231,6 +235,8 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // Zen returns a random line from The Zen of GitHub. // // see also: http://warpspire.com/posts/taste/ +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github func (c *Client) Zen(ctx context.Context) (string, *Response, error) { req, err := c.NewRequest("GET", "zen", nil) if err != nil { @@ -260,8 +266,6 @@ func (s *ServiceHook) String() string { } // ListServiceHooks lists all of the available service hooks. -// -// GitHub API docs: https://developer.github.com/webhooks/#services func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error) { u := "hooks" req, err := c.NewRequest("GET", u, nil) diff --git a/github/orgs.go b/github/orgs.go index 0c7e361b3fc..0e55d4c2491 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -148,7 +148,7 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { u, err := addOptions("organizations", opts) if err != nil { @@ -171,8 +171,8 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -201,7 +201,7 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("GET", u, nil) @@ -242,7 +242,7 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) @@ -264,7 +264,7 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +277,7 @@ func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Respons // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { u := fmt.Sprintf("orgs/%v/installations", org) diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index e3b35b1df1f..d21be00204c 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -25,7 +25,7 @@ func (a ActionsAllowed) String() string { // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index 6d1db2ee0a3..6701ba8f3a0 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -25,7 +25,7 @@ func (a ActionsPermissions) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) req, err := s.client.NewRequest("PUT", u, actionsPermissions) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 4c34445fa1b..8cf39cd16d4 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -133,7 +133,7 @@ type AuditEntryData struct { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go index 6d56fe8f79a..451369e0d49 100644 --- a/github/orgs_credential_authorizations.go +++ b/github/orgs_credential_authorizations.go @@ -58,7 +58,7 @@ type CredentialAuthorization struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) @@ -83,7 +83,7 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) req, err := s.client.NewRequest(http.MethodDelete, u, nil) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 7c1b2d6292d..c697adfc1c9 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -30,7 +30,7 @@ type CustomRepoRoles struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -59,7 +59,7 @@ type CreateOrUpdateCustomRoleOptions struct { // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -80,7 +80,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) @@ -101,7 +101,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go index c0dd51e24e3..6507d52938d 100644 --- a/github/orgs_hooks.go +++ b/github/orgs_hooks.go @@ -12,7 +12,7 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -59,7 +59,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) @@ -86,7 +86,7 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -105,7 +105,7 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d/pings", org, id) req, err := s.client.NewRequest("POST", u, nil) @@ -118,7 +118,7 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_hooks_configuration.go b/github/orgs_hooks_configuration.go index 953a2329c36..fda237b31d8 100644 --- a/github/orgs_hooks_configuration.go +++ b/github/orgs_hooks_configuration.go @@ -12,7 +12,7 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/orgs_hooks_deliveries.go b/github/orgs_hooks_deliveries.go index 1bfad409ea5..e78cecc3968 100644 --- a/github/orgs_hooks_deliveries.go +++ b/github/orgs_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_members.go b/github/orgs_members.go index 79f8a653333..bfbd4d8ab07 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -71,8 +71,8 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-members -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -101,7 +101,7 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +131,7 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -145,7 +145,7 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -158,7 +158,7 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { u := "user/memberships/orgs" u, err := addOptions(u, opts) @@ -207,8 +207,8 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -235,8 +235,8 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) { var u, method string if user != "" { @@ -264,7 +264,7 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +277,7 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) u, err := addOptions(u, opts) @@ -323,7 +323,7 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) @@ -344,7 +344,7 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v/teams", org, invitationID) u, err := addOptions(u, opts) @@ -368,7 +368,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed inviatations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/failed_invitations", org) u, err := addOptions(u, opts) diff --git a/github/orgs_outside_collaborators.go b/github/orgs_outside_collaborators.go index 506a4946034..4995749b386 100644 --- a/github/orgs_outside_collaborators.go +++ b/github/orgs_outside_collaborators.go @@ -27,7 +27,7 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators", org) u, err := addOptions(u, opts) @@ -52,7 +52,7 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,7 +69,7 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0ae68aaa369..0dfe7841695 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,7 @@ import ( // List the packages for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // Get a package by name from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // Delete a package from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // Restore a package to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) @@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization 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, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // Get a specific version of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // Delete a package version from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization 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) req, err := s.client.NewRequest("DELETE", u, nil) @@ -137,7 +137,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // Restore a package version to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index c30ff2843ee..f73d48c691e 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -21,7 +21,7 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) diff --git a/github/orgs_projects.go b/github/orgs_projects.go index d49eae54dce..01087fb97a1 100644 --- a/github/orgs_projects.go +++ b/github/orgs_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-organization-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt // CreateProject creates a GitHub Project for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-an-organization-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/orgs_rules.go b/github/orgs_rules.go index a3905af8fb3..75cfd853620 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -12,7 +12,7 @@ import ( // GetAllOrganizationRulesets gets all the rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -32,7 +32,7 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o // CreateOrganizationRuleset creates a ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -52,7 +52,7 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or // GetOrganizationRuleset gets a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) @@ -72,7 +72,7 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s // UpdateOrganizationRuleset updates a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset 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) @@ -92,7 +92,7 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or // DeleteOrganizationRuleset deletes a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go index a3f002e0e1c..a495f63243c 100644 --- a/github/orgs_security_managers.go +++ b/github/orgs_security_managers.go @@ -12,7 +12,7 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/security-managers", org) @@ -32,7 +32,7 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("PUT", u, nil) @@ -45,7 +45,7 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_users_blocking.go b/github/orgs_users_blocking.go index 9c6cf60269e..fd534f4a58c 100644 --- a/github/orgs_users_blocking.go +++ b/github/orgs_users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -58,7 +58,7 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -75,7 +75,7 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) diff --git a/github/projects.go b/github/projects.go index df7ad6cd97e..c968dc58b56 100644 --- a/github/projects.go +++ b/github/projects.go @@ -43,7 +43,7 @@ func (p Project) String() string { // GetProject gets a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#get-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -90,7 +90,7 @@ type ProjectOptions struct { // UpdateProject updates a repository project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#update-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("PATCH", u, opts) @@ -112,7 +112,7 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *Pro // DeleteProject deletes a GitHub Project from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#delete-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -142,7 +142,7 @@ type ProjectColumn struct { // ListProjectColumns lists the columns of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#list-project-columns +// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) u, err := addOptions(u, opts) @@ -169,7 +169,7 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 // GetProjectColumn gets a column of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#get-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -199,7 +199,7 @@ type ProjectColumnOptions struct { // CreateProjectColumn creates a column for the specified (by number) project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#create-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) req, err := s.client.NewRequest("POST", u, opts) @@ -221,7 +221,7 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int // UpdateProjectColumn updates a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#update-an-existing-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -243,7 +243,7 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 // DeleteProjectColumn deletes a column from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#delete-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -267,7 +267,7 @@ type ProjectColumnMoveOptions struct { // MoveProjectColumn moves a column within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#move-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/%v/moves", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -318,7 +318,7 @@ type ProjectCardListOptions struct { // ListProjectCards lists the cards in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#list-project-cards +// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) u, err := addOptions(u, opts) @@ -345,7 +345,7 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, // GetProjectCard gets a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#get-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("GET", u, nil) @@ -383,7 +383,7 @@ type ProjectCardOptions struct { // CreateProjectCard creates a card in the specified column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#create-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -405,7 +405,7 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, // UpdateProjectCard updates a card of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#update-an-existing-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -427,7 +427,7 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o // DeleteProjectCard deletes a card from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#delete-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -455,7 +455,7 @@ type ProjectCardMoveOptions struct { // MoveProjectCard moves a card within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#move-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) req, err := s.client.NewRequest("POST", u, opts) @@ -485,7 +485,7 @@ type ProjectCollaboratorOptions struct { // AddProjectCollaborator adds a collaborator to an organization project and sets // their permission level. You must be an organization owner or a project admin to add a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#add-project-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("PUT", u, opts) @@ -502,7 +502,7 @@ func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, // RemoveProjectCollaborator removes a collaborator from an organization project. // You must be an organization owner or a project admin to remove a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#remove-user-as-a-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("DELETE", u, nil) @@ -538,7 +538,7 @@ type ListCollaboratorOptions struct { // with access through default organization permissions, and organization owners. You must be an // organization owner or a project admin to list collaborators. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#list-project-collaborators +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators", id) u, err := addOptions(u, opts) @@ -576,7 +576,7 @@ type ProjectPermissionLevel struct { // project. Possible values for the permission key: "admin", "write", "read", "none". // You must be an organization owner or a project admin to review a user's permission level. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#get-project-permission-for-a-user +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/pulls.go b/github/pulls.go index 29549e24b86..6ee50a1f1c8 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -142,7 +142,7 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +169,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // The results may include open and closed pull requests. // By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) @@ -195,7 +195,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -214,7 +214,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -254,7 +254,7 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) @@ -293,7 +293,7 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/update-branch", owner, repo, number) @@ -328,7 +328,7 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, fmt.Errorf("pull must be provided") @@ -365,7 +365,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) @@ -389,7 +389,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) @@ -413,7 +413,7 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -455,7 +455,7 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index ea1cf45d1e8..82346410060 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -68,8 +68,8 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-on-a-pull-request -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string if number == 0 { @@ -102,7 +102,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -125,7 +125,7 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -147,7 +147,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` @@ -174,7 +174,7 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -193,7 +193,7 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 1c336540b81..4489bb55c84 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -25,7 +25,7 @@ type Reviewers struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("POST", u, &reviewers) @@ -44,7 +44,7 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#list-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) @@ -68,7 +68,7 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, &reviewers) diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index addcce46834..c80924ba8a7 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -100,7 +100,7 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -144,7 +144,7 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -164,7 +164,7 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) u, err := addOptions(u, opts) @@ -188,8 +188,6 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request -// // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: // @@ -223,6 +221,8 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // Use this instead. // It is waaaaaay better. // ``` +// +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) @@ -251,7 +251,7 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { opts := &struct { Body string `json:"body"` @@ -274,7 +274,7 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -294,7 +294,7 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/github/reactions.go b/github/reactions.go index 14d193ae887..c246356fd9b 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -60,7 +60,7 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -114,7 +114,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -123,7 +123,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -132,7 +132,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -162,7 +162,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -186,7 +186,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -195,7 +195,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -234,7 +234,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -258,7 +258,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -267,7 +267,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -276,7 +276,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -306,7 +306,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -330,7 +330,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -339,7 +339,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -348,7 +348,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -375,7 +375,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -398,7 +398,7 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -407,7 +407,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -416,7 +416,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -442,7 +442,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -465,7 +465,7 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -474,7 +474,7 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -498,7 +498,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 83fc3f8e734..5886bb282f8 100644 --- a/github/repos.go +++ b/github/repos.go @@ -264,8 +264,8 @@ func (d DependabotSecurityUpdates) String() string { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -316,7 +316,7 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/repos", org) u, err := addOptions(u, opts) @@ -351,7 +351,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -423,8 +423,8 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -491,7 +491,7 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -512,7 +512,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -543,7 +543,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep // Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -584,7 +584,7 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -605,7 +605,7 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -652,7 +652,7 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -671,7 +671,7 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -688,7 +688,7 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -705,7 +705,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -724,7 +724,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -738,7 +738,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -752,7 +752,7 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) @@ -783,7 +783,7 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -802,7 +802,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) @@ -834,7 +834,7 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) @@ -1249,7 +1249,7 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -1273,7 +1273,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) @@ -1302,7 +1302,7 @@ type renameBranchRequest struct { // To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. // To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) r := &renameBranchRequest{NewName: newName} @@ -1322,7 +1322,7 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // GetBranchProtection gets the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1347,7 +1347,7 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // GetRequiredStatusChecks gets the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1369,7 +1369,7 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // ListRequiredStatusChecksContexts lists the required status checks contexts for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1390,7 +1390,7 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // UpdateBranchProtection updates the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, preq) @@ -1412,7 +1412,7 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // RemoveBranchProtection removes the protection of a given branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1425,7 +1425,7 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // GetSignaturesProtectedBranch gets required signatures of protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1448,7 +1448,7 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1470,7 +1470,7 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1486,7 +1486,7 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, sreq) @@ -1505,7 +1505,7 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // RemoveRequiredStatusChecks removes the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1518,7 +1518,7 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1537,7 +1537,7 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // GetPullRequestReviewEnforcement gets pull request review enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1560,7 +1560,7 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // UpdatePullRequestReviewEnforcement patches pull request review enforcement of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, patch) @@ -1583,7 +1583,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // DisableDismissalRestrictions disables dismissal restrictions of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) @@ -1610,7 +1610,7 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // RemovePullRequestReviewEnforcement removes pull request enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1623,7 +1623,7 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // GetAdminEnforcement gets admin enforcement information of a protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1643,7 +1643,7 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // AddAdminEnforcement adds admin enforcement to a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1662,7 +1662,7 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // RemoveAdminEnforcement removes admin enforcement from a protected branch. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1680,7 +1680,7 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1702,7 +1702,7 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ @@ -1731,9 +1731,9 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // ListApps lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Deprecated: Please use ListAppRestrictions instead. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1753,9 +1753,9 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // ListAppRestrictions lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { return s.ListApps(ctx, owner, repo, branch) } @@ -1766,7 +1766,7 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, apps) @@ -1788,7 +1788,7 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("POST", u, apps) @@ -1810,7 +1810,7 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, apps) @@ -1830,7 +1830,7 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // ListTeamRestrictions lists the GitHub teams that have push access to a given protected branch. // It requires the GitHub teams to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1853,7 +1853,7 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, teams) @@ -1875,7 +1875,7 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("POST", u, teams) @@ -1897,7 +1897,7 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, teams) @@ -1917,7 +1917,7 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // ListUserRestrictions lists the GitHub users that have push access to a given protected branch. // It requires the GitHub users to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1940,7 +1940,7 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, users) @@ -1962,7 +1962,7 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("POST", u, users) @@ -1984,7 +1984,7 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, users) @@ -2016,7 +2016,7 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) @@ -2045,7 +2045,7 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) @@ -2073,7 +2073,7 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) @@ -2093,7 +2093,7 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) diff --git a/github/repos_actions_access.go b/github/repos_actions_access.go index 55761eeb7ee..9919daacca2 100644 --- a/github/repos_actions_access.go +++ b/github/repos_actions_access.go @@ -23,7 +23,7 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +43,7 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) diff --git a/github/repos_actions_allowed.go b/github/repos_actions_allowed.go index 25a46905839..f7bc2184dcb 100644 --- a/github/repos_actions_allowed.go +++ b/github/repos_actions_allowed.go @@ -12,7 +12,7 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index 45f844cec02..9e0b956d6e8 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -25,7 +25,7 @@ func (a ActionsPermissionsRepository) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -44,7 +44,7 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // EditActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index 0d2cec618f0..ab821076e3d 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -28,7 +28,7 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) u, err := addOptions(u, opts) @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -72,7 +72,7 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) @@ -93,7 +93,7 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go index 835d56e164c..0771ce6d5e2 100644 --- a/github/repos_codeowners.go +++ b/github/repos_codeowners.go @@ -28,7 +28,7 @@ type CodeownersError struct { // GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-codeowners-errors +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string) (*CodeownersErrors, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index c2396872f2e..8f985b8edae 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -48,7 +48,7 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators", owner, repo) u, err := addOptions(u, opts) @@ -75,7 +75,7 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -99,7 +99,7 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -134,7 +134,7 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -154,7 +154,7 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_comments.go b/github/repos_comments.go index e282374e9e5..068e257cf28 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -35,7 +35,7 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments", owner, repo) u, err := addOptions(u, opts) @@ -62,7 +62,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) req, err := s.client.NewRequest("POST", u, comment) @@ -109,7 +109,7 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +131,7 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, comment) @@ -150,7 +150,7 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_commits.go b/github/repos_commits.go index d1fb577c61c..0536793fd5d 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -124,7 +124,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -148,8 +148,7 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-single-commit -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) u, err := addOptions(u, opts) @@ -173,7 +172,7 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -202,7 +201,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) @@ -227,7 +226,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -258,7 +257,7 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo st // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -291,7 +290,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 750ee158270..5a59941c008 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -43,7 +43,7 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_contents.go b/github/repos_contents.go index de7a0d5b82b..ba15f240f65 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -98,7 +98,7 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/readme", owner, repo) u, err := addOptions(u, opts) @@ -128,6 +128,8 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -162,6 +164,8 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -198,7 +202,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed // to appear anywhere in the "path" or this method will return an error. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { return nil, nil, nil, ErrPathForbidden @@ -238,7 +242,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -258,7 +262,7 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -278,7 +282,7 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("DELETE", u, opts) @@ -310,7 +314,8 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go index 8c4628b39bc..f88a29c10e7 100644 --- a/github/repos_deployment_branch_policies.go +++ b/github/repos_deployment_branch_policies.go @@ -30,7 +30,7 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -50,7 +50,7 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -70,7 +70,7 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -90,7 +90,7 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -110,7 +110,7 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 36445f895e2..f1471dc1b9d 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -63,7 +63,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opts) @@ -87,7 +87,7 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) @@ -107,7 +107,7 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) @@ -131,7 +131,7 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -175,7 +175,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opts) @@ -203,7 +203,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) @@ -227,7 +227,7 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) diff --git a/github/repos_environments.go b/github/repos_environments.go index 2399a42c746..cf7574722b6 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -106,7 +106,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-all-environments +// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) @@ -129,7 +129,7 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -184,7 +184,7 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -230,7 +230,7 @@ func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u st // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) diff --git a/github/repos_forks.go b/github/repos_forks.go index f175dfe3b03..763f23b8dbc 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -23,7 +23,7 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) @@ -66,7 +66,7 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index ba229e7bca8..7fa7ef7d4e8 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/en/rest/webhooks/repos#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) @@ -106,7 +106,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/en/rest/webhooks/repos#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +130,7 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -148,7 +148,7 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -166,7 +166,7 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -178,7 +178,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/en/rest/webhooks/repos#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -190,7 +190,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/en/rest/webhooks/repos#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -201,8 +201,6 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, } // Subscribe lets servers register to receive updates when a topic is updated. -// -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -213,8 +211,6 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, } // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. -// -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index 5aadfb645e1..c5df6077dfb 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/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,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/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 5f2f8807e4b..9ba80a374d8 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/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) u, err := addOptions(u, opts) @@ -87,7 +87,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/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -106,7 +106,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/en/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 81956cd49c9..fcbcc01baff 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -27,7 +27,7 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { opts := &struct { Permissions string `json:"permissions"` diff --git a/github/repos_keys.go b/github/repos_keys.go index 42c5de49709..c6f0c8b371e 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +38,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +58,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -78,7 +78,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_lfs.go b/github/repos_lfs.go index 6ac2e5a8778..5f92f557fa6 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -12,7 +12,7 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // -// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#enable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) @@ -31,7 +31,7 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // -// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#disable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) diff --git a/github/repos_merging.go b/github/repos_merging.go index 66e88452e86..440bd30128e 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -34,7 +34,7 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -54,7 +54,7 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) req, err := s.client.NewRequest("POST", u, request) diff --git a/github/repos_pages.go b/github/repos_pages.go index 83075dbdd23..188d2f9ae39 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -103,7 +103,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -153,7 +153,7 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -172,7 +172,7 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -188,7 +188,7 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -207,7 +207,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -231,7 +231,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -250,7 +250,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -269,7 +269,7 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/en/rest/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) @@ -288,7 +288,7 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 1ce6478d33b..cd4c81431ec 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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#list-pre-receive-hooks +// 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 func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#get-a-single-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 func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -73,7 +73,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#update-pre-receive-hook-enforcement +// 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 func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -95,7 +95,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#remove-enforcement-overrides-for-a-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 func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_projects.go b/github/repos_projects.go index a3001dee988..39650c7da60 100644 --- a/github/repos_projects.go +++ b/github/repos_projects.go @@ -21,7 +21,7 @@ type ProjectListOptions struct { // ListProjects lists the projects for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-repository-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri // CreateProject creates a GitHub Project for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-repository-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/repos_releases.go b/github/repos_releases.go index e2aa845af2f..1e3ec316517 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -87,7 +87,7 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) u, err := addOptions(u, opts) @@ -110,7 +110,7 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) return s.getSingleRelease(ctx, u) @@ -118,7 +118,7 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo) return s.getSingleRelease(ctx, u) @@ -126,7 +126,7 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/tags/%s", owner, repo, tag) return s.getSingleRelease(ctx, u) @@ -134,7 +134,7 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -188,7 +188,7 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) @@ -222,7 +222,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -252,7 +252,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -265,7 +265,7 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) @@ -288,7 +288,7 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -317,7 +317,7 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // exist, but it's possible to pass any http.Client. If nil is passed the // redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -379,7 +379,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -398,7 +398,7 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -412,7 +412,7 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) diff --git a/github/repos_rules.go b/github/repos_rules.go index 7f964fe6655..c107e98d521 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -349,7 +349,7 @@ type Ruleset struct { // GetRulesForBranch gets all the rules that apply to the specified branch. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-rules-for-a-branch +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) @@ -370,7 +370,7 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo // GetAllRulesets gets all the rules that apply to the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-all-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) @@ -390,7 +390,7 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // CreateRuleset creates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#create-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) @@ -411,7 +411,7 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str // GetRuleset gets a ruleset for the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) @@ -431,7 +431,7 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // UpdateRuleset updates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#update-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) @@ -451,7 +451,7 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str // DeleteRuleset deletes a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#delete-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) diff --git a/github/repos_stats.go b/github/repos_stats.go index 3df0a8f6deb..2578217b9a0 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -45,7 +45,7 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +84,7 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +111,7 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +167,7 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +200,7 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_statuses.go b/github/repos_statuses.go index ea3d166c753..0381e306ec1 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -45,7 +45,7 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -70,7 +70,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) @@ -109,7 +109,7 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) diff --git a/github/repos_tags.go b/github/repos_tags.go index ff46d90c731..a3487c74005 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -24,7 +24,7 @@ type tagProtectionRequest struct { // ListTagProtection lists tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) @@ -44,7 +44,7 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // CreateTagProtection creates the tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) r := &tagProtectionRequest{Pattern: pattern} @@ -64,7 +64,7 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // DeleteTagProtection deletes a tag protection from the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_traffic.go b/github/repos_traffic.go index bf093c03ea7..39ebc42b87f 100644 --- a/github/repos_traffic.go +++ b/github/repos_traffic.go @@ -54,7 +54,7 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) @@ -74,7 +74,7 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) @@ -94,7 +94,7 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/views", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +118,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/github/scim.go b/github/scim.go index 7deee6be4b5..81f6a9745ff 100644 --- a/github/scim.go +++ b/github/scim.go @@ -81,7 +81,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/en/rest/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -123,7 +123,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -142,7 +142,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -193,7 +193,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index adb832d0d8f..18e98c27de1 100644 --- a/github/search.go +++ b/github/search.go @@ -72,7 +72,7 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-repositories +// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -107,7 +107,7 @@ type TopicResult struct { // Please see https://help.github.com/en/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-topics +// GitHub API docs: https://docs.github.com/rest/search/search#search-topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -142,7 +142,7 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-commits +// GitHub API docs: https://docs.github.com/rest/search/search#search-commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -162,7 +162,7 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -182,7 +182,7 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-users +// GitHub API docs: https://docs.github.com/rest/search/search#search-users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -235,7 +235,7 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-code +// GitHub API docs: https://docs.github.com/rest/search/search#search-code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -270,7 +270,7 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-labels +// GitHub API docs: https://docs.github.com/rest/search/search#search-labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index b8295cbf791..0499af28d6e 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -92,7 +92,7 @@ type SecretScanningAlertUpdateOptions struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -119,7 +119,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -146,7 +146,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -173,7 +173,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -196,7 +196,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -219,7 +219,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/security_advisories.go b/github/security_advisories.go index a75fce54d95..ecd6ae566f3 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -15,7 +15,7 @@ type SecurityAdvisoriesService service // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) diff --git a/github/teams.go b/github/teams.go index 0ee7c200792..a41cdbaa41d 100644 --- a/github/teams.go +++ b/github/teams.go @@ -81,7 +81,7 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -174,7 +174,7 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) req, err := s.client.NewRequest("POST", u, team) @@ -220,7 +220,7 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) @@ -247,7 +247,7 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) @@ -274,7 +274,7 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -287,7 +287,7 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("DELETE", u, nil) @@ -300,7 +300,7 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID) u, err := addOptions(u, opts) @@ -324,7 +324,7 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/teams", org, slug) u, err := addOptions(u, opts) @@ -348,7 +348,7 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID) u, err := addOptions(u, opts) @@ -376,7 +376,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos", org, slug) u, err := addOptions(u, opts) @@ -406,7 +406,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -430,7 +430,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -469,7 +469,7 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -484,7 +484,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -499,7 +499,7 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -514,7 +514,7 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -526,7 +526,8 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne } // ListUserTeams lists a user's teams -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user +// +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { u := "user/teams" u, err := addOptions(u, opts) @@ -550,7 +551,7 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) @@ -574,7 +575,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // ListTeamProjectsBySlug lists the organization projects for a team given the team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) @@ -599,7 +600,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -623,7 +624,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -660,7 +661,7 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -679,7 +680,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -701,7 +702,7 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -723,7 +724,7 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -752,7 +753,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -777,7 +778,7 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -798,7 +799,7 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -819,7 +820,7 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -840,7 +841,7 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -888,7 +889,7 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -915,7 +916,7 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/external-groups", org) u, err := addOptions(u, opts) @@ -939,7 +940,7 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -959,7 +960,7 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -979,7 +980,7 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index f3a1cc4dc00..ad4584c9eaf 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -43,7 +43,7 @@ type DiscussionCommentListOptions struct { // ListCommentsByID lists all comments on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) u, err := addOptions(u, options) @@ -68,7 +68,7 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 // ListCommentsBySlug lists all comments on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) u, err := addOptions(u, options) @@ -93,7 +93,7 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, // GetCommentByID gets a specific comment on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -113,7 +113,7 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, // GetCommentBySlug gets a specific comment on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) @@ -134,7 +134,7 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // CreateCommentByID creates a new comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -154,7 +154,7 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // CreateCommentBySlug creates a new comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -175,7 +175,7 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -196,7 +196,7 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -216,7 +216,7 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, // DeleteCommentByID deletes a comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -230,7 +230,7 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 // DeleteCommentBySlug deletes a comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_discussions.go b/github/teams_discussions.go index 69a3ebd51ff..246f919ee2d 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -49,7 +49,7 @@ type DiscussionListOptions struct { // ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in // ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) u, err := addOptions(u, opts) @@ -99,7 +99,7 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri // GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 // GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -139,7 +139,7 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string // CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) req, err := s.client.NewRequest("POST", u, discussion) @@ -159,7 +159,7 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i // CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) req, err := s.client.NewRequest("POST", u, discussion) @@ -180,7 +180,7 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -201,7 +201,7 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -221,7 +221,7 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin // DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -235,7 +235,7 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_members.go b/github/teams_members.go index 58cb79744e1..9a9bd57db54 100644 --- a/github/teams_members.go +++ b/github/teams_members.go @@ -23,7 +23,7 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) u, err := addOptions(u, opts) @@ -73,7 +73,7 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("GET", u, nil) @@ -93,7 +93,7 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("GET", u, nil) @@ -127,7 +127,7 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -147,7 +147,7 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -167,7 +167,7 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -195,7 +195,7 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) u, err := addOptions(u, opts) @@ -220,7 +220,7 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) u, err := addOptions(u, opts) diff --git a/github/users.go b/github/users.go index 1b0670103b3..47691f65a01 100644 --- a/github/users.go +++ b/github/users.go @@ -79,8 +79,8 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { @@ -123,7 +123,7 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" req, err := s.client.NewRequest("PATCH", u, user) @@ -165,7 +165,7 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { u := fmt.Sprintf("users/%v/hovercard", user) u, err := addOptions(u, opts) @@ -203,7 +203,7 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/rest/users/users#list-users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { u, err := addOptions("users", opts) if err != nil { @@ -227,7 +227,7 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u, err := addOptions("user/repository_invitations", opts) if err != nil { @@ -251,7 +251,7 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("PATCH", u, nil) @@ -265,7 +265,7 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index aef947ec451..f9299c7e653 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://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +26,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://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -45,7 +45,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -59,7 +59,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/github/users_blocking.go b/github/users_blocking.go index 3d38d947898..22eba4577f2 100644 --- a/github/users_blocking.go +++ b/github/users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { u := "user/blocks" u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -58,7 +58,7 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -75,7 +75,7 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) diff --git a/github/users_emails.go b/github/users_emails.go index 67bd210e8d5..fdb8aafeaed 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -17,7 +17,7 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { u := "user/emails" u, err := addOptions(u, opts) @@ -41,7 +41,7 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" req, err := s.client.NewRequest("POST", u, emails) @@ -60,7 +60,7 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" req, err := s.client.NewRequest("DELETE", u, emails) @@ -74,7 +74,7 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" diff --git a/github/users_followers.go b/github/users_followers.go index 1266e0e9ee3..f855af5d27a 100644 --- a/github/users_followers.go +++ b/github/users_followers.go @@ -13,8 +13,8 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-the-authenticated-user-follows -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -75,8 +75,8 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string if user != "" { @@ -97,7 +97,7 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("PUT", u, nil) @@ -110,7 +110,7 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 54189b83077..2e3a43da3eb 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -44,8 +44,8 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { @@ -75,7 +75,7 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -95,7 +95,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#create-a-gpg-key +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` @@ -117,7 +117,7 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_keys.go b/github/users_keys.go index b49b8e4b4ef..6897657978c 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -30,8 +30,8 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { @@ -60,7 +60,7 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) @@ -80,7 +80,7 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" @@ -100,7 +100,7 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) diff --git a/github/users_packages.go b/github/users_packages.go index da04919eccd..b77eb2f37ee 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,8 @@ import ( // List the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // Get a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -71,8 +71,8 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // Delete a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -92,8 +92,8 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // Restore a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -113,8 +113,8 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // Get all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -144,8 +144,8 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // Get a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -171,8 +171,8 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // Delete a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -192,8 +192,8 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // Restore a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { diff --git a/github/users_projects.go b/github/users_projects.go index 0cbd61f923c..674ce01501e 100644 --- a/github/users_projects.go +++ b/github/users_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-user-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("users/%v/projects", user) u, err := addOptions(u, opts) @@ -47,7 +47,7 @@ type CreateUserProjectOptions struct { // CreateProject creates a GitHub Project for the current user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-user-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go index 567623f8875..9378ae73370 100644 --- a/github/users_ssh_signing_keys.go +++ b/github/users_ssh_signing_keys.go @@ -25,8 +25,8 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) { var u string if user != "" { @@ -55,7 +55,7 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) @@ -75,7 +75,7 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { u := "user/ssh_signing_keys" @@ -95,7 +95,7 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) From 11baddfe8db5b45623b27a55f22ecb021196cff9 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 15:17:20 -0500 Subject: [PATCH 02/34] use metadata.yaml to reconcile source with OpenAPI descriptions --- .github/dependabot.yml | 2 +- .github/workflows/linter.yml | 7 +- .github/workflows/tests.yml | 12 +- .gitignore | 2 + github/gen-accessors.go | 9 +- github/gen-stringify-test.go | 9 +- github/github.go | 1 + metadata.yaml | 11211 ++++++++++++++++ script/diff-check | 50 + script/golangci-lint | 22 + script/lint | 27 + script/metadata | 15 + tools/go.mod | 32 + tools/go.sum | 94 + tools/internal/internal.go | 154 + tools/internal/metadata.go | 402 + tools/internal/openapi.go | 146 + tools/internal/openapi_test.go | 79 + tools/internal/validate.go | 83 + tools/metadata/metadata.go | 174 + update-urls/activity-events_test.go | 190 - update-urls/go.mod | 8 - update-urls/go.sum | 4 - update-urls/main.go | 1352 -- update-urls/main_test.go | 617 - update-urls/reactions_test.go | 140 - update-urls/testdata/activity-events.html | 5686 -------- .../testdata/activity_events-original.go | 196 - update-urls/testdata/activity_events-want.go | 196 - update-urls/testdata/reactions-original.go | 490 - update-urls/testdata/reactions-want.go | 490 - update-urls/testdata/reactions.html | 5690 -------- 32 files changed, 12507 insertions(+), 15083 deletions(-) create mode 100644 metadata.yaml create mode 100755 script/diff-check create mode 100755 script/golangci-lint create mode 100755 script/lint create mode 100755 script/metadata create mode 100644 tools/go.mod create mode 100644 tools/go.sum create mode 100644 tools/internal/internal.go create mode 100644 tools/internal/metadata.go create mode 100644 tools/internal/openapi.go create mode 100644 tools/internal/openapi_test.go create mode 100644 tools/internal/validate.go create mode 100644 tools/metadata/metadata.go delete mode 100644 update-urls/activity-events_test.go delete mode 100644 update-urls/go.mod delete mode 100644 update-urls/go.sum delete mode 100644 update-urls/main.go delete mode 100644 update-urls/main_test.go delete mode 100644 update-urls/reactions_test.go delete mode 100644 update-urls/testdata/activity-events.html delete mode 100644 update-urls/testdata/activity_events-original.go delete mode 100644 update-urls/testdata/activity_events-want.go delete mode 100644 update-urls/testdata/reactions-original.go delete mode 100644 update-urls/testdata/reactions-want.go delete mode 100644 update-urls/testdata/reactions.html diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d4960c13431..0c068c6c1ac 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: schedule: interval: weekly - package-ecosystem: gomod - directory: update-urls + directory: tools schedule: interval: weekly - package-ecosystem: github-actions diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4f3cdf8e4df..c7e8b037605 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -18,15 +18,18 @@ jobs: - "" - example - scrape - - update-urls + - tools runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: 1.x - name: golangci-lint ${{ matrix.working-directory }} uses: golangci/golangci-lint-action@v3 with: - version: latest + version: v1.54.2 working-directory: ${{ matrix.working-directory}} args: --verbose diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87d97f99c09..fa0983a5ea8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,7 @@ jobs: restore-keys: ${{ runner.os }}-go- - name: Ensure go generate produces a zero diff + if: ${{ matrix.update-coverage }} shell: bash run: go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) @@ -77,9 +78,10 @@ jobs: if: ${{ matrix.update-coverage }} uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3.1.4 - - name: Ensure go generate produces a zero diff for update-urls - shell: bash - run: cd update-urls && go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + - name: Run go test for tools + if: ${{ matrix.update-coverage }} + run: cd tools && go test -v -race ./... - - name: Run go test for update-urls - run: cd update-urls && go test -v -race ./... + - name: Validate metadata.yaml + if: ${{ matrix.update-coverage }} + run: script/metadata validate diff --git a/.gitignore b/.gitignore index 704f4ef5b54..8e43a1dd010 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.sh *.test coverage.out +/bin + # intellij files .idea/ vendor/ diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 4bc22acdc15..59b981dba8d 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -196,18 +196,11 @@ func (t *templateData) dump() error { } logf("Writing %v...", filename) - if err := os.Chmod(filename, 0644); err != nil { - return fmt.Errorf("os.Chmod(%q, 0644): %v", filename, err) - } - if err := os.WriteFile(filename, clean, 0444); err != nil { + if err := os.WriteFile(filename, clean, 0644); err != nil { return err } - if err := os.Chmod(filename, 0444); err != nil { - return fmt.Errorf("os.Chmod(%q, 0444): %v", filename, err) - } - return nil } diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 5a42082b93d..018d5ac335c 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -351,18 +351,11 @@ func (t *templateData) dump() error { } logf("Writing %v...", t.filename) - if err := os.Chmod(t.filename, 0644); err != nil { - return fmt.Errorf("os.Chmod(%q, 0644): %v", t.filename, err) - } - if err := os.WriteFile(t.filename, clean, 0444); err != nil { + if err := os.WriteFile(t.filename, clean, 0644); err != nil { return err } - if err := os.Chmod(t.filename, 0444); err != nil { - return fmt.Errorf("os.Chmod(%q, 0444): %v", t.filename, err) - } - return nil } diff --git a/github/github.go b/github/github.go index e16bb084466..edbf3484c2c 100644 --- a/github/github.go +++ b/github/github.go @@ -5,6 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go +//go:generate ../script/metadata update-urls package github diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 00000000000..6f4d1169c9c --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,11211 @@ +undocumented_methods: + - ActionsService.AddRepoToRequiredWorkflow + - ActionsService.CreateRequiredWorkflow + - ActionsService.DeleteRequiredWorkflow + - ActionsService.GetRequiredWorkflowByID + - ActionsService.ListOrgRequiredWorkflows + - ActionsService.ListRepoRequiredWorkflows + - ActionsService.ListRequiredWorkflowSelectedRepos + - ActionsService.RemoveRepoFromRequiredWorkflow + - ActionsService.SetRequiredWorkflowSelectedRepos + - ActionsService.UpdateRequiredWorkflow + - AppsService.FindRepositoryInstallationByID + - Client.ListServiceHooks + - IssueImportService.CheckStatus + - IssueImportService.CheckStatusSince + - IssueImportService.Create + - OrganizationsService.GetByID + - RepositoriesService.GetByID + - RepositoriesService.Subscribe + - RepositoriesService.Unsubscribe + - UsersService.GetByID +operations: + - openapi: + method: GET + endpoint_url: / + documentation_url: https://docs.github.com/rest/meta/meta#github-api-root + summary: 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 + - openapi: + method: GET + endpoint_url: /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks + summary: List global webhooks + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook + summary: Create a global webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#delete-a-global-webhook + summary: Delete a global webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#get-a-global-webhook + summary: Get a global webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /admin/hooks/{hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#update-a-global-webhook + summary: Update a global webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /admin/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#ping-a-global-webhook + summary: Ping a global webhook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /admin/keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys + summary: List public keys + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /admin/keys/{key_ids} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key + summary: Delete a public key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update LDAP mapping for a team + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.UpdateTeamLDAPMapping + - openapi: + method: POST + endpoint_url: /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 + summary: Sync LDAP mapping for a team + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update LDAP mapping for a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.UpdateUserLDAPMapping + - openapi: + method: POST + endpoint_url: /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 + summary: Sync LDAP mapping for a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /admin/organizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization + summary: Create an organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.CreateOrg + - openapi: + method: PATCH + endpoint_url: /admin/organizations/{org} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name + summary: Update an organization name + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.RenameOrg + - AdminService.RenameOrgByName + - openapi: + method: GET + endpoint_url: /admin/pre-receive-environments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments + summary: List pre-receive environments + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /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 + summary: Create a pre-receive environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a pre-receive environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get a pre-receive environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update a pre-receive environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /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 + summary: Start a pre-receive environment download + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get the download status for a pre-receive environment + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /admin/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks + summary: List pre-receive hooks + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /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 + summary: Create a pre-receive hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a pre-receive hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get a pre-receive hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update a pre-receive hook + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /admin/tokens + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens + summary: List personal access tokens + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /admin/tokens/{token_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-personal-access-token + summary: Delete a personal access token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /admin/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user + summary: Create a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.CreateUser + - openapi: + method: DELETE + endpoint_url: /admin/users/{username} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user + summary: Delete a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.DeleteUser + - openapi: + method: PATCH + endpoint_url: /admin/users/{username} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#update-the-username-for-a-user + summary: Update the username for a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /admin/users/{username}/authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token + summary: Delete an impersonation OAuth token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.DeleteUserImpersonation + - AuthorizationsService.DeleteImpersonation + - openapi: + method: POST + endpoint_url: /admin/users/{username}/authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token + summary: Create an impersonation OAuth token + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.CreateUserImpersonation + - AuthorizationsService.CreateImpersonation + - openapi: + method: GET + endpoint_url: /advisories + documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories + summary: List global security advisories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory + summary: Get a global security advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /app + documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app + summary: 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 + go_methods: + - AppsService.Get + - openapi: + method: POST + endpoint_url: /app-manifests/{code}/conversions + documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest + summary: 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 + go_methods: + - AppsService.CompleteAppManifest + - openapi: + method: GET + endpoint_url: /app/hook/config + documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app + summary: 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 + go_methods: + - AppsService.GetHookConfig + - openapi: + method: PATCH + endpoint_url: /app/hook/config + documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app + summary: 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 + go_methods: + - AppsService.UpdateHookConfig + - openapi: + method: GET + endpoint_url: /app/hook/deliveries + documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook + summary: 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 + go_methods: + - AppsService.ListHookDeliveries + - openapi: + method: GET + endpoint_url: /app/hook/deliveries/{delivery_id} + documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook + summary: 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 + go_methods: + - AppsService.GetHookDelivery + - openapi: + method: POST + endpoint_url: /app/hook/deliveries/{delivery_id}/attempts + documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook + summary: 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 + go_methods: + - AppsService.RedeliverHookDelivery + - openapi: + method: GET + endpoint_url: /app/installation-requests + documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app + summary: 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 + - openapi: + method: GET + endpoint_url: /app/installations + documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app + summary: 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 + go_methods: + - AppsService.ListInstallations + - openapi: + method: DELETE + endpoint_url: /app/installations/{installation_id} + documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app + summary: 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 + go_methods: + - AppsService.DeleteInstallation + - openapi: + method: GET + endpoint_url: /app/installations/{installation_id} + documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app + summary: 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 + go_methods: + - AppsService.GetInstallation + - openapi: + method: POST + endpoint_url: /app/installations/{installation_id}/access_tokens + documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app + summary: 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 + go_methods: + - AppsService.CreateInstallationToken + - openapi: + method: DELETE + endpoint_url: /app/installations/{installation_id}/suspended + documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation + summary: 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 + go_methods: + - AppsService.UnsuspendInstallation + - openapi: + method: PUT + endpoint_url: /app/installations/{installation_id}/suspended + documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation + summary: 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 + go_methods: + - AppsService.SuspendInstallation + - openapi: + method: GET + endpoint_url: /applications/grants + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants + summary: List your grants + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /applications/grants/{grant_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant + summary: Delete a grant + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /applications/grants/{grant_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant + summary: Get a single grant + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /applications/{client_id}/grant + documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization + summary: 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 + go_methods: + - AuthorizationsService.DeleteGrant + - openapi: + method: DELETE + endpoint_url: /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 + summary: Revoke a grant for an application + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - openapi: + method: DELETE + endpoint_url: /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token + summary: Delete an app token + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AuthorizationsService.Revoke + - openapi: + method: PATCH + endpoint_url: /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token + summary: 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 + go_methods: + - AuthorizationsService.Reset + - openapi: + method: POST + endpoint_url: /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token + summary: 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 + go_methods: + - AuthorizationsService.Check + - openapi: + method: POST + endpoint_url: /applications/{client_id}/token/scoped + documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token + summary: 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 + - openapi: + method: DELETE + endpoint_url: /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 + summary: Revoke an authorization for an application + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - openapi: + method: GET + endpoint_url: /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#check-an-authorization + summary: Check an authorization + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - openapi: + method: POST + endpoint_url: /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#reset-an-authorization + summary: Reset an authorization + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + - openapi: + method: GET + endpoint_url: /apps/{app_slug} + documentation_url: https://docs.github.com/rest/apps/apps#get-an-app + summary: Get an app + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AppsService.Get + - openapi: + method: GET + endpoint_url: /authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations + summary: List your authorizations + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization + summary: Create a new authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Get-or-create an authorization for a specific app + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Get-or-create an authorization for a specific app and fingerprint + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization + summary: Delete an authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization + summary: Get a single authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization + summary: Update an existing authorization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /codes_of_conduct + documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct + summary: Get all codes of conduct + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - Client.ListCodesOfConduct + - openapi: + method: GET + endpoint_url: /codes_of_conduct/{key} + documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct + summary: 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 + go_methods: + - Client.GetCodeOfConduct + - openapi: + method: GET + endpoint_url: /emojis + documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis + summary: Get emojis + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - Client.ListEmojis + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Enterprise Server statistics + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + summary: Remove the global announcement banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner + summary: Get the global announcement banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner + summary: Set the global announcement banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/settings/license + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information + summary: Get license information + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/all + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics + summary: Get all statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - AdminService.GetAdminStats + - openapi: + method: GET + endpoint_url: /enterprise/stats/comments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics + summary: Get comment statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/gists + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics + summary: Get gist statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics + summary: Get hooks statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/issues + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics + summary: Get issue statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/milestones + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics + summary: Get milestone statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/orgs + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics + summary: Get organization statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/pages + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics + summary: Get pages statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/pulls + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics + summary: Get pull request statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/repos + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics + summary: Get repository statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/security-products + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-security-products-statistics + summary: Get security products statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprise/stats/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics + summary: Get users statistics + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Actions cache usage for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.GetTotalCacheUsageForEnterprise + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Actions cache usage policy for an enterprise + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Set GitHub Actions cache usage policy for an enterprise + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Set the GitHub Actions OIDC custom issuer policy for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/actions/permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise + summary: Get GitHub Actions permissions for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /enterprises/{enterprise}/actions/permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise + summary: Set GitHub Actions permissions for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: List selected organizations enabled for GitHub Actions in an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Set selected organizations enabled for GitHub Actions in an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Disable a selected organization for GitHub Actions in an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Enable a selected organization for GitHub Actions in an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get allowed actions and reusable workflows for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Set allowed actions and reusable workflows for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/actions/permissions/workflow + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise + summary: Get default workflow permissions for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /enterprises/{enterprise}/actions/permissions/workflow + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise + summary: Set default workflow permissions for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: List self-hosted runner groups for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.ListRunnerGroups + - openapi: + method: POST + endpoint_url: /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 + summary: Create a self-hosted runner group for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.CreateEnterpriseRunnerGroup + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a self-hosted runner group from an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.DeleteEnterpriseRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: Get a self-hosted runner group for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.GetEnterpriseRunnerGroup + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update a self-hosted runner group for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.UpdateEnterpriseRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.ListOrganizationAccessRunnerGroup + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.SetOrganizationAccessRunnerGroup + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.RemoveOrganizationAccessRunnerGroup + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.AddOrganizationAccessRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: List self-hosted runners in a group for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.ListRunnerGroupRunners + - openapi: + method: PUT + endpoint_url: /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 + summary: Set self-hosted runners in a group for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.SetRunnerGroupRunners + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.RemoveRunnerGroupRunners + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.AddRunnerGroupRunners + - openapi: + method: GET + endpoint_url: /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 + summary: List self-hosted runners for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.ListRunners + - openapi: + method: GET + endpoint_url: /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 + summary: List runner applications for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.ListRunnerApplicationDownloads + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - EnterpriseService.GenerateEnterpriseJITConfig + - openapi: + method: POST + endpoint_url: /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 + summary: Create a registration token for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.CreateRegistrationToken + - openapi: + method: POST + endpoint_url: /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 + summary: Create a remove token for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a self-hosted runner from an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.RemoveRunner + - openapi: + method: GET + endpoint_url: /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 + summary: Get a self-hosted runner for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: List labels for a self-hosted runner for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: DELETE + endpoint_url: /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise + summary: Remove announcement banner from enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#get-announcement-banner-for-enterprise + summary: Get announcement banner for enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: PATCH + endpoint_url: /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#set-announcement-banner-for-enterprise + summary: Set announcement banner for enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/audit-log + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise + summary: Get the audit log for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.GetAuditLog + - openapi: + method: GET + endpoint_url: /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 + summary: List code scanning alerts for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get code security and analysis features for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.GetCodeSecurityAndAnalysis + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update code security and analysis features for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.UpdateCodeSecurityAndAnalysis + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/consumed-licenses + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses + summary: List enterprise consumed licenses + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise + summary: List Dependabot alerts for an enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/license-sync-status + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status + summary: Get a license sync status + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise + summary: List secret scanning alerts for an enterprise + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SecretScanningService.ListAlertsForEnterprise + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Actions billing for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/settings/billing/advanced-security + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise + summary: Get GitHub Advanced Security active committers for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Packages billing for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /enterprises/{enterprise}/settings/billing/shared-storage + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-shared-storage-billing-for-an-enterprise + summary: Get shared storage billing for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /enterprises/{enterprise}/{security_product}/{enablement} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature + summary: Enable or disable a security feature + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - EnterpriseService.EnableDisableSecurityFeature + - openapi: + method: GET + endpoint_url: /events + documentation_url: https://docs.github.com/rest/activity/events#list-public-events + summary: 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 + go_methods: + - ActivityService.ListEvents + - openapi: + method: GET + endpoint_url: /feeds + documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds + summary: Get feeds + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActivityService.ListFeeds + - openapi: + method: GET + endpoint_url: /gists + documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user + summary: 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 + go_methods: + - GistsService.List + - openapi: + method: POST + endpoint_url: /gists + documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist + summary: 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 + go_methods: + - GistsService.Create + - openapi: + method: GET + endpoint_url: /gists/public + documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists + summary: 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 + go_methods: + - GistsService.ListAll + - openapi: + method: GET + endpoint_url: /gists/starred + documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists + summary: 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 + go_methods: + - GistsService.ListStarred + - openapi: + method: DELETE + endpoint_url: /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist + summary: 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 + go_methods: + - GistsService.Delete + - openapi: + method: GET + endpoint_url: /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist + summary: 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 + go_methods: + - GistsService.Get + - openapi: + method: PATCH + endpoint_url: /gists/{gist_id} + documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist + summary: 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 + go_methods: + - GistsService.Edit + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/comments + documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments + summary: 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 + go_methods: + - GistsService.ListComments + - openapi: + method: POST + endpoint_url: /gists/{gist_id}/comments + documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment + summary: 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 + go_methods: + - GistsService.CreateComment + - openapi: + method: DELETE + endpoint_url: /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment + summary: 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 + go_methods: + - GistsService.DeleteComment + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment + summary: 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 + go_methods: + - GistsService.GetComment + - openapi: + method: PATCH + endpoint_url: /gists/{gist_id}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment + summary: 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 + go_methods: + - GistsService.EditComment + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/commits + documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits + summary: 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 + go_methods: + - GistsService.ListCommits + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/forks + documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks + summary: 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 + go_methods: + - GistsService.ListForks + - openapi: + method: POST + endpoint_url: /gists/{gist_id}/forks + documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist + summary: 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 + go_methods: + - GistsService.Fork + - openapi: + method: DELETE + endpoint_url: /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist + summary: 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 + go_methods: + - GistsService.Unstar + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred + summary: 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 + go_methods: + - GistsService.IsStarred + - openapi: + method: PUT + endpoint_url: /gists/{gist_id}/star + documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist + summary: 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 + go_methods: + - GistsService.Star + - openapi: + method: GET + endpoint_url: /gists/{gist_id}/{sha} + documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision + summary: 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 + go_methods: + - GistsService.GetRevision + - openapi: + method: GET + endpoint_url: /gitignore/templates + documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates + summary: 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 + go_methods: + - GitignoresService.List + - openapi: + method: GET + endpoint_url: /gitignore/templates/{name} + documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template + summary: 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 + go_methods: + - GitignoresService.Get + - openapi: + method: GET + endpoint_url: /installation/repositories + documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation + summary: 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 + go_methods: + - AppsService.ListRepos + - openapi: + method: DELETE + endpoint_url: /installation/token + documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token + summary: 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 + go_methods: + - AppsService.RevokeInstallationToken + - openapi: + method: GET + endpoint_url: /issues + documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user + summary: 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 + go_methods: + - IssuesService.List + - openapi: + method: GET + endpoint_url: /licenses + documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses + summary: 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 + go_methods: + - LicensesService.List + - openapi: + method: GET + endpoint_url: /licenses/{license} + documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license + summary: 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 + go_methods: + - LicensesService.Get + - openapi: + method: GET + endpoint_url: /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 + summary: Get GHES node metadata for all nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /manage/v1/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode + summary: Get the status of maintenance mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /manage/v1/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode + summary: Set the status of maintenance mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get the status of services running on all replica nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get all GHES release versions for all nodes + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /markdown + documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document + summary: 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 + go_methods: + - Client.Markdown + - openapi: + method: POST + endpoint_url: /markdown/raw + documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode + summary: 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 + - openapi: + method: GET + endpoint_url: /marketplace_listing/accounts/{account_id} + documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account + summary: Get a subscription plan for an account + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.GetPlanAccountForAccount + - openapi: + method: GET + endpoint_url: /marketplace_listing/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans + summary: List plans + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListPlans + - openapi: + method: GET + endpoint_url: /marketplace_listing/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan + summary: List accounts for a plan + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListPlanAccountsForPlan + - openapi: + method: GET + endpoint_url: /marketplace_listing/stubbed/accounts/{account_id} + documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed + summary: Get a subscription plan for an account (stubbed) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.GetPlanAccountForAccount + - openapi: + method: GET + endpoint_url: /marketplace_listing/stubbed/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed + summary: List plans (stubbed) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListPlans + - openapi: + method: GET + endpoint_url: /marketplace_listing/stubbed/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed + summary: List accounts for a plan (stubbed) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListPlanAccountsForPlan + - openapi: + method: GET + endpoint_url: /meta + documentation_url: https://docs.github.com/rest/meta/meta#get-apiname-meta-information + summary: Get GitHub meta information + override: + documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - Client.APIMeta + - openapi: + method: GET + endpoint_url: /networks/{owner}/{repo}/events + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories + summary: 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 + go_methods: + - ActivityService.ListEventsForRepoNetwork + - openapi: + method: GET + endpoint_url: /notifications + documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListNotifications + - openapi: + method: PUT + endpoint_url: /notifications + documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read + summary: 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 + go_methods: + - ActivityService.MarkNotificationsRead + - openapi: + method: GET + endpoint_url: /notifications/threads/{thread_id} + documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread + summary: 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 + go_methods: + - ActivityService.GetThread + - openapi: + method: PATCH + endpoint_url: /notifications/threads/{thread_id} + documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read + summary: 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 + go_methods: + - ActivityService.MarkThreadRead + - openapi: + method: DELETE + endpoint_url: /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription + summary: 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 + go_methods: + - ActivityService.DeleteThreadSubscription + - openapi: + method: GET + endpoint_url: /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.GetThreadSubscription + - openapi: + method: PUT + endpoint_url: /notifications/threads/{thread_id}/subscription + documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription + summary: 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 + go_methods: + - ActivityService.SetThreadSubscription + - openapi: + method: GET + endpoint_url: /octocat + documentation_url: https://docs.github.com/rest/meta/meta#get-octocat + summary: Get Octocat + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - Client.Octocat + - openapi: + method: GET + endpoint_url: /organizations + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations + summary: List organizations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.ListAll + - openapi: + method: GET + endpoint_url: /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 + summary: Deprecated - List custom repository roles in an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization + summary: 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 + go_methods: + - OrganizationsService.Delete + - openapi: + method: GET + endpoint_url: /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization + summary: 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 + go_methods: + - OrganizationsService.Get + - openapi: + method: PATCH + endpoint_url: /orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization + summary: 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 + go_methods: + - OrganizationsService.Edit + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/cache/usage + documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization + summary: 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 + go_methods: + - ActionsService.GetTotalCacheUsageForOrg + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.ListCacheUsageByRepoForOrg + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetOrgOIDCSubjectClaimCustomTemplate + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.SetOrgOIDCSubjectClaimCustomTemplate + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.GetActionsPermissions + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.EditActionsPermissions + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/permissions/repositories + documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization + summary: 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 + go_methods: + - ActionsService.ListEnabledReposInOrg + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/permissions/repositories + documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization + summary: 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 + go_methods: + - ActionsService.SetEnabledReposInOrg + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveEnabledRepoInOrg + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.AddEnabledReposInOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.GetActionsAllowed + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/permissions/selected-actions + documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.EditActionsAllowed + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization + summary: 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 + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: List self-hosted runner groups for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.ListOrganizationRunnerGroups + - openapi: + method: POST + endpoint_url: /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 + summary: Create a self-hosted runner group for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.CreateOrganizationRunnerGroup + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a self-hosted runner group from an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.DeleteOrganizationRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: Get a self-hosted runner group for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.GetOrganizationRunnerGroup + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update a self-hosted runner group for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.UpdateOrganizationRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.ListRepositoryAccessRunnerGroup + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.SetRepositoryAccessRunnerGroup + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveRepositoryAccessRunnerGroup + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.AddRepositoryAccessRunnerGroup + - openapi: + method: GET + endpoint_url: /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 + summary: List self-hosted runners in a group for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.ListRunnerGroupRunners + - openapi: + method: PUT + endpoint_url: /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 + summary: Set self-hosted runners in a group for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.SetRunnerGroupRunners + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveRunnerGroupRunners + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.AddRunnerGroupRunners + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/runners + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization + summary: 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 + go_methods: + - ActionsService.ListOrganizationRunners + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/runners/downloads + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization + summary: 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 + go_methods: + - ActionsService.ListOrganizationRunnerApplicationDownloads + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GenerateOrgJITConfig + - openapi: + method: POST + endpoint_url: /orgs/{org}/actions/runners/registration-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization + summary: 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 + go_methods: + - ActionsService.CreateOrganizationRegistrationToken + - openapi: + method: POST + endpoint_url: /orgs/{org}/actions/runners/remove-token + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization + summary: 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 + go_methods: + - ActionsService.CreateOrganizationRemoveToken + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveOrganizationRunner + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetOrganizationRunner + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets + summary: 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 + go_methods: + - ActionsService.ListOrgSecrets + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key + summary: 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 + go_methods: + - ActionsService.GetOrgPublicKey + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret + summary: 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 + go_methods: + - ActionsService.DeleteOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret + summary: 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 + go_methods: + - ActionsService.GetOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret + summary: 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 + go_methods: + - ActionsService.CreateOrUpdateOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret + summary: 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 + go_methods: + - ActionsService.ListSelectedReposForOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret + summary: 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 + go_methods: + - ActionsService.SetSelectedReposForOrgSecret + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveSelectedRepoFromOrgSecret + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.AddSelectedRepoToOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables + summary: 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 + go_methods: + - ActionsService.ListOrgVariables + - openapi: + method: POST + endpoint_url: /orgs/{org}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable + summary: 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 + go_methods: + - ActionsService.CreateOrgVariable + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable + summary: 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 + go_methods: + - ActionsService.DeleteOrgVariable + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable + summary: 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 + go_methods: + - ActionsService.GetOrgVariable + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable + summary: 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 + go_methods: + - ActionsService.UpdateOrgVariable + - openapi: + method: GET + endpoint_url: /orgs/{org}/actions/variables/{name}/repositories + documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable + summary: 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 + go_methods: + - ActionsService.ListSelectedReposForOrgVariable + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/variables/{name}/repositories + documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable + summary: 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 + go_methods: + - ActionsService.SetSelectedReposForOrgVariable + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable + summary: 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 + go_methods: + - ActionsService.RemoveSelectedRepoFromOrgVariable + - openapi: + method: PUT + endpoint_url: /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable + summary: 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 + go_methods: + - ActionsService.AddSelectedRepoToOrgVariable + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization + summary: Remove announcement banner from organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization + summary: Get announcement banner for organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization + summary: Set announcement banner for organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/audit-log + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization + summary: Get the audit log for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.GetAuditLog + - openapi: + method: GET + endpoint_url: /orgs/{org}/blocks + documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization + summary: List users blocked by an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.ListBlockedUsers + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization + summary: Unblock a user from an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.UnblockUser + - openapi: + method: GET + endpoint_url: /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization + summary: Check if a user is blocked by an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.IsBlocked + - openapi: + method: PUT + endpoint_url: /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization + summary: Block a user from an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.BlockUser + - openapi: + method: GET + endpoint_url: /orgs/{org}/code-scanning/alerts + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization + summary: List code 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 + go_methods: + - CodeScanningService.ListAlertsForOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization + summary: List codespaces for the organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: PUT + endpoint_url: /orgs/{org}/codespaces/access + documentation_url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces + summary: Manage access control for organization codespaces + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization + summary: Remove users from Codespaces access for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization + summary: Add users to Codespaces access for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets + summary: List organization secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListOrgSecrets + - openapi: + method: GET + endpoint_url: /orgs/{org}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key + summary: Get an organization public key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetOrgPublicKey + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret + summary: Delete an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.DeleteOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret + summary: Get an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret + summary: Create or update an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.CreateOrUpdateOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret + summary: List selected repositories for an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListSelectedReposForOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret + summary: Set selected repositories for an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.SetSelectedReposForOrgSecret + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret + summary: Remove selected repository from an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.RemoveSelectedRepoFromOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret + summary: Add selected repository to an organization secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.AddSelectedRepoToOrgSecret + - openapi: + method: GET + endpoint_url: /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 + summary: Get Copilot for Business seat information and settings for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /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 + summary: List all Copilot for Business seat assignments for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove teams from the Copilot for Business subscription for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /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 + summary: Add teams to the Copilot for Business subscription for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove users from the Copilot for Business subscription for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /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 + summary: Add users to the Copilot for Business subscription for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/credential-authorizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization + summary: List SAML SSO authorizations for an organization + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.ListCredentialAuthorizations + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/credential-authorizations/{credential_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization + summary: Remove a SAML SSO authorization for an organization + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.RemoveCredentialAuthorization + - openapi: + method: GET + endpoint_url: /orgs/{org}/custom-repository-roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization + summary: List custom repository roles in an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.ListCustomRepoRoles + - openapi: + method: POST + endpoint_url: /orgs/{org}/custom-repository-roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role + summary: Create a custom repository role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.CreateCustomRepoRole + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a custom repository role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.DeleteCustomRepoRole + - openapi: + method: GET + endpoint_url: /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 + summary: Get a custom repository role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update a custom repository role + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.UpdateCustomRepoRole + - openapi: + method: POST + endpoint_url: /orgs/{org}/custom_roles + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role + summary: Deprecated - Create a custom role + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---delete-a-custom-role + summary: Deprecated - Delete a custom role + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---get-a-custom-role + summary: Deprecated - Get a custom role + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---update-a-custom-role + summary: Deprecated - Update a custom role + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization + summary: List Dependabot 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 + go_methods: + - DependabotService.ListOrgAlerts + - openapi: + method: GET + endpoint_url: /orgs/{org}/dependabot/secrets + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets + summary: 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 + go_methods: + - DependabotService.ListOrgSecrets + - openapi: + method: GET + endpoint_url: /orgs/{org}/dependabot/secrets/public-key + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key + summary: 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 + go_methods: + - DependabotService.GetOrgPublicKey + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret + summary: 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 + go_methods: + - DependabotService.DeleteOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret + summary: 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 + go_methods: + - DependabotService.GetOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret + summary: 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 + go_methods: + - DependabotService.CreateOrUpdateOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret + summary: 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 + go_methods: + - DependabotService.ListSelectedReposForOrgSecret + - openapi: + method: PUT + endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret + summary: 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 + go_methods: + - DependabotService.SetSelectedReposForOrgSecret + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - DependabotService.RemoveSelectedRepoFromOrgSecret + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - DependabotService.AddSelectedRepoToOrgSecret + - openapi: + method: GET + endpoint_url: /orgs/{org}/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization + summary: 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 + - openapi: + method: GET + endpoint_url: /orgs/{org}/events + documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events + summary: 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 + go_methods: + - ActivityService.ListEventsForOrganization + - openapi: + method: GET + endpoint_url: /orgs/{org}/external-group/{group_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group + summary: Get an external group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.GetExternalGroup + - openapi: + method: GET + endpoint_url: /orgs/{org}/external-groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization + summary: List external groups in an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.ListExternalGroups + - openapi: + method: GET + endpoint_url: /orgs/{org}/failed_invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations + summary: List failed organization invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.ListFailedOrgInvitations + - openapi: + method: GET + endpoint_url: /orgs/{org}/fine_grained_permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-fine-grained-permissions-for-an-organization + summary: Deprecated - List fine-grained permissions for an organization + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/hooks + documentation_url: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks + summary: List organization webhooks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.ListHooks + - openapi: + method: POST + endpoint_url: /orgs/{org}/hooks + documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.CreateHook + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.DeleteHook + - openapi: + method: GET + endpoint_url: /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.GetHook + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.EditHook + - openapi: + method: GET + endpoint_url: /orgs/{org}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.GetHookConfiguration + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.EditHookConfiguration + - openapi: + method: GET + endpoint_url: /orgs/{org}/hooks/{hook_id}/deliveries + documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.ListHookDeliveries + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.GetHookDelivery + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.RedeliverHookDelivery + - openapi: + method: POST + endpoint_url: /orgs/{org}/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook + summary: 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 + go_methods: + - OrganizationsService.PingHook + - openapi: + method: GET + endpoint_url: /orgs/{org}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app + summary: 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 + go_methods: + - AppsService.FindOrganizationInstallation + - openapi: + method: GET + endpoint_url: /orgs/{org}/installations + documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.ListInstallations + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization + summary: Remove interaction restrictions for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.RemoveRestrictionsFromOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization + summary: Get interaction restrictions for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.GetRestrictionsForOrg + - openapi: + method: PUT + endpoint_url: /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization + summary: Set interaction restrictions for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.UpdateRestrictionsForOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations + summary: List pending organization invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.ListPendingOrgInvitations + - openapi: + method: POST + endpoint_url: /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation + summary: Create an organization invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.CreateOrgInvitation + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation + summary: Cancel an organization invitation + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/invitations/{invitation_id}/teams + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams + summary: List organization invitation teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.ListOrgInvitationTeams + - openapi: + method: GET + endpoint_url: /orgs/{org}/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user + summary: List organization 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 + go_methods: + - IssuesService.ListByOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/members + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members + summary: 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 + go_methods: + - OrganizationsService.ListMembers + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member + summary: 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 + go_methods: + - OrganizationsService.RemoveMember + - openapi: + method: GET + endpoint_url: /orgs/{org}/members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user + summary: 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 + go_methods: + - OrganizationsService.IsMember + - openapi: + method: GET + endpoint_url: /orgs/{org}/members/{username}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization + summary: List codespaces for a user in organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/members/{username}/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization + summary: Delete a codespace from the organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user + summary: Stop a codespace for an organization user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get Copilot for Business seat assignment details for a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user + summary: Remove 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 + go_methods: + - OrganizationsService.RemoveOrgMembership + - openapi: + method: GET + endpoint_url: /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user + summary: 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 + go_methods: + - OrganizationsService.GetOrgMembership + - openapi: + method: PUT + endpoint_url: /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user + summary: 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 + go_methods: + - OrganizationsService.EditOrgMembership + - openapi: + method: GET + endpoint_url: /orgs/{org}/migrations + documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations + summary: 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 + go_methods: + - MigrationService.ListMigrations + - openapi: + method: POST + endpoint_url: /orgs/{org}/migrations + documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration + summary: 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 + go_methods: + - MigrationService.StartMigration + - openapi: + method: GET + endpoint_url: /orgs/{org}/migrations/{migration_id} + documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status + summary: 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 + go_methods: + - MigrationService.MigrationStatus + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive + summary: 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 + go_methods: + - MigrationService.DeleteMigration + - openapi: + method: GET + endpoint_url: /orgs/{org}/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive + summary: 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 + go_methods: + - MigrationService.MigrationArchiveURL + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock + documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository + summary: 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 + go_methods: + - MigrationService.UnlockRepo + - openapi: + method: GET + endpoint_url: /orgs/{org}/migrations/{migration_id}/repositories + documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration + summary: 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 + - openapi: + method: GET + endpoint_url: /orgs/{org}/outside_collaborators + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.ListOutsideCollaborators + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/outside_collaborators/{username} + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization + summary: 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 + go_methods: + - OrganizationsService.RemoveOutsideCollaborator + - openapi: + method: PUT + endpoint_url: /orgs/{org}/outside_collaborators/{username} + documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator + summary: 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 + go_methods: + - OrganizationsService.ConvertMemberToOutsideCollaborator + - openapi: + method: GET + endpoint_url: /orgs/{org}/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.ListPackages + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.DeletePackage + - openapi: + method: GET + endpoint_url: /orgs/{org}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.GetPackage + - openapi: + method: POST + endpoint_url: /orgs/{org}/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization + summary: 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 + go_methods: + - OrganizationsService.RestorePackage + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.PackageGetAllVersions + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.PackageDeleteVersion + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.PackageGetVersion + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.PackageRestoreVersion + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - OrganizationsService.ReviewPersonalAccessTokenRequest + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: List pre-receive hooks for an organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove pre-receive hook enforcement for an organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get a pre-receive hook for an organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update pre-receive hook enforcement for an organization + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects + summary: 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 + go_methods: + - OrganizationsService.ListProjects + - openapi: + method: POST + endpoint_url: /orgs/{org}/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project + summary: 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 + go_methods: + - OrganizationsService.CreateProject + - openapi: + method: GET + endpoint_url: /orgs/{org}/public_members + documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members + summary: List public organization members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.ListMembers + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user + summary: 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 + go_methods: + - OrganizationsService.ConcealMembership + - openapi: + method: GET + endpoint_url: /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user + summary: 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 + go_methods: + - OrganizationsService.IsPublicMember + - openapi: + method: PUT + endpoint_url: /orgs/{org}/public_members/{username} + documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user + summary: 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 + go_methods: + - OrganizationsService.PublicizeMembership + - openapi: + method: GET + endpoint_url: /orgs/{org}/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories + summary: 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 + go_methods: + - RepositoriesService.ListByOrg + - openapi: + method: POST + endpoint_url: /orgs/{org}/repos + documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository + summary: 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 + go_methods: + - RepositoriesService.Create + - openapi: + method: GET + endpoint_url: /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 + summary: List repository fine-grained permissions for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/rulesets + documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets + summary: Get all organization repository rulesets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.GetAllOrganizationRulesets + - openapi: + method: POST + endpoint_url: /orgs/{org}/rulesets + documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset + summary: Create an organization repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.CreateOrganizationRuleset + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset + summary: Delete an organization repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.DeleteOrganizationRuleset + - openapi: + method: GET + endpoint_url: /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset + summary: Get an organization repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.GetOrganizationRuleset + - openapi: + method: PUT + endpoint_url: /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset + summary: Update an organization repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - OrganizationsService.UpdateOrganizationRuleset + - openapi: + method: GET + endpoint_url: /orgs/{org}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization + summary: 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 + go_methods: + - SecretScanningService.ListAlertsForOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization + summary: List repository security advisories for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /orgs/{org}/security-managers + documentation_url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams + summary: List security manager teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - OrganizationsService.ListSecurityManagerTeams + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/security-managers/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team + summary: 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 + go_methods: + - OrganizationsService.RemoveSecurityManagerTeam + - openapi: + method: PUT + endpoint_url: /orgs/{org}/security-managers/teams/{team_slug} + documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team + summary: 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 + go_methods: + - OrganizationsService.AddSecurityManagerTeam + - openapi: + method: GET + endpoint_url: /orgs/{org}/settings/billing/actions + documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization + summary: Get GitHub Actions billing for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetActionsBillingOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/settings/billing/advanced-security + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization + summary: Get GitHub Advanced Security active committers for an organization + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - BillingService.GetAdvancedSecurityActiveCommittersOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/settings/billing/packages + documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization + summary: Get GitHub Packages billing for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetPackagesBillingOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization + summary: Get shared storage billing for an organization + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetStorageBillingOrg + - openapi: + method: GET + endpoint_url: /orgs/{org}/team-sync/groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization + summary: List IdP groups for an organization + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - TeamsService.ListIDPGroupsInOrganization + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-teams + summary: List teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.ListTeams + - openapi: + method: POST + endpoint_url: /orgs/{org}/teams + documentation_url: https://docs.github.com/rest/teams/teams#create-a-team + summary: 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 + go_methods: + - TeamsService.CreateTeam + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team + summary: 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 + go_methods: + - TeamsService.DeleteTeamByID + - TeamsService.DeleteTeamBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name + summary: 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 + go_methods: + - TeamsService.GetTeamByID + - TeamsService.GetTeamBySlug + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/teams/{team_slug} + documentation_url: https://docs.github.com/rest/teams/teams#update-a-team + summary: 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 + go_methods: + - TeamsService.EditTeamByID + - TeamsService.EditTeamBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions + summary: List discussions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.ListDiscussionsByID + - TeamsService.ListDiscussionsBySlug + - openapi: + method: POST + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion + summary: 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 + go_methods: + - TeamsService.CreateDiscussionByID + - TeamsService.CreateDiscussionBySlug + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion + summary: 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 + go_methods: + - TeamsService.DeleteDiscussionByID + - TeamsService.DeleteDiscussionBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion + summary: 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 + go_methods: + - TeamsService.GetDiscussionByID + - TeamsService.GetDiscussionBySlug + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion + summary: 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 + go_methods: + - TeamsService.EditDiscussionByID + - TeamsService.EditDiscussionBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments + summary: 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 + go_methods: + - TeamsService.ListCommentsByID + - TeamsService.ListCommentsBySlug + - openapi: + method: POST + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment + summary: 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 + go_methods: + - TeamsService.CreateCommentByID + - TeamsService.CreateCommentBySlug + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - TeamsService.DeleteCommentByID + - TeamsService.DeleteCommentBySlug + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - TeamsService.GetCommentByID + - TeamsService.GetCommentBySlug + - openapi: + method: PATCH + endpoint_url: /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 + summary: 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 + go_methods: + - TeamsService.EditCommentByID + - TeamsService.EditCommentBySlug + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.DeleteTeamDiscussionCommentReaction + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion + summary: 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 + - openapi: + method: POST + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion + summary: 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 + go_methods: + - ReactionsService.DeleteTeamDiscussionReactionByOrgIDAndTeamID + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction + summary: 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 + go_methods: + - ReactionsService.DeleteTeamDiscussionReaction + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove the connection between an external group and a team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.RemoveConnectedExternalGroup + - openapi: + method: GET + endpoint_url: /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 + summary: List a connection between an external group and a team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.ListExternalGroupsForTeamBySlug + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update the connection between an external group and a team + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.UpdateConnectedExternalGroup + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations + summary: List pending team invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - TeamsService.ListPendingTeamInvitationsByID + - TeamsService.ListPendingTeamInvitationsBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members + summary: List team members + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.GetTeamMembershipByID + - TeamsService.ListTeamMembersByID + - TeamsService.ListTeamMembersBySlug + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user + summary: 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 + go_methods: + - TeamsService.RemoveTeamMembershipByID + - TeamsService.RemoveTeamMembershipBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user + summary: 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 + go_methods: + - TeamsService.GetTeamMembershipBySlug + - openapi: + method: PUT + endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user + summary: 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 + go_methods: + - TeamsService.AddTeamMembershipByID + - TeamsService.AddTeamMembershipBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/projects + documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects + summary: 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 + go_methods: + - TeamsService.ListTeamProjectsByID + - TeamsService.ListTeamProjectsBySlug + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team + summary: 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 + go_methods: + - TeamsService.RemoveTeamProjectByID + - TeamsService.RemoveTeamProjectBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project + summary: 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 + go_methods: + - TeamsService.ReviewTeamProjectsByID + - TeamsService.ReviewTeamProjectsBySlug + - openapi: + method: PUT + endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions + summary: 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 + go_methods: + - TeamsService.AddTeamProjectByID + - TeamsService.AddTeamProjectBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/repos + documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories + summary: 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 + go_methods: + - TeamsService.ListTeamReposByID + - TeamsService.ListTeamReposBySlug + - openapi: + method: DELETE + endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team + summary: 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 + go_methods: + - TeamsService.RemoveTeamRepoByID + - TeamsService.RemoveTeamRepoBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository + summary: 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 + go_methods: + - TeamsService.IsTeamRepoByID + - TeamsService.IsTeamRepoBySlug + - openapi: + method: PUT + endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions + summary: 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 + go_methods: + - TeamsService.AddTeamRepoByID + - TeamsService.AddTeamRepoBySlug + - openapi: + method: GET + endpoint_url: /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 + summary: List IdP groups for a team + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - TeamsService.ListIDPGroupsForTeamByID + - TeamsService.ListIDPGroupsForTeamBySlug + - openapi: + method: PATCH + endpoint_url: /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections + summary: Create or update IdP group connections + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - TeamsService.CreateOrUpdateIDPGroupConnectionsByID + - TeamsService.CreateOrUpdateIDPGroupConnectionsBySlug + - openapi: + method: GET + endpoint_url: /orgs/{org}/teams/{team_slug}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams + summary: List child teams + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - TeamsService.ListChildTeamsByParentID + - TeamsService.ListChildTeamsByParentSlug + - openapi: + method: POST + endpoint_url: /orgs/{org}/{security_product}/{enablement} + documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization + summary: 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 + - openapi: + method: DELETE + endpoint_url: /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card + summary: 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 + go_methods: + - ProjectsService.DeleteProjectCard + - openapi: + method: GET + endpoint_url: /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card + summary: 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 + go_methods: + - ProjectsService.GetProjectCard + - openapi: + method: PATCH + endpoint_url: /projects/columns/cards/{card_id} + documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card + summary: 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 + go_methods: + - ProjectsService.UpdateProjectCard + - openapi: + method: POST + endpoint_url: /projects/columns/cards/{card_id}/moves + documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card + summary: 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 + go_methods: + - ProjectsService.MoveProjectCard + - openapi: + method: DELETE + endpoint_url: /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column + summary: 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 + go_methods: + - ProjectsService.DeleteProjectColumn + - openapi: + method: GET + endpoint_url: /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column + summary: 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 + go_methods: + - ProjectsService.GetProjectColumn + - openapi: + method: PATCH + endpoint_url: /projects/columns/{column_id} + documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column + summary: 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 + go_methods: + - ProjectsService.UpdateProjectColumn + - openapi: + method: GET + endpoint_url: /projects/columns/{column_id}/cards + documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards + summary: 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 + go_methods: + - ProjectsService.ListProjectCards + - openapi: + method: POST + endpoint_url: /projects/columns/{column_id}/cards + documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card + summary: 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 + go_methods: + - ProjectsService.CreateProjectCard + - openapi: + method: POST + endpoint_url: /projects/columns/{column_id}/moves + documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column + summary: 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 + go_methods: + - ProjectsService.MoveProjectColumn + - openapi: + method: DELETE + endpoint_url: /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project + summary: 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 + go_methods: + - ProjectsService.DeleteProject + - openapi: + method: GET + endpoint_url: /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#get-a-project + summary: 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 + go_methods: + - ProjectsService.GetProject + - openapi: + method: PATCH + endpoint_url: /projects/{project_id} + documentation_url: https://docs.github.com/rest/projects/projects#update-a-project + summary: 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 + go_methods: + - ProjectsService.UpdateProject + - openapi: + method: GET + endpoint_url: /projects/{project_id}/collaborators + documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators + summary: 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 + go_methods: + - ProjectsService.ListProjectCollaborators + - openapi: + method: DELETE + endpoint_url: /projects/{project_id}/collaborators/{username} + documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator + summary: 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 + go_methods: + - ProjectsService.RemoveProjectCollaborator + - openapi: + method: PUT + endpoint_url: /projects/{project_id}/collaborators/{username} + documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator + summary: 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 + go_methods: + - ProjectsService.AddProjectCollaborator + - openapi: + method: GET + endpoint_url: /projects/{project_id}/collaborators/{username}/permission + documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user + summary: 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 + go_methods: + - ProjectsService.ReviewProjectCollaboratorPermission + - openapi: + method: GET + endpoint_url: /projects/{project_id}/columns + documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns + summary: 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 + go_methods: + - ProjectsService.ListProjectColumns + - openapi: + method: POST + endpoint_url: /projects/{project_id}/columns + documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column + summary: 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 + go_methods: + - ProjectsService.CreateProjectColumn + - openapi: + method: GET + endpoint_url: /rate_limit + documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + summary: 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 + - openapi: + method: DELETE + endpoint_url: /reactions/{reaction_id} + documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy + summary: Delete a reaction (Legacy) + openapi_files: + - descriptions/ghes-3.4/ghes-3.4.json + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#delete-a-repository + summary: Delete a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.Delete + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository + summary: 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 + go_methods: + - RepositoriesService.Get + - RepositoriesService.GetCodeOfConduct + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository + summary: 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 + go_methods: + - RepositoriesService.Edit + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/artifacts + documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository + summary: 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 + go_methods: + - ActionsService.ListArtifacts + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact + summary: 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 + go_methods: + - ActionsService.DeleteArtifact + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact + summary: 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 + go_methods: + - ActionsService.GetArtifact + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact + summary: 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 + go_methods: + - ActionsService.DownloadArtifact + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/cache/usage + documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository + summary: 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 + go_methods: + - ActionsService.GetCacheUsageForRepo + - openapi: + method: GET + endpoint_url: /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 + summary: Get GitHub Actions cache usage policy for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Set GitHub Actions cache usage policy for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.DeleteCachesByKey + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/caches + documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository + summary: 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 + go_methods: + - ActionsService.ListCaches + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.DeleteCachesByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/jobs/{job_id} + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run + summary: 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 + go_methods: + - ActionsService.GetWorkflowJobByID + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetWorkflowJobLogs + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RerunJobByID + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetRepoOIDCSubjectClaimCustomTemplate + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.SetRepoOIDCSubjectClaimCustomTemplate + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/organization-secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/organization-variables + documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.GetActionsPermissions + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/actions/permissions + documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.EditActionsPermissions + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.GetActionsAccessLevel + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.EditActionsAccessLevel + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.GetActionsAllowed + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.EditActionsAllowed + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository + summary: 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 + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/actions/permissions/workflow + documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runners + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository + summary: 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 + go_methods: + - ActionsService.ListRunners + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runners/downloads + documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository + summary: 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 + go_methods: + - ActionsService.ListRunnerApplicationDownloads + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GenerateRepoJITConfig + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.CreateRegistrationToken + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.CreateRemoveToken + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RemoveRunner + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetRunner + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository + summary: 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 + go_methods: + - ActionsService.ListRepositoryWorkflowRuns + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id} + documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run + summary: 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 + go_methods: + - ActionsService.DeleteWorkflowRun + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id} + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run + summary: 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 + go_methods: + - ActionsService.GetWorkflowRunByID + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: Approve a workflow run for a fork pull request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + documentation_url: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts + summary: List workflow run artifacts + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActionsService.ListWorkflowRunArtifacts + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetWorkflowRunAttempt + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.GetWorkflowRunAttemptLogs + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/cancel + documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run + summary: 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 + go_methods: + - ActionsService.CancelWorkflowRunByID + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/jobs + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run + summary: List jobs 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 + go_methods: + - ActionsService.ListWorkflowJobs + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs + summary: 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 + go_methods: + - ActionsService.DeleteWorkflowRunLogs + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/logs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs + summary: 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 + go_methods: + - ActionsService.GetWorkflowRunLogs + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.PendingDeployments + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/rerun + documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow + summary: 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 + go_methods: + - ActionsService.RerunWorkflowByID + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ActionsService.RerunFailedJobsByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/timing + documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage + summary: Get workflow run usage + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - ActionsService.GetWorkflowRunUsageByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-secrets + summary: 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 + go_methods: + - ActionsService.ListRepoSecrets + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key + summary: 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 + go_methods: + - ActionsService.GetRepoPublicKey + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret + summary: 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 + go_methods: + - ActionsService.DeleteRepoSecret + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret + summary: 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 + go_methods: + - ActionsService.GetRepoSecret + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret + summary: 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 + go_methods: + - ActionsService.CreateOrUpdateRepoSecret + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables + summary: 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 + go_methods: + - ActionsService.ListRepoVariables + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/actions/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable + summary: 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 + go_methods: + - ActionsService.CreateRepoVariable + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable + summary: 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 + go_methods: + - ActionsService.DeleteRepoVariable + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable + summary: 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 + go_methods: + - ActionsService.GetRepoVariable + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable + summary: 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 + go_methods: + - ActionsService.UpdateRepoVariable + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/workflows + documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows + summary: 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 + go_methods: + - ActionsService.ListWorkflows + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id} + documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow + summary: 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 + go_methods: + - ActionsService.GetWorkflowByFileName + - ActionsService.GetWorkflowByID + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow + summary: 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 + go_methods: + - ActionsService.DisableWorkflowByFileName + - ActionsService.DisableWorkflowByID + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event + summary: 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 + go_methods: + - ActionsService.CreateWorkflowDispatchEventByFileName + - ActionsService.CreateWorkflowDispatchEventByID + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow + summary: 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 + go_methods: + - ActionsService.EnableWorkflowByFileName + - ActionsService.EnableWorkflowByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow + summary: 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 + go_methods: + - ActionsService.ListWorkflowRunsByFileName + - ActionsService.ListWorkflowRunsByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage + summary: Get workflow usage + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - ActionsService.GetWorkflowUsageByFileName + - ActionsService.GetWorkflowUsageByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/activity + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-activities + summary: List repository activities + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees + summary: List assignees + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - IssuesService.ListAssignees + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/assignees/{assignee} + documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned + summary: 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 + go_methods: + - IssuesService.IsAssignee + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/autolinks + documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository + summary: 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 + go_methods: + - RepositoriesService.ListAutolinks + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/autolinks + documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.AddAutolink + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/autolinks/{autolink_id} + documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository + summary: 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 + go_methods: + - RepositoriesService.DeleteAutolink + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/autolinks/{autolink_id} + documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository + summary: 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 + go_methods: + - RepositoriesService.GetAutolink + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes + summary: Disable automated security fixes + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.DisableAutomatedSecurityFixes + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository + summary: Check if automated security fixes 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 + go_methods: + - RepositoriesService.GetAutomatedSecurityFixes + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes + summary: Enable automated security fixes + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.EnableAutomatedSecurityFixes + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches + documentation_url: https://docs.github.com/rest/branches/branches#list-branches + summary: List branches + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListBranches + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch} + documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch + summary: 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 + go_methods: + - RepositoriesService.GetBranch + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection + summary: 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 + go_methods: + - RepositoriesService.RemoveBranchProtection + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection + summary: 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 + go_methods: + - RepositoriesService.GetBranchProtection + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection + documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection + summary: 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 + go_methods: + - RepositoriesService.UpdateBranchProtection + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection + summary: 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 + go_methods: + - RepositoriesService.RemoveAdminEnforcement + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection + summary: 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 + go_methods: + - RepositoriesService.GetAdminEnforcement + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection + summary: 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 + go_methods: + - RepositoriesService.AddAdminEnforcement + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.RemovePullRequestReviewEnforcement + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.GetPullRequestReviewEnforcement + - openapi: + method: PATCH + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.DisableDismissalRestrictions + - RepositoriesService.UpdatePullRequestReviewEnforcement + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection + summary: 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 + go_methods: + - RepositoriesService.OptionalSignaturesOnProtectedBranch + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection + summary: 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 + go_methods: + - RepositoriesService.GetSignaturesProtectedBranch + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection + summary: 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 + go_methods: + - RepositoriesService.RequireSignaturesOnProtectedBranch + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection + summary: 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 + go_methods: + - RepositoriesService.RemoveRequiredStatusChecks + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection + summary: 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 + go_methods: + - RepositoriesService.GetRequiredStatusChecks + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection + summary: 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 + go_methods: + - RepositoriesService.UpdateRequiredStatusChecks + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.ListRequiredStatusChecksContexts + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts + summary: 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 + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts + summary: 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 + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions + documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions + documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions + summary: 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 + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.RemoveAppRestrictions + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.ListAppRestrictions + - RepositoriesService.ListApps + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.AddAppRestrictions + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.ReplaceAppRestrictions + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.RemoveTeamRestrictions + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.ListTeamRestrictions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.AddTeamRestrictions + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.ReplaceTeamRestrictions + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.RemoveUserRestrictions + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.ListUserRestrictions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.AddUserRestrictions + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions + summary: 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 + go_methods: + - RepositoriesService.ReplaceUserRestrictions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/branches/{branch}/rename + documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch + summary: 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 + go_methods: + - RepositoriesService.RenameBranch + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/check-runs + documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run + summary: 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 + go_methods: + - ChecksService.CreateCheckRun + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id} + documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run + summary: 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 + go_methods: + - ChecksService.GetCheckRun + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id} + documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run + summary: 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 + go_methods: + - ChecksService.UpdateCheckRun + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations + summary: 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 + go_methods: + - ChecksService.ListCheckRunAnnotations + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest + documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run + summary: 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 + go_methods: + - ChecksService.ReRequestCheckRun + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/check-suites + documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite + summary: 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 + go_methods: + - ChecksService.CreateCheckSuite + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/check-suites/preferences + documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites + summary: 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 + go_methods: + - ChecksService.SetCheckSuitePreferences + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/check-suites/{check_suite_id} + documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite + summary: 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 + go_methods: + - ChecksService.GetCheckSuite + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ChecksService.ListCheckRunsCheckSuite + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite + summary: 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 + go_methods: + - ChecksService.ReRequestCheckSuite + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository + summary: 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 + go_methods: + - CodeScanningService.ListAlertsForRepo + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert + summary: 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 + go_methods: + - CodeScanningService.GetAlert + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert + summary: 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 + go_methods: + - CodeScanningService.UpdateAlert + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - CodeScanningService.ListAlertInstances + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/analyses + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository + summary: 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 + go_methods: + - CodeScanningService.ListAnalysesForRepo + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - CodeScanningService.DeleteAnalysis + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - CodeScanningService.GetAnalysis + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/codeql/databases + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository + summary: List CodeQL databases for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodeScanningService.ListCodeQLDatabases + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository + summary: Get a CodeQL database for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodeScanningService.GetCodeQLDatabase + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/code-scanning/default-setup + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration + summary: Get 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 + go_methods: + - CodeScanningService.GetDefaultSetupConfiguration + - openapi: + method: PATCH + endpoint_url: /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 + summary: 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 + go_methods: + - CodeScanningService.UpdateDefaultSetupConfiguration + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/code-scanning/sarifs + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data + summary: 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 + go_methods: + - CodeScanningService.UploadSarif + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - CodeScanningService.GetSARIF + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codeowners/errors + documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors + summary: 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 + go_methods: + - RepositoriesService.GetCodeownersErrors + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user + summary: List codespaces in a repository for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListInRepo + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository + summary: Create a codespace in a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.CreateInRepo + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/devcontainers + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user + summary: List devcontainer configurations in a repository for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository + summary: List available machine types for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/new + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace + summary: Get default attributes for a codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets + summary: List repository secrets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListRepoSecrets + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key + summary: Get a repository public key + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetRepoPublicKey + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret + summary: Delete a repository secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.DeleteRepoSecret + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret + summary: Get a repository secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetRepoSecret + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret + summary: Create or update a repository secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.CreateOrUpdateRepoSecret + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/collaborators + documentation_url: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators + summary: List repository collaborators + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListCollaborators + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator + summary: 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 + go_methods: + - RepositoriesService.RemoveCollaborator + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator + summary: 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 + go_methods: + - RepositoriesService.IsCollaborator + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/collaborators/{username} + documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator + summary: 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 + go_methods: + - RepositoriesService.AddCollaborator + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/collaborators/{username}/permission + documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user + summary: 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 + go_methods: + - RepositoriesService.GetPermissionLevel + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/comments + documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.ListComments + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment + summary: 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 + go_methods: + - RepositoriesService.DeleteComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment + summary: 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 + go_methods: + - RepositoriesService.GetComment + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} + documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment + summary: 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 + go_methods: + - RepositoriesService.UpdateComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment + summary: 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 + go_methods: + - ReactionsService.ListCommentReactions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment + summary: 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 + go_methods: + - ReactionsService.CreateCommentReaction + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction + summary: 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 + go_methods: + - ReactionsService.DeleteCommentReaction + - ReactionsService.DeleteCommentReactionByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits + documentation_url: https://docs.github.com/rest/commits/commits#list-commits + summary: List commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListCommits + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit + summary: 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 + go_methods: + - RepositoriesService.ListBranchesHeadCommit + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/comments + documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments + summary: 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 + go_methods: + - RepositoriesService.ListCommitComments + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/comments + documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment + summary: 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 + go_methods: + - RepositoriesService.CreateComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/pulls + documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit + summary: 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 + go_methods: + - PullRequestsService.ListPullRequestsWithCommit + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{ref} + documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit + summary: 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 + go_methods: + - RepositoriesService.GetCommit + - RepositoriesService.GetCommitRaw + - RepositoriesService.GetCommitSHA1 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{ref}/check-runs + documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference + summary: 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 + go_methods: + - ChecksService.ListCheckRunsForRef + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{ref}/check-suites + documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference + summary: 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 + go_methods: + - ChecksService.ListCheckSuitesForRef + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{ref}/status + documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference + summary: 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 + go_methods: + - RepositoriesService.GetCombinedStatus + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/commits/{ref}/statuses + documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference + summary: 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 + go_methods: + - RepositoriesService.ListStatuses + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/community/profile + documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics + summary: Get community profile metrics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.GetCommunityHealthMetrics + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/compare/{basehead} + documentation_url: https://docs.github.com/rest/commits/commits#compare-two-commits + summary: Compare two commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.CompareCommits + - RepositoriesService.CompareCommitsRaw + - openapi: + method: POST + endpoint_url: /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 + summary: Create a content attachment + openapi_files: + - descriptions/ghes-3.3/ghes-3.3.json + go_methods: + - AppsService.CreateAttachment + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#delete-a-file + summary: Delete a file + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.DeleteFile + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content + summary: 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 + go_methods: + - RepositoriesService.GetContents + - RepositoriesService.DownloadContents + - RepositoriesService.DownloadContentsWithMeta + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents + summary: 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 + go_methods: + - RepositoriesService.CreateFile + - RepositoriesService.UpdateFile + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/contributors + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors + summary: 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 + go_methods: + - RepositoriesService.ListContributors + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository + summary: 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 + go_methods: + - DependabotService.ListRepoAlerts + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/dependabot/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert + summary: 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 + go_methods: + - DependabotService.GetRepoAlert + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/dependabot/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/dependabot/secrets + documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets + summary: 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 + go_methods: + - DependabotService.ListRepoSecrets + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/public-key + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key + summary: 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 + go_methods: + - DependabotService.GetRepoPublicKey + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret + summary: 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 + go_methods: + - DependabotService.DeleteRepoSecret + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret + summary: 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 + go_methods: + - DependabotService.GetRepoSecret + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret + summary: 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 + go_methods: + - DependabotService.CreateOrUpdateRepoSecret + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - DependencyGraphService.GetSBOM + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/deployments + documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments + summary: List deployments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListDeployments + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/deployments + documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment + summary: 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 + go_methods: + - RepositoriesService.CreateDeployment + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id} + documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment + summary: 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 + go_methods: + - RepositoriesService.DeleteDeployment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id} + documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment + summary: 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 + go_methods: + - RepositoriesService.GetDeployment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses + summary: 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 + go_methods: + - RepositoriesService.ListDeploymentStatuses + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status + summary: 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 + go_methods: + - RepositoriesService.CreateDeploymentStatus + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status + summary: 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 + go_methods: + - RepositoriesService.GetDeploymentStatus + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/dispatches + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event + summary: 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 + go_methods: + - RepositoriesService.Dispatch + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/environments + documentation_url: https://docs.github.com/rest/deployments/environments#list-environments + summary: List environments + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListEnvironments + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment + summary: 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 + go_methods: + - RepositoriesService.DeleteEnvironment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment + summary: 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 + go_methods: + - RepositoriesService.GetEnvironment + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} + documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment + summary: 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 + go_methods: + - RepositoriesService.CreateUpdateEnvironment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies + summary: 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 + go_methods: + - RepositoriesService.ListDeploymentBranchPolicies + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy + summary: 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 + go_methods: + - RepositoriesService.CreateDeploymentBranchPolicy + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.DeleteDeploymentBranchPolicy + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.GetDeploymentBranchPolicy + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.UpdateDeploymentBranchPolicy + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/events + documentation_url: https://docs.github.com/rest/activity/events#list-repository-events + summary: 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 + go_methods: + - ActivityService.ListRepositoryEvents + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/forks + documentation_url: https://docs.github.com/rest/repos/forks#list-forks + summary: List forks + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListForks + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/forks + documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork + summary: 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 + go_methods: + - RepositoriesService.CreateFork + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/git/blobs + documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob + summary: 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 + go_methods: + - GitService.CreateBlob + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/blobs/{file_sha} + documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob + summary: 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 + go_methods: + - GitService.GetBlob + - GitService.GetBlobRaw + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/git/commits + documentation_url: https://docs.github.com/rest/git/commits#create-a-commit + summary: 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 + go_methods: + - GitService.CreateCommit + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/commits/{commit_sha} + documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object + summary: 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 + go_methods: + - GitService.GetCommit + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/matching-refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#list-matching-references + summary: 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 + go_methods: + - GitService.ListMatchingRefs + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/ref/{ref} + documentation_url: https://docs.github.com/rest/git/refs#get-a-reference + summary: 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 + go_methods: + - GitService.GetRef + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/git/refs + documentation_url: https://docs.github.com/rest/git/refs#create-a-reference + summary: 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 + go_methods: + - GitService.CreateRef + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/git/refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference + summary: 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 + go_methods: + - GitService.DeleteRef + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/git/refs/{ref} + documentation_url: https://docs.github.com/rest/git/refs#update-a-reference + summary: 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 + go_methods: + - GitService.UpdateRef + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/git/tags + documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object + summary: 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 + go_methods: + - GitService.CreateTag + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/tags/{tag_sha} + documentation_url: https://docs.github.com/rest/git/tags#get-a-tag + summary: 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 + go_methods: + - GitService.GetTag + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/git/trees + documentation_url: https://docs.github.com/rest/git/trees#create-a-tree + summary: 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 + go_methods: + - GitService.CreateTree + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/git/trees/{tree_sha} + documentation_url: https://docs.github.com/rest/git/trees#get-a-tree + summary: 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 + go_methods: + - GitService.GetTree + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks + summary: 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 + go_methods: + - RepositoriesService.ListHooks + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.CreateHook + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.DeleteHook + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.GetHook + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.EditHook + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.GetHookConfiguration + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/config + documentation_url: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.EditHookConfiguration + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/deliveries + documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.ListHookDeliveries + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.GetHookDelivery + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.RedeliverHookDelivery + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.PingHook + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/tests + documentation_url: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook + summary: 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 + go_methods: + - RepositoriesService.TestHook + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import + summary: Cancel an import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.CancelImport + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-an-import-status + summary: Get an import status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.ImportProgress + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-an-import + summary: Update an import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.UpdateImport + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#start-an-import + summary: Start an import + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.StartImport + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/import/authors + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-commit-authors + summary: Get commit authors + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.CommitAuthors + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/import/authors/{author_id} + documentation_url: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author + summary: Map a commit author + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.MapCommitAuthor + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/import/large_files + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-large-files + summary: Get large files + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.LargeFiles + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/import/lfs + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference + summary: Update Git LFS preference + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.SetLFSPreference + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app + summary: Get a repository 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 + go_methods: + - AppsService.FindRepositoryInstallation + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository + summary: Remove interaction restrictions for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.RemoveRestrictionsFromRepo + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository + summary: Get interaction restrictions for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.GetRestrictionsForRepo + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository + summary: Set interaction restrictions for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - InteractionsService.UpdateRestrictionsForRepo + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/invitations + documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations + summary: List repository invitations + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListInvitations + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation + summary: 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 + go_methods: + - RepositoriesService.DeleteInvitation + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation + summary: 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 + go_methods: + - RepositoriesService.UpdateInvitation + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues + summary: 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 + go_methods: + - IssuesService.ListByRepo + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues + documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue + summary: 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 + go_methods: + - IssuesService.Create + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/comments + documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository + summary: 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 + go_methods: + - IssuesService.ListComments + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment + summary: 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 + go_methods: + - IssuesService.DeleteComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment + summary: 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 + go_methods: + - IssuesService.GetComment + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} + documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment + summary: 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 + go_methods: + - IssuesService.EditComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment + summary: 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 + go_methods: + - ReactionsService.ListIssueCommentReactions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment + summary: 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 + go_methods: + - ReactionsService.CreateIssueCommentReaction + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction + summary: 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 + go_methods: + - ReactionsService.DeleteIssueCommentReaction + - ReactionsService.DeleteIssueCommentReactionByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/events + documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository + summary: 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 + go_methods: + - IssuesService.ListRepositoryEvents + - ActivityService.ListIssueEventsForRepository + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/events/{event_id} + documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event + summary: 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 + go_methods: + - IssuesService.GetEvent + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number} + documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue + summary: 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 + go_methods: + - IssuesService.Get + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number} + documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue + summary: 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 + go_methods: + - IssuesService.Edit + - IssuesService.RemoveMilestone + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue + summary: 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 + go_methods: + - IssuesService.RemoveAssignees + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/assignees + documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue + summary: 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 + go_methods: + - IssuesService.AddAssignees + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/comments + documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments + summary: 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 + go_methods: + - IssuesService.ListComments + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/comments + documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment + summary: 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 + go_methods: + - IssuesService.CreateComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/events + documentation_url: https://docs.github.com/rest/issues/events#list-issue-events + summary: 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 + go_methods: + - IssuesService.ListIssueEvents + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue + summary: 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 + go_methods: + - IssuesService.RemoveLabelsForIssue + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue + summary: 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 + go_methods: + - IssuesService.ListLabelsByIssue + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue + summary: 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 + go_methods: + - IssuesService.AddLabelsToIssue + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue + summary: 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 + go_methods: + - IssuesService.ReplaceLabelsForIssue + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue + summary: 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 + go_methods: + - IssuesService.RemoveLabelForIssue + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/lock + documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue + summary: 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 + go_methods: + - IssuesService.Unlock + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/lock + documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue + summary: 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 + go_methods: + - IssuesService.Lock + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue + summary: 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 + go_methods: + - ReactionsService.ListIssueReactions + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue + summary: 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 + go_methods: + - ReactionsService.CreateIssueReaction + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction + summary: 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 + go_methods: + - ReactionsService.DeleteIssueReaction + - ReactionsService.DeleteIssueReactionByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/timeline + documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue + summary: 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 + go_methods: + - IssuesService.ListIssueTimeline + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/keys + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys + summary: 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 + go_methods: + - RepositoriesService.ListKeys + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/keys + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key + summary: 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 + go_methods: + - RepositoriesService.CreateKey + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/keys/{key_id} + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key + summary: 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 + go_methods: + - RepositoriesService.DeleteKey + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/keys/{key_id} + documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key + summary: 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 + go_methods: + - RepositoriesService.GetKey + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository + summary: 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 + go_methods: + - IssuesService.ListLabels + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/labels + documentation_url: https://docs.github.com/rest/issues/labels#create-a-label + summary: 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 + go_methods: + - IssuesService.CreateLabel + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label + summary: 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 + go_methods: + - IssuesService.DeleteLabel + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#get-a-label + summary: 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 + go_methods: + - IssuesService.GetLabel + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/labels/{name} + documentation_url: https://docs.github.com/rest/issues/labels#update-a-label + summary: 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 + go_methods: + - IssuesService.EditLabel + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/languages + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages + summary: 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 + go_methods: + - RepositoriesService.ListLanguages + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/lfs + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository + summary: Disable Git LFS for a repository + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.DisableLFS + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/lfs + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository + summary: Enable Git LFS for a repository + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.EnableLFS + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/license + documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.License + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/merge-upstream + documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository + summary: 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 + go_methods: + - RepositoriesService.MergeUpstream + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/merges + documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch + summary: 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 + go_methods: + - RepositoriesService.Merge + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/milestones + documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones + summary: List milestones + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - IssuesService.ListMilestones + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/milestones + documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone + summary: 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 + go_methods: + - IssuesService.CreateMilestone + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone + summary: 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 + go_methods: + - IssuesService.DeleteMilestone + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone + summary: 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 + go_methods: + - IssuesService.GetMilestone + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} + documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone + summary: 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 + go_methods: + - IssuesService.EditMilestone + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number}/labels + documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone + summary: 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 + go_methods: + - IssuesService.ListLabelsForMilestone + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/notifications + documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListRepositoryNotifications + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/notifications + documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read + summary: 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 + go_methods: + - ActivityService.MarkRepositoryNotificationsRead + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site + summary: Delete a GitHub Pages site + override: + documentation_url: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.DisablePages + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site + summary: Get a GitHub Pages site + override: + documentation_url: https://docs.github.com/rest/pages/pages#get-a-github-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.GetPagesInfo + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site + summary: Create a GitHub Pages site + override: + documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.EnablePages + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site + summary: Update information about a GitHub Pages site + override: + documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.UpdatePages + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds + summary: List GitHub Pages builds + override: + documentation_url: https://docs.github.com/rest/pages/pages#list-github-pages-builds + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListPagesBuilds + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build + summary: Request a GitHub Pages build + override: + documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.RequestPageBuild + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pages/builds/latest + documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build + summary: 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 + go_methods: + - RepositoriesService.GetLatestPagesBuild + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pages/builds/{build_id} + documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build + summary: Get GitHub Pages build + override: + documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.GetPageBuild + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pages/deployment + documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pages/health + documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages + summary: Get a DNS health check for GitHub Pages + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.GetPageHealthCheck + - openapi: + method: GET + endpoint_url: /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 + summary: List pre-receive hooks for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListPreReceiveHooks + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove pre-receive hook enforcement for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.DeletePreReceiveHook + - openapi: + method: GET + endpoint_url: /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 + summary: Get a pre-receive hook for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.GetPreReceiveHook + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update pre-receive hook enforcement for a repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.UpdatePreReceiveHook + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository + summary: Disable private vulnerability reporting for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.DisablePrivateReporting + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository + summary: Enable private vulnerability reporting for a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.EnablePrivateReporting + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-repository-projects + summary: List repository projects + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListProjects + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project + summary: 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 + go_methods: + - RepositoriesService.CreateProject + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls + documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests + summary: List pull requests + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - PullRequestsService.List + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pulls + documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.Create + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/comments + documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository + summary: 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 + go_methods: + - PullRequestsService.ListComments + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.DeleteComment + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.GetComment + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} + documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.EditComment + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.ListPullRequestCommentReactions + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.CreatePullRequestCommentReaction + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.DeletePullRequestCommentReaction + - ReactionsService.DeletePullRequestCommentReactionByID + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number} + documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.Get + - PullRequestsService.GetRaw + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number} + documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.Edit + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request + summary: Create a codespace from a pull request + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/comments + documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request + summary: List review comments 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 + go_methods: + - PullRequestsService.ListComments + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/comments + documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.CreateComment + - PullRequestsService.CreateCommentInReplyTo + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/commits + documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.ListCommits + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/files + documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files + summary: 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 + go_methods: + - PullRequestsService.ListFiles + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/merge + documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged + summary: 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 + go_methods: + - PullRequestsService.IsMerged + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/merge + documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.Merge + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.RemoveReviewers + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.ListReviewers + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.RequestReviewers + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/reviews + documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.ListReviews + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/reviews + documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request + summary: 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 + go_methods: + - PullRequestsService.CreateReview + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.DeletePendingReview + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.GetReview + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.UpdateReview + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.ListReviewComments + - openapi: + method: PUT + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.DismissReview + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - PullRequestsService.SubmitReview + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/update-branch + documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch + summary: 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 + go_methods: + - PullRequestsService.UpdateBranch + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/readme + documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme + summary: 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 + go_methods: + - RepositoriesService.GetReadme + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/readme/{dir} + documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases + documentation_url: https://docs.github.com/rest/releases/releases#list-releases + summary: List releases + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.ListReleases + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/releases + documentation_url: https://docs.github.com/rest/releases/releases#create-a-release + summary: 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 + go_methods: + - RepositoriesService.CreateRelease + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset + summary: 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 + go_methods: + - RepositoriesService.DeleteReleaseAsset + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset + summary: 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 + go_methods: + - RepositoriesService.DownloadReleaseAsset + - RepositoriesService.GetReleaseAsset + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} + documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset + summary: 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 + go_methods: + - RepositoriesService.EditReleaseAsset + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/releases/generate-notes + documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release + summary: 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 + go_methods: + - RepositoriesService.GenerateReleaseNotes + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/latest + documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release + summary: 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 + go_methods: + - RepositoriesService.GetLatestRelease + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/tags/{tag} + documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name + summary: 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 + go_methods: + - RepositoriesService.GetReleaseByTag + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release + summary: 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 + go_methods: + - RepositoriesService.DeleteRelease + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#get-a-release + summary: 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 + go_methods: + - RepositoriesService.GetRelease + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/releases/{release_id} + documentation_url: https://docs.github.com/rest/releases/releases#update-a-release + summary: 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 + go_methods: + - RepositoriesService.EditRelease + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/assets + documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets + summary: 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 + go_methods: + - RepositoriesService.ListReleaseAssets + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/assets + documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset + summary: 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 + go_methods: + - RepositoriesService.UploadReleaseAsset + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release + summary: 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 + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release + summary: 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 + go_methods: + - ReactionsService.CreateReleaseReaction + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} + documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction + summary: 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 + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/replicas/caches + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/repos/repos#list-repository-cache-replication-status + summary: List repository cache replication status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/rules/branches/{branch} + documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch + summary: Get rules for a branch + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.GetRulesForBranch + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/rulesets + documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets + summary: Get all repository rulesets + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.GetAllRulesets + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/rulesets + documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset + summary: Create a repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.CreateRuleset + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset + summary: Delete a repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.DeleteRuleset + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset + summary: Get a repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.GetRuleset + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset + summary: Update a repository ruleset + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.UpdateRuleset + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository + summary: 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 + go_methods: + - SecretScanningService.ListAlertsForRepo + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert + summary: 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 + go_methods: + - SecretScanningService.GetAlert + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert + summary: 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 + go_methods: + - SecretScanningService.UpdateAlert + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - SecretScanningService.ListLocationsForAlert + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories + summary: List repository security advisories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory + summary: Create a repository security advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/security-advisories/reports + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability + summary: Privately report a security vulnerability + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory + summary: Get a repository security advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: PATCH + endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory + summary: Update a repository security advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory + summary: Request a CVE for a repository security advisory + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - SecurityAdvisoriesService.RequestCVE + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stargazers + documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers + summary: List stargazers + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActivityService.ListStargazers + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stats/code_frequency + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity + summary: 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 + go_methods: + - RepositoriesService.ListCodeFrequency + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stats/commit_activity + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity + summary: 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 + go_methods: + - RepositoriesService.ListCommitActivity + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stats/contributors + documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity + summary: 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 + go_methods: + - RepositoriesService.ListContributorsStats + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stats/participation + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count + summary: 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 + go_methods: + - RepositoriesService.ListParticipation + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/stats/punch_card + documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day + summary: 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 + go_methods: + - RepositoriesService.ListPunchCard + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/statuses/{sha} + documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status + summary: 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 + go_methods: + - RepositoriesService.CreateStatus + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/subscribers + documentation_url: https://docs.github.com/rest/activity/watching#list-watchers + summary: List watchers + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - ActivityService.ListWatchers + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription + summary: 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 + go_methods: + - ActivityService.DeleteRepositorySubscription + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription + summary: 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 + go_methods: + - ActivityService.GetRepositorySubscription + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/subscription + documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription + summary: 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 + go_methods: + - ActivityService.SetRepositorySubscription + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/tags + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags + summary: 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 + go_methods: + - RepositoriesService.ListTags + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/tags/protection + documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.ListTagProtection + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/tags/protection + documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.CreateTagProtection + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - RepositoriesService.DeleteTagProtection + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/tarball/{ref} + documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar + summary: 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 + go_methods: + - RepositoriesService.GetArchiveLink + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/teams + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams + summary: 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 + go_methods: + - RepositoriesService.ListTeams + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/topics + documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics + summary: 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 + go_methods: + - RepositoriesService.ListAllTopics + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/topics + documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics + summary: 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 + go_methods: + - RepositoriesService.ReplaceAllTopics + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/traffic/clones + documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones + summary: Get repository clones + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.ListTrafficClones + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/traffic/popular/paths + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths + summary: Get top referral paths + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.ListTrafficPaths + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/traffic/popular/referrers + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources + summary: Get top referral sources + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.ListTrafficReferrers + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/traffic/views + documentation_url: https://docs.github.com/rest/metrics/traffic#get-page-views + summary: Get page views + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - RepositoriesService.ListTrafficViews + - openapi: + method: POST + endpoint_url: /repos/{owner}/{repo}/transfer + documentation_url: https://docs.github.com/rest/repos/repos#transfer-a-repository + summary: Transfer a repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - RepositoriesService.Transfer + - openapi: + method: DELETE + endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts + summary: 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 + go_methods: + - RepositoriesService.DisableVulnerabilityAlerts + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository + summary: 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 + go_methods: + - RepositoriesService.GetVulnerabilityAlerts + - openapi: + method: PUT + endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts + documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts + summary: 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 + go_methods: + - RepositoriesService.EnableVulnerabilityAlerts + - openapi: + method: GET + endpoint_url: /repos/{owner}/{repo}/zipball/{ref} + documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip + summary: 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 + go_methods: + - RepositoriesService.GetArchiveLink + - openapi: + method: POST + endpoint_url: /repos/{template_owner}/{template_repo}/generate + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template + summary: 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 + go_methods: + - RepositoriesService.CreateFromTemplate + - openapi: + method: GET + endpoint_url: /repositories + documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories + summary: 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 + go_methods: + - RepositoriesService.ListAll + - openapi: + method: GET + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets + documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets + summary: 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 + go_methods: + - ActionsService.ListEnvSecrets + - openapi: + method: GET + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/public-key + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key + summary: 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 + go_methods: + - ActionsService.GetEnvPublicKey + - openapi: + method: DELETE + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret + summary: 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 + go_methods: + - ActionsService.DeleteEnvSecret + - openapi: + method: GET + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret + summary: 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 + go_methods: + - ActionsService.GetEnvSecret + - openapi: + method: PUT + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret + summary: 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 + go_methods: + - ActionsService.CreateOrUpdateEnvSecret + - openapi: + method: GET + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables + summary: 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 + go_methods: + - ActionsService.ListEnvVariables + - openapi: + method: POST + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables + documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable + summary: 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 + go_methods: + - ActionsService.CreateEnvVariable + - openapi: + method: DELETE + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable + summary: 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 + go_methods: + - ActionsService.DeleteEnvVariable + - openapi: + method: GET + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable + summary: 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 + go_methods: + - ActionsService.GetEnvVariable + - openapi: + method: PATCH + endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} + documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable + summary: 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 + go_methods: + - ActionsService.UpdateEnvVariable + - openapi: + method: GET + endpoint_url: /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise + summary: List provisioned SCIM groups for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /scim/v2/Groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group + summary: Provision a SCIM enterprise group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a SCIM group from an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get SCIM provisioning information for an enterprise group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update an attribute for a SCIM enterprise group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Set SCIM information for a provisioned enterprise group + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise + summary: List SCIM provisioned identities for an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /scim/v2/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user + summary: Provision a SCIM enterprise user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Delete a SCIM user from an enterprise + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get SCIM provisioning information for an enterprise user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /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 + summary: Update an attribute for a SCIM enterprise user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /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 + summary: Set SCIM information for a provisioned enterprise user + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /scim/v2/organizations/{org}/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities + summary: List SCIM provisioned identities + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.ListSCIMProvisionedIdentities + - openapi: + method: POST + endpoint_url: /scim/v2/organizations/{org}/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user + summary: Provision and invite a SCIM user + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.ProvisionAndInviteSCIMUser + - openapi: + method: DELETE + endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization + summary: Delete a SCIM user from an organization + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.DeleteSCIMUserFromOrg + - openapi: + method: GET + endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user + summary: Get SCIM provisioning information for a user + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.GetSCIMProvisioningInfoForUser + - openapi: + method: PATCH + endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user + summary: Update an attribute for a SCIM user + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.UpdateAttributeForSCIMUser + - openapi: + method: PUT + endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership + summary: Update a provisioned organization membership + openapi_files: + - descriptions/ghec/ghec.json + go_methods: + - SCIMService.UpdateProvisionedOrgMembership + - openapi: + method: GET + endpoint_url: /search/code + documentation_url: https://docs.github.com/rest/search/search#search-code + summary: Search code + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Code + - openapi: + method: GET + endpoint_url: /search/commits + documentation_url: https://docs.github.com/rest/search/search#search-commits + summary: Search commits + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Commits + - openapi: + method: GET + endpoint_url: /search/issues + documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests + summary: 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 + go_methods: + - SearchService.Issues + - openapi: + method: GET + endpoint_url: /search/labels + documentation_url: https://docs.github.com/rest/search/search#search-labels + summary: Search labels + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Labels + - openapi: + method: GET + endpoint_url: /search/repositories + documentation_url: https://docs.github.com/rest/search/search#search-repositories + summary: Search repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Repositories + - openapi: + method: GET + endpoint_url: /search/topics + documentation_url: https://docs.github.com/rest/search/search#search-topics + summary: Search topics + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Topics + - openapi: + method: GET + endpoint_url: /search/users + documentation_url: https://docs.github.com/rest/search/search#search-users + summary: Search users + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - SearchService.Users + - openapi: + method: GET + endpoint_url: /setup/api/configcheck + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status + summary: Get the configuration status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /setup/api/configure + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process + summary: Start a configuration process + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /setup/api/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status + summary: Get the maintenance status + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /setup/api/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode + summary: Enable or disable maintenance mode + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings + summary: Get settings + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PUT + endpoint_url: /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings + summary: Set settings + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /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 + summary: Remove an authorized SSH key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /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 + summary: Get all authorized SSH keys + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /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 + summary: Add an authorized SSH key + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /setup/api/start + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license + summary: Create a GitHub license + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: POST + endpoint_url: /setup/api/upgrade + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license + summary: Upgrade a license + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy + summary: 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 + - openapi: + method: PATCH + endpoint_url: /teams/{team_id} + documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy + summary: 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 + - openapi: + method: POST + endpoint_url: /teams/{team_id}/discussions + documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy + summary: 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 + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy + summary: 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 + - openapi: + method: PATCH + endpoint_url: /teams/{team_id}/discussions/{discussion_number} + documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy + summary: 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 + - openapi: + method: POST + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments + documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy + summary: 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 + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy + summary: 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 + - openapi: + method: PATCH + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.ListTeamDiscussionCommentReactions + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - ReactionsService.CreateTeamDiscussionCommentReaction + - openapi: + method: GET + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy + summary: 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 + go_methods: + - ReactionsService.ListTeamDiscussionReactions + - openapi: + method: POST + endpoint_url: /teams/{team_id}/discussions/{discussion_number}/reactions + documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy + summary: 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 + go_methods: + - ReactionsService.CreateTeamDiscussionReaction + - openapi: + method: GET + endpoint_url: /teams/{team_id}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy + summary: List pending team invitations (Legacy) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /teams/{team_id}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members-legacy + summary: List team members (Legacy) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy + summary: 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 + - openapi: + method: PUT + endpoint_url: /teams/{team_id}/members/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy + summary: 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 + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy + summary: 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 + - openapi: + method: PUT + endpoint_url: /teams/{team_id}/memberships/{username} + documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/projects + documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy + summary: 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 + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy + summary: 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 + - openapi: + method: PUT + endpoint_url: /teams/{team_id}/projects/{project_id} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/repos + documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy + summary: 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 + - openapi: + method: DELETE + endpoint_url: /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy + summary: 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 + - openapi: + method: PUT + endpoint_url: /teams/{team_id}/repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy + summary: 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 + - openapi: + method: GET + endpoint_url: /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 + summary: List IdP groups for a team (Legacy) + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: PATCH + endpoint_url: /teams/{team_id}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections-legacy + summary: Create or update IdP group connections (Legacy) + openapi_files: + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /teams/{team_id}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams-legacy + summary: List child teams (Legacy) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: GET + endpoint_url: /user + documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user + summary: 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 + go_methods: + - UsersService.Get + - openapi: + method: PATCH + endpoint_url: /user + documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user + summary: 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 + go_methods: + - UsersService.Edit + - openapi: + method: GET + endpoint_url: /user/blocks + documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user + summary: List users blocked by the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - UsersService.ListBlockedUsers + - openapi: + method: DELETE + endpoint_url: /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#unblock-a-user + summary: Unblock a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - UsersService.UnblockUser + - openapi: + method: GET + endpoint_url: /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user + summary: Check if a user is blocked by the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - UsersService.IsBlocked + - openapi: + method: PUT + endpoint_url: /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#block-a-user + summary: Block a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - UsersService.BlockUser + - openapi: + method: GET + endpoint_url: /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user + summary: List codespaces for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.List + - openapi: + method: POST + endpoint_url: /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user + summary: Create a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /user/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user + summary: List secrets for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListUserSecrets + - openapi: + method: GET + endpoint_url: /user/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user + summary: Get public key for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetUserPublicKey + - openapi: + method: DELETE + endpoint_url: /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user + summary: Delete a secret for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.DeleteUserSecret + - openapi: + method: GET + endpoint_url: /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user + summary: Get a secret for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.GetUserSecret + - openapi: + method: PUT + endpoint_url: /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user + summary: Create or update a secret for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.CreateOrUpdateUserSecret + - openapi: + method: GET + endpoint_url: /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret + summary: List selected repositories for a user secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.ListSelectedReposForUserSecret + - openapi: + method: PUT + endpoint_url: /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret + summary: Set selected repositories for a user secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.SetSelectedReposForUserSecret + - openapi: + method: DELETE + endpoint_url: /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret + summary: Remove a selected repository from a user secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.RemoveSelectedRepoFromUserSecret + - openapi: + method: PUT + endpoint_url: /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret + summary: Add a selected repository to a user secret + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.AddSelectedRepoToUserSecret + - openapi: + method: DELETE + endpoint_url: /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user + summary: Delete a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.Delete + - openapi: + method: GET + endpoint_url: /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user + summary: Get a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: PATCH + endpoint_url: /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user + summary: Update a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /user/codespaces/{codespace_name}/exports + documentation_url: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user + summary: Export a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /user/codespaces/{codespace_name}/exports/{export_id} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export + summary: Get details about a codespace export + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /user/codespaces/{codespace_name}/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace + summary: List machine types for a codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /user/codespaces/{codespace_name}/publish + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace + summary: Create a repository from an unpublished codespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: POST + endpoint_url: /user/codespaces/{codespace_name}/start + documentation_url: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user + summary: Start a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.Start + - openapi: + method: POST + endpoint_url: /user/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user + summary: Stop a codespace for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - CodespacesService.Stop + - openapi: + method: GET + endpoint_url: /user/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user + summary: Get list of conflicting packages during Docker migration for authenticated-user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - openapi: + method: PATCH + endpoint_url: /user/email/visibility + documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user + summary: Set primary email visibility for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - UsersService.SetEmailVisibility + - openapi: + method: DELETE + endpoint_url: /user/emails + documentation_url: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user + summary: Delete 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 + go_methods: + - UsersService.DeleteEmails + - openapi: + method: GET + endpoint_url: /user/emails + documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListEmails + - openapi: + method: POST + endpoint_url: /user/emails + documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.AddEmails + - openapi: + method: GET + endpoint_url: /user/followers + documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListFollowers + - openapi: + method: GET + endpoint_url: /user/following + documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows + summary: 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 + go_methods: + - UsersService.ListFollowing + - openapi: + method: DELETE + endpoint_url: /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user + summary: 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 + go_methods: + - UsersService.Unfollow + - openapi: + method: GET + endpoint_url: /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user + summary: 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 + go_methods: + - UsersService.IsFollowing + - openapi: + method: PUT + endpoint_url: /user/following/{username} + documentation_url: https://docs.github.com/rest/users/followers#follow-a-user + summary: 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 + go_methods: + - UsersService.Follow + - openapi: + method: GET + endpoint_url: /user/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListGPGKeys + - openapi: + method: POST + endpoint_url: /user/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.CreateGPGKey + - openapi: + method: DELETE + endpoint_url: /user/gpg_keys/{gpg_key_id} + documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.DeleteGPGKey + - openapi: + method: GET + endpoint_url: /user/gpg_keys/{gpg_key_id} + documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.GetGPGKey + - openapi: + method: GET + endpoint_url: /user/installations + documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token + summary: 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 + go_methods: + - AppsService.ListUserInstallations + - openapi: + method: GET + endpoint_url: /user/installations/{installation_id}/repositories + documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token + summary: 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 + go_methods: + - AppsService.ListUserRepos + - openapi: + method: DELETE + endpoint_url: /user/installations/{installation_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation + summary: 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 + go_methods: + - AppsService.RemoveRepository + - openapi: + method: PUT + endpoint_url: /user/installations/{installation_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation + summary: 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 + go_methods: + - AppsService.AddRepository + - openapi: + method: DELETE + endpoint_url: /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories + summary: Remove interaction restrictions from your public repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories + summary: Get interaction restrictions for your public repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: PUT + endpoint_url: /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories + summary: Set interaction restrictions for your public repositories + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /user/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user + summary: List user account 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 + go_methods: + - IssuesService.List + - openapi: + method: GET + endpoint_url: /user/keys + documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListKeys + - openapi: + method: POST + endpoint_url: /user/keys + documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.CreateKey + - openapi: + method: DELETE + endpoint_url: /user/keys/{key_id} + documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.DeleteKey + - openapi: + method: GET + endpoint_url: /user/keys/{key_id} + documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.GetKey + - openapi: + method: GET + endpoint_url: /user/marketplace_purchases + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user + summary: List subscriptions for the authenticated user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListMarketplacePurchasesForUser + - openapi: + method: GET + endpoint_url: /user/marketplace_purchases/stubbed + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed + summary: List subscriptions for the authenticated user (stubbed) + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MarketplaceService.ListMarketplacePurchasesForUser + - openapi: + method: GET + endpoint_url: /user/memberships/orgs + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user + summary: List organization memberships 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 + go_methods: + - OrganizationsService.ListOrgMemberships + - openapi: + method: GET + endpoint_url: /user/memberships/orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user + summary: 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 + go_methods: + - OrganizationsService.GetOrgMembership + - openapi: + method: PATCH + endpoint_url: /user/memberships/orgs/{org} + documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user + summary: 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 + go_methods: + - OrganizationsService.EditOrgMembership + - openapi: + method: GET + endpoint_url: /user/migrations + documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations + summary: 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 + go_methods: + - MigrationService.ListUserMigrations + - openapi: + method: POST + endpoint_url: /user/migrations + documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration + summary: 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 + go_methods: + - MigrationService.StartUserMigration + - openapi: + method: GET + endpoint_url: /user/migrations/{migration_id} + documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status + summary: Get a user migration status + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.UserMigrationStatus + - openapi: + method: DELETE + endpoint_url: /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive + summary: Delete a user migration archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.DeleteUserMigration + - openapi: + method: GET + endpoint_url: /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive + summary: Download a user migration archive + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - MigrationService.UserMigrationArchiveURL + - openapi: + method: DELETE + endpoint_url: /user/migrations/{migration_id}/repos/{repo_name}/lock + documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository + summary: Unlock a user repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - MigrationService.UnlockUserRepo + - openapi: + method: GET + endpoint_url: /user/migrations/{migration_id}/repositories + documentation_url: https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration + summary: List repositories for 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 + - openapi: + method: GET + endpoint_url: /user/orgs + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user + summary: 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 + go_methods: + - OrganizationsService.List + - openapi: + method: GET + endpoint_url: /user/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace + summary: List packages for the authenticated user's namespace + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.ListPackages + - openapi: + method: DELETE + endpoint_url: /user/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.DeletePackage + - openapi: + method: GET + endpoint_url: /user/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.GetPackage + - openapi: + method: POST + endpoint_url: /user/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.RestorePackage + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageGetAllVersions + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageDeleteVersion + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageGetVersion + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageRestoreVersion + - openapi: + method: POST + endpoint_url: /user/projects + documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project + summary: 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 + go_methods: + - UsersService.CreateProject + - openapi: + method: GET + endpoint_url: /user/public_emails + documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user + summary: 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 + - openapi: + method: GET + endpoint_url: /user/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user + summary: 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 + go_methods: + - RepositoriesService.List + - openapi: + method: POST + endpoint_url: /user/repos + documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user + summary: 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 + go_methods: + - RepositoriesService.Create + - openapi: + method: GET + endpoint_url: /user/repository_invitations + documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListInvitations + - openapi: + method: DELETE + endpoint_url: /user/repository_invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation + summary: 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 + go_methods: + - UsersService.DeclineInvitation + - openapi: + method: PATCH + endpoint_url: /user/repository_invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation + summary: 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 + go_methods: + - UsersService.AcceptInvitation + - openapi: + method: DELETE + endpoint_url: /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user + summary: 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 + - openapi: + method: GET + endpoint_url: /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user + summary: 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 + - openapi: + method: POST + endpoint_url: /user/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user + summary: 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 + - openapi: + method: GET + endpoint_url: /user/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.ListSSHSigningKeys + - openapi: + method: POST + endpoint_url: /user/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user + summary: 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 + go_methods: + - UsersService.CreateSSHSigningKey + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.DeleteSSHSigningKey + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.GetSSHSigningKey + - openapi: + method: GET + endpoint_url: /user/starred + documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListStarred + - openapi: + method: DELETE + endpoint_url: /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.Unstar + - openapi: + method: GET + endpoint_url: /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.IsStarred + - openapi: + method: PUT + endpoint_url: /user/starred/{owner}/{repo} + documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.Star + - openapi: + method: GET + endpoint_url: /user/subscriptions + documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListWatched + - openapi: + method: GET + endpoint_url: /user/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user + summary: 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 + go_methods: + - TeamsService.ListUserTeams + - openapi: + method: GET + endpoint_url: /users + documentation_url: https://docs.github.com/rest/users/users#list-users + summary: List users + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.ListAll + - openapi: + method: GET + endpoint_url: /users/{username} + documentation_url: https://docs.github.com/rest/users/users#get-a-user + summary: 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 + go_methods: + - UsersService.Get + - openapi: + method: GET + endpoint_url: /users/{username}/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user + summary: 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 + - openapi: + method: GET + endpoint_url: /users/{username}/events + documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListEventsPerformedByUser + - openapi: + method: GET + endpoint_url: /users/{username}/events/orgs/{org} + documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListUserEventsForOrganization + - openapi: + method: GET + endpoint_url: /users/{username}/events/public + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user + summary: 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 + go_methods: + - ActivityService.ListEventsPerformedByUser + - openapi: + method: GET + endpoint_url: /users/{username}/followers + documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user + summary: 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 + go_methods: + - UsersService.ListFollowers + - openapi: + method: GET + endpoint_url: /users/{username}/following + documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows + summary: 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 + go_methods: + - UsersService.ListFollowing + - openapi: + method: GET + endpoint_url: /users/{username}/following/{target_user} + documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user + summary: 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 + go_methods: + - UsersService.IsFollowing + - openapi: + method: GET + endpoint_url: /users/{username}/gists + documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user + summary: 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 + go_methods: + - GistsService.List + - openapi: + method: GET + endpoint_url: /users/{username}/gpg_keys + documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user + summary: 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 + go_methods: + - UsersService.ListGPGKeys + - openapi: + method: GET + endpoint_url: /users/{username}/hovercard + documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user + summary: 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 + go_methods: + - UsersService.GetHovercard + - openapi: + method: GET + endpoint_url: /users/{username}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app + summary: 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 + go_methods: + - AppsService.FindUserInstallation + - openapi: + method: GET + endpoint_url: /users/{username}/keys + documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user + summary: 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 + go_methods: + - UsersService.ListKeys + - openapi: + method: GET + endpoint_url: /users/{username}/orgs + documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user + summary: 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 + go_methods: + - OrganizationsService.List + - openapi: + method: GET + endpoint_url: /users/{username}/packages + documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user + summary: 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 + go_methods: + - UsersService.ListPackages + - openapi: + method: DELETE + endpoint_url: /users/{username}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user + summary: 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 + go_methods: + - UsersService.DeletePackage + - openapi: + method: GET + endpoint_url: /users/{username}/packages/{package_type}/{package_name} + documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user + summary: 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 + go_methods: + - UsersService.GetPackage + - openapi: + method: POST + endpoint_url: /users/{username}/packages/{package_type}/{package_name}/restore + documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user + summary: 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 + go_methods: + - UsersService.RestorePackage + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageGetAllVersions + - openapi: + method: DELETE + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageDeleteVersion + - openapi: + method: GET + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageGetVersion + - openapi: + method: POST + endpoint_url: /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 + summary: 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 + go_methods: + - UsersService.PackageRestoreVersion + - openapi: + method: GET + endpoint_url: /users/{username}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects + summary: 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 + go_methods: + - UsersService.ListProjects + - openapi: + method: GET + endpoint_url: /users/{username}/received_events + documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user + summary: 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 + go_methods: + - ActivityService.ListEventsReceivedByUser + - openapi: + method: GET + endpoint_url: /users/{username}/received_events/public + documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user + summary: 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 + go_methods: + - ActivityService.ListEventsReceivedByUser + - openapi: + method: GET + endpoint_url: /users/{username}/repos + documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user + summary: 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 + go_methods: + - RepositoriesService.List + - openapi: + method: GET + endpoint_url: /users/{username}/settings/billing/actions + documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user + summary: Get GitHub Actions billing for a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetActionsBillingUser + - openapi: + method: GET + endpoint_url: /users/{username}/settings/billing/packages + documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user + summary: Get GitHub Packages billing for a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetPackagesBillingUser + - openapi: + method: GET + endpoint_url: /users/{username}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user + summary: Get shared storage billing for a user + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + go_methods: + - BillingService.GetStorageBillingUser + - openapi: + method: DELETE + endpoint_url: /users/{username}/site_admin + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator + summary: Demote a site administrator + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.DemoteSiteAdmin + - openapi: + method: PUT + endpoint_url: /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 + summary: Promote a user to be a site administrator + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.PromoteSiteAdmin + - openapi: + method: GET + endpoint_url: /users/{username}/social_accounts + documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user + summary: 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 + - openapi: + method: GET + endpoint_url: /users/{username}/ssh_signing_keys + documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user + summary: 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 + go_methods: + - UsersService.ListSSHSigningKeys + - openapi: + method: GET + endpoint_url: /users/{username}/starred + documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user + summary: 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 + go_methods: + - ActivityService.ListStarred + - openapi: + method: GET + endpoint_url: /users/{username}/subscriptions + documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user + summary: 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 + go_methods: + - ActivityService.ListWatched + - openapi: + method: DELETE + endpoint_url: /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user + summary: Unsuspend a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.Unsuspend + - openapi: + method: PUT + endpoint_url: /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user + summary: Suspend a user + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - UsersService.Suspend + - openapi: + method: GET + endpoint_url: /versions + documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions + summary: Get all API versions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - openapi: + method: GET + endpoint_url: /zen + documentation_url: https://docs.github.com/rest/meta/meta#get-the-zen-of-github + summary: Get the Zen of GitHub + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + go_methods: + - Client.Zen diff --git a/script/diff-check b/script/diff-check new file mode 100755 index 00000000000..486cee6b453 --- /dev/null +++ b/script/diff-check @@ -0,0 +1,50 @@ +#!/bin/sh +#/ diff-check checks whether running the given command results in changes to the repo. +#/ The given command is run with a working directory that is the top level of the repo in a +#/ temporary git worktree. The command exits non-zero and outputs the diff if the command results +#/ in changes to the worktree. +#/ +#/ Usage: script/diff-check +#/ +#/ Example: +#/ script/diff-check 'go generate ./...' + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." + +usage() { + grep '^#/' "$0" | cut -c4- + exit 1 +} + +if [ "$1" = "--help" ]; then + usage +fi + +if [ $# -ne 1 ]; then + usage +fi + +GENTEMP="$(mktemp -d)" +git worktree add -q --detach "$GENTEMP" +trap 'git worktree remove -f "$GENTEMP"; rm -rf "$GENTEMP"' EXIT +for f in $(git ls-files -com --exclude-standard); do + target="$GENTEMP/$f" + mkdir -p "$(dirname -- "$target")" + cp "$f" "$target" +done +if [ -f "$(pwd)"/bin ]; then + ln -s "$(pwd)"/bin "$GENTEMP"/bin +fi + +cd "$GENTEMP" +git add . +git -c user.name='bot' -c user.email='bot@localhost' commit -m "diff-check" -q --allow-empty +sh -c "$*" +git add -N . +[ -z "$(git status --porcelain)" ] || { + echo "$* resulted in changes." 1>&2 + git diff -u . "$GENTEMP" + exit 1 +} diff --git a/script/golangci-lint b/script/golangci-lint new file mode 100755 index 00000000000..fc3912a30c4 --- /dev/null +++ b/script/golangci-lint @@ -0,0 +1,22 @@ +#!/bin/sh +#/ golangci-lint installs golangci-lint and runs it with the given arguments. + +set -e + +GOLANGCI_LINT_VERSION="v1.54.2" + +REPO_DIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)" +export GOBIN="$REPO_DIR"/bin +mkdir -p "$GOBIN" + +install_golangci_lint() { + if [ -f "$GOBIN"/golangci-lint ]; then + if "$GOBIN"/golangci-lint --version | grep -q "$GOLANGCI_LINT_VERSION"; then + return + fi + fi + go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} +} + +install_golangci_lint +exec "$GOBIN"/golangci-lint "$@" diff --git a/script/lint b/script/lint new file mode 100755 index 00000000000..ddc005ba63d --- /dev/null +++ b/script/lint @@ -0,0 +1,27 @@ +#!/bin/sh +#/ lint approximates the linting done in CI. + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." +REPO_DIR="$(pwd -P)" + +MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname)" + +for dir in $MOD_DIRS; do + # skip example/newreposecretwithlibsodium because it requires libsodium + if [ "$dir" = "example/newreposecretwithlibsodium" ]; then + continue + fi + echo "linting $dir" + ( + cd "$dir" + "$REPO_DIR"/script/golangci-lint run --path-prefix="$dir" + ) +done + +echo validating metadata.yaml +script/metadata validate + +echo validating generated files are up to date +script/diff-check 'go generate ./...' diff --git a/script/metadata b/script/metadata new file mode 100755 index 00000000000..05f440b68e2 --- /dev/null +++ b/script/metadata @@ -0,0 +1,15 @@ +#!/bin/sh +#/ metadata builds and runs tools/metadata with the given arguments. + +set -e + +REPO_DIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)" + +mkdir -p "$REPO_DIR"/bin + +( + cd "$REPO_DIR"/tools + go build -o "$REPO_DIR"/bin/metadata ./metadata +) + +exec "$REPO_DIR"/bin/metadata "$@" diff --git a/tools/go.mod b/tools/go.mod new file mode 100644 index 00000000000..e384d36518d --- /dev/null +++ b/tools/go.mod @@ -0,0 +1,32 @@ +module github.com/google/go-github/tools + +go 1.21 + +require ( + github.com/alecthomas/kong v0.8.0 + github.com/dave/dst v0.27.2 + github.com/getkin/kin-openapi v0.119.0 + github.com/google/go-github/v55 v55.0.0 + github.com/stretchr/testify v1.8.4 + golang.org/x/mod v0.12.0 + golang.org/x/sync v0.3.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/invopop/yaml v0.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/perimeterx/marshmallow v1.1.4 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/tools v0.1.12 // indirect +) diff --git a/tools/go.sum b/tools/go.sum new file mode 100644 index 00000000000..b88d4da8eac --- /dev/null +++ b/tools/go.sum @@ -0,0 +1,94 @@ +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= +github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s= +github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= +github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc= +github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc= +github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg= +github.com/dave/jennifer v1.5.0/go.mod h1:4MnyiFIlZS3l5tSDn8VnzE6ffAhYBMB2SZntBsZGUok= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/getkin/kin-openapi v0.119.0 h1:FIn6hYX3huTFV28GS1hotceX8MAsGGf/c+jFta5XRaE= +github.com/getkin/kin-openapi v0.119.0/go.mod h1:Kc71dQTNCxy/6sBdhR5dbKoSHwzLCcgygpCzizUy4XA= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= +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= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw= +github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/internal/internal.go b/tools/internal/internal.go new file mode 100644 index 00000000000..0dee2861793 --- /dev/null +++ b/tools/internal/internal.go @@ -0,0 +1,154 @@ +package internal + +import ( + "fmt" + "os" + "path/filepath" + "sort" + "strings" + + "github.com/dave/dst" + "github.com/dave/dst/decorator" + "golang.org/x/mod/modfile" + "golang.org/x/mod/module" +) + +// ProjRootDir returns the go-github root directory that contains dir. +// Returns an error if dir is not in a go-github root. +func ProjRootDir(dir string) (string, error) { + dir, err := filepath.Abs(dir) + if err != nil { + return "", err + } + ok, err := isGoGithubRoot(dir) + if err != nil { + return "", err + } + if ok { + return dir, nil + } + parent := filepath.Dir(dir) + if parent == dir { + return "", fmt.Errorf("not in a go-github root") + } + return ProjRootDir(parent) +} + +func isGoGithubRoot(dir string) (bool, error) { + filename := filepath.Join(dir, "go.mod") + b, err := os.ReadFile(filename) + if err != nil { + if os.IsNotExist(err) { + return false, nil + } + return false, err + } + mf, err := modfile.ParseLax(filename, b, nil) + if err != nil { + // an invalid go.mod file is not a go-github root, so we don't care about the error + return false, nil + } + if mf.Module == nil { + return false, nil + } + // This gets rid of the /vN suffix if it exists. + base, _, ok := module.SplitPathVersion(mf.Module.Mod.Path) + if !ok { + return false, nil + } + return base == "github.com/google/go-github", nil +} + +func ExitErr(err error) { + if err == nil { + return + } + fmt.Fprintf(os.Stderr, "error: %v\n", err) + os.Exit(1) +} + +type ServiceMethod struct { + ReceiverName string + MethodName string + Filename string +} + +func (m *ServiceMethod) Name() string { + return fmt.Sprintf("%s.%s", m.ReceiverName, m.MethodName) +} + +func GetServiceMethods(dir string) ([]*ServiceMethod, error) { + dirEntries, err := os.ReadDir(dir) + if err != nil { + return nil, err + } + var serviceMethods []*ServiceMethod + for _, filename := range dirEntries { + m, err := getServiceMethodsFromFile(filepath.Join(dir, filename.Name())) + if err != nil { + return nil, err + } + serviceMethods = append(serviceMethods, m...) + } + sort.Slice(serviceMethods, func(i, j int) bool { + if serviceMethods[i].Filename != serviceMethods[j].Filename { + return serviceMethods[i].Filename < serviceMethods[j].Filename + } + return serviceMethods[i].Name() < serviceMethods[j].Name() + }) + return serviceMethods, nil +} + +func getServiceMethodsFromFile(filename string) ([]*ServiceMethod, error) { + if !strings.HasSuffix(filename, ".go") || + strings.HasSuffix(filename, "_test.go") { + return nil, nil + } + + df, err := decorator.ParseFile(nil, filename, nil, 0) + if err != nil { + return nil, err + } + + // Only look at the github package + if df.Name.Name != "github" { + return nil, nil + } + var serviceMethods []*ServiceMethod + dst.Inspect(df, func(n dst.Node) bool { + decl, ok := n.(*dst.FuncDecl) + if !ok { + return true + } + if decl.Recv == nil || len(decl.Recv.List) != 1 { + return true + } + se, ok := decl.Recv.List[0].Type.(*dst.StarExpr) + if !ok { + return true + } + id, ok := se.X.(*dst.Ident) + if !ok { + return true + } + receiverName := id.Name + methodName := decl.Name.Name + if !dst.IsExported(methodName) || !dst.IsExported(receiverName) { + return true + } + if receiverName != "Client" && !strings.HasSuffix(receiverName, "Service") { + return true + } + // Skip Client methods in github.go + if receiverName == "Client" && filepath.Base(filename) == "github.go" { + return true + } + serviceMethods = append(serviceMethods, &ServiceMethod{ + ReceiverName: receiverName, + MethodName: methodName, + Filename: filename, + }) + return true + }) + return serviceMethods, nil +} diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go new file mode 100644 index 00000000000..cd8df30d069 --- /dev/null +++ b/tools/internal/metadata.go @@ -0,0 +1,402 @@ +package internal + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io/fs" + "net/url" + "os" + "path/filepath" + "regexp" + "slices" + "sort" + "strings" + "sync" + + "github.com/dave/dst" + "github.com/dave/dst/decorator" + "gopkg.in/yaml.v3" +) + +type OperationDesc struct { + Method string `yaml:"method,omitempty" json:"method,omitempty"` + EndpointURL string `yaml:"endpoint_url,omitempty" json:"endpoint_url,omitempty"` + DocumentationURL string `yaml:"documentation_url,omitempty" json:"documentation_url,omitempty"` + Summary string `yaml:"summary,omitempty" json:"summary,omitempty"` +} + +type Operation struct { + OpenAPI OperationDesc `yaml:"openapi,omitempty" json:"openapi,omitempty"` + Override OperationDesc `yaml:"override,omitempty" json:"override,omitempty"` + OpenAPIFiles []string `yaml:"openapi_files,omitempty" json:"openapi_files,omitempty"` + GoMethods []string `yaml:"go_methods,omitempty" json:"go_methods,omitempty"` +} + +type operationJSON struct { + Method string `json:"method,omitempty"` + EndpointURL string `json:"endpoint_url,omitempty"` + Summary string `json:"summary,omitempty"` + DocumentURL string `json:"documentation_url,omitempty"` + Plans []string `json:"plans,omitempty"` + GoMethods []string `json:"go_methods,omitempty"` +} + +func (o *Operation) MarshalJSON() ([]byte, error) { + return json.Marshal(&operationJSON{ + Method: o.Method(), + EndpointURL: o.EndpointURL(), + Summary: o.Summary(), + Plans: o.Plans(), + DocumentURL: o.DocumentationURL(), + GoMethods: o.GoMethods, + }) +} + +func (o *Operation) Plans() []string { + var plans []string + if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { + return strings.HasSuffix(s, "api.github.com.json") + }) { + plans = append(plans, "public") + } + if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { + return strings.HasSuffix(s, "ghec.json") + }) { + plans = append(plans, "ghec") + } + if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { + return strings.Contains(s, "/ghes") + }) { + plans = append(plans, "ghes") + } + return plans +} + +func (o *Operation) Method() string { + if o.Override.Method != "" { + return o.Override.Method + } + return o.OpenAPI.Method +} + +func (o *Operation) EndpointURL() string { + if o.Override.EndpointURL != "" { + return o.Override.EndpointURL + } + return o.OpenAPI.EndpointURL +} + +func (o *Operation) DocumentationURL() string { + if o.Override.DocumentationURL != "" { + return o.Override.DocumentationURL + } + return o.OpenAPI.DocumentationURL +} + +func (o *Operation) Summary() string { + if o.Override.Summary != "" { + return o.Override.Summary + } + return o.OpenAPI.Summary +} + +func (o *Operation) Less(other *Operation) bool { + if o.EndpointURL() != other.EndpointURL() { + return o.EndpointURL() < other.EndpointURL() + } + return o.Method() < other.Method() +} + +// matchesOpenAPIDesc returns true if this is describing the same operation as desc +// based on endpoint and method. +func (o *Operation) matchesOpenAPIDesc(desc *OperationDesc) bool { + if o.Method() != desc.Method { + return false + } + return normalizedURL(o.EndpointURL()) == normalizedURL(desc.EndpointURL) +} + +var normalizedURLs = map[string]string{} +var normalizedURLsMu sync.Mutex + +// normalizedURL returns an endpoint with all templated path parameters replaced with *. +func normalizedURL(u string) string { + normalizedURLsMu.Lock() + defer normalizedURLsMu.Unlock() + n, ok := normalizedURLs[u] + if ok { + return n + } + parts := strings.Split(u, "/") + for i, p := range parts { + if len(p) > 0 && p[0] == '{' { + parts[i] = "*" + } + } + n = strings.Join(parts, "/") + normalizedURLs[u] = n + return n +} + +type Metadata struct { + UndocumentedMethods []string `yaml:"undocumented_methods,omitempty"` + Operations []*Operation `yaml:"operations,omitempty"` +} + +func LoadMetadataFile(filename string, opFile *Metadata) (errOut error) { + f, err := os.Open(filename) + if err != nil { + return err + } + defer func() { + e := f.Close() + if errOut == nil { + errOut = e + } + }() + return yaml.NewDecoder(f).Decode(opFile) +} + +func (m *Metadata) SaveFile(filename string) (errOut error) { + f, err := os.Create(filename) + if err != nil { + panic(err) + } + defer func() { + e := f.Close() + if errOut == nil { + errOut = e + } + }() + enc := yaml.NewEncoder(f) + enc.SetIndent(2) + return enc.Encode(m) +} + +func (m *Metadata) AddOperation(filename string, desc *OperationDesc) { + update := func(op *Operation) { + if len(op.OpenAPIFiles) == 0 { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + op.OpenAPI = *desc + return + } + // just append to files, but only add the first ghes file + if !strings.Contains(filename, "/ghes") { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + return + } + for _, f := range op.OpenAPIFiles { + if strings.Contains(f, "/ghes") { + return + } + } + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + } + for _, op := range m.Operations { + if op.matchesOpenAPIDesc(desc) { + update(op) + return + } + } + m.Operations = append(m.Operations, &Operation{ + OpenAPIFiles: []string{filename}, + OpenAPI: *desc, + }) +} + +func (m *Metadata) OperationsByDocURL(docURL string) *Operation { + wantIdx := urlIndex(docURL) + var found []*Operation + for _, op := range m.Operations { + hasIdx := urlIndex(op.DocumentationURL()) + if hasIdx == wantIdx { + found = append(found, op) + } + } + switch len(found) { + case 0: + return nil + case 1: + return found[0] + } + fmt.Println("found multiple operations for", wantIdx) + for _, op := range found { + fmt.Println(" ", op.OpenAPI.EndpointURL, op.OpenAPI.Method) + } + return nil +} + +func (m *Metadata) DocLinksForMethod(method string) []string { + var links []string + for _, op := range m.OperationsForMethod(method) { + links = append(links, op.DocumentationURL()) + } + sort.Strings(links) + return links +} + +func (m *Metadata) OperationsForMethod(method string) []*Operation { + var operations []*Operation + for _, op := range m.Operations { + if !slices.Contains(op.GoMethods, method) { + continue + } + operations = append(operations, op) + } + sort.Slice(operations, func(i, j int) bool { + return operations[i].Less(operations[j]) + }) + return operations +} + +func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, ref string) error { + descs, err := GetDescriptions(ctx, client, ref) + if err != nil { + return err + } + for _, op := range m.Operations { + op.OpenAPIFiles = op.OpenAPIFiles[:0] + } + for _, desc := range descs { + for p, pathItem := range desc.Description.Paths { + for method, op := range pathItem.Operations() { + docURL := "" + if op.ExternalDocs != nil { + docURL = op.ExternalDocs.URL + } + m.AddOperation(desc.Filename, &OperationDesc{ + Method: method, + EndpointURL: p, + DocumentationURL: docURL, + Summary: op.Summary, + }) + } + } + } + sort.Slice(m.Operations, func(i, j int) bool { + return m.Operations[i].Less(m.Operations[j]) + }) + return nil +} + +var ( + docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:`) + emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) +) + +// UpdateDocLinks updates the code comments in dir with doc urls from metadata. +func UpdateDocLinks(meta *Metadata, dir string) error { + return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + if d.IsDir() || + !strings.HasSuffix(path, ".go") || + strings.HasSuffix(path, "_test.go") { + return nil + } + content, err := os.ReadFile(path) + if err != nil { + return err + } + updatedContent, err := UpdateDocsLinksInFile(meta, content) + if err != nil { + return err + } + f, err := os.Create(path) + if err != nil { + return err + } + _, err = f.Write(updatedContent) + if err != nil { + return err + } + return f.Close() + }) +} + +// UpdateDocsLinksInFile updates in the code comments in content with doc urls from metadata. +func UpdateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { + df, err := decorator.Parse(content) + if err != nil { + return nil, err + } + + // ignore files where package is not github + if df.Name.Name != "github" { + return content, nil + } + + dst.Inspect(df, func(n dst.Node) bool { + d, ok := n.(*dst.FuncDecl) + if !ok || + !d.Name.IsExported() || + d.Recv == nil { + return true + } + + // Get the method's receiver. It can be either an identifier or a pointer to an identifier. + // This assumes all receivers are named and we don't have something like: `func (Client) Foo()`. + methodName := d.Name.Name + receiverType := "" + switch x := d.Recv.List[0].Type.(type) { + case *dst.Ident: + receiverType = x.Name + case *dst.StarExpr: + receiverType = x.X.(*dst.Ident).Name + } + + // create copy of comments without doc links + var starts []string + for _, s := range d.Decs.Start.All() { + if !docLineRE.MatchString(s) { + starts = append(starts, s) + } + } + + // remove trailing empty lines + for len(starts) > 0 { + if !emptyLineRE.MatchString(starts[len(starts)-1]) { + break + } + starts = starts[:len(starts)-1] + } + + docLinks := metadata.DocLinksForMethod(strings.Join([]string{receiverType, methodName}, ".")) + + // add an empty line before adding doc links + if len(docLinks) > 0 { + starts = append(starts, "//") + } + + for _, dl := range docLinks { + starts = append(starts, fmt.Sprintf("// GitHub API docs: %s", dl)) + } + d.Decs.Start.Replace(starts...) + return true + }) + + var buf bytes.Buffer + err = decorator.Fprint(&buf, df) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// urlIndex returns the part of the path that comes after /rest/ followed by the fragment. +func urlIndex(s string) string { + u, err := url.Parse(s) + if err != nil { + return "" + } + restIdx := strings.Index(u.Path, "/rest/") + if restIdx == -1 { + return "" + } + p := u.Path[restIdx+len("/rest/"):] + p = strings.TrimSuffix(p, "/") + return p + "#" + u.Fragment +} diff --git a/tools/internal/openapi.go b/tools/internal/openapi.go new file mode 100644 index 00000000000..f40fb2c8650 --- /dev/null +++ b/tools/internal/openapi.go @@ -0,0 +1,146 @@ +package internal + +import ( + "context" + "fmt" + "io" + "regexp" + "sort" + "strconv" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/google/go-github/v55/github" + "golang.org/x/sync/errgroup" +) + +const ( + descriptionsOwnerName = "github" + descriptionsRepoName = "rest-api-description" + descriptionsPath = "descriptions" +) + +type OpenapiFile struct { + Description openapi3.T + Filename string + plan string + planIdx int + releaseMajor int + releaseMinor int +} + +type contentsClient interface { + DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) + GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) +} + +func (o *OpenapiFile) loadDescription(ctx context.Context, client contentsClient, gitRef string) error { + contents, resp, err := client.DownloadContents( + ctx, + descriptionsOwnerName, + descriptionsRepoName, + o.Filename, + &github.RepositoryContentGetOptions{Ref: gitRef}, + ) + if err != nil { + return err + } + if resp.StatusCode != 200 { + return fmt.Errorf("unexpected status code: %s", resp.Status) + } + b, err := io.ReadAll(contents) + if err != nil { + return err + } + err = contents.Close() + if err != nil { + return err + } + desc, err := openapi3.NewLoader().LoadFromData(b) + if err != nil { + return err + } + o.Description = *desc + return nil +} + +// less sorts by the following rules: +// - planIdx ascending +// - releaseMajor descending +// - releaseMinor descending +func (o *OpenapiFile) less(other *OpenapiFile) bool { + if o.planIdx != other.planIdx { + return o.planIdx < other.planIdx + } + if o.releaseMajor != other.releaseMajor { + return o.releaseMajor > other.releaseMajor + } + return o.releaseMinor > other.releaseMinor +} + +var dirPatterns = []*regexp.Regexp{ + regexp.MustCompile(`^(?Papi\.github\.com)(-(?P\d+)\.(?P\d+))?$`), + regexp.MustCompile(`^(?Pghec)(-(?P\d+)\.(?P\d+))?$`), + regexp.MustCompile(`^(?Pghes)(-(?P\d+)\.(?P\d+))?$`), +} + +// GetDescriptions loads OpenapiFiles for all the OpenAPI 3.0 description files in github/rest-api-description. +// This assumes that all directories in "descriptions/" contain OpenAPI 3.0 description files with the same +// name as the directory (plus the ".json" extension). For example, "descriptions/api.github.com/api.github.com.json". +// Results are sorted by these rules: +// - Directories that don't match any of the patterns in dirPatterns are removed. +// - Directories are sorted by the pattern that matched in the same order they appear in dirPatterns. +// - Directories are then sorted by major and minor version in descending order. +func GetDescriptions(ctx context.Context, client contentsClient, gitRef string) ([]*OpenapiFile, error) { + _, dir, resp, err := client.GetContents( + ctx, + descriptionsOwnerName, + descriptionsRepoName, + descriptionsPath, + &github.RepositoryContentGetOptions{Ref: gitRef}, + ) + if err != nil { + return nil, err + } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected status code: %s", resp.Status) + } + files := make([]*OpenapiFile, 0, len(dir)) + for _, d := range dir { + for i, pattern := range dirPatterns { + m := pattern.FindStringSubmatch(d.GetName()) + if m == nil { + continue + } + plan := m[pattern.SubexpIndex("plan")] + major, _ := strconv.Atoi(m[pattern.SubexpIndex("major")]) + minor, _ := strconv.Atoi(m[pattern.SubexpIndex("minor")]) + if plan == "ghes" && major < 3 { + continue + } + filename := fmt.Sprintf("descriptions/%s/%s.json", d.GetName(), d.GetName()) + files = append(files, &OpenapiFile{ + Filename: filename, + plan: plan, + planIdx: i, + releaseMajor: major, + releaseMinor: minor, + }) + break + } + } + sort.Slice(files, func(i, j int) bool { + return files[i].less(files[j]) + }) + g, ctx := errgroup.WithContext(ctx) + for _, file := range files { + f := file + g.Go(func() error { + return f.loadDescription(ctx, client, gitRef) + }) + } + err = g.Wait() + if err != nil { + return nil, err + } + return files, nil +} diff --git a/tools/internal/openapi_test.go b/tools/internal/openapi_test.go new file mode 100644 index 00000000000..27108840c51 --- /dev/null +++ b/tools/internal/openapi_test.go @@ -0,0 +1,79 @@ +package internal + +import ( + "context" + "io" + "net/http" + "strings" + "testing" + + "github.com/google/go-github/v55/github" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +type dummyContentsClient struct { + t *testing.T + downloadContents func(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) + getContents func(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) +} + +func (d dummyContentsClient) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) { + d.t.Helper() + return d.downloadContents(ctx, owner, repo, filepath, opts) +} + +func (d dummyContentsClient) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) { + d.t.Helper() + return d.getContents(ctx, owner, repo, path, opts) +} + +func TestGetDescriptions(t *testing.T) { + ctx := context.Background() + client := dummyContentsClient{ + t: t, + getContents: func(_ context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) { + t.Helper() + assert.Equal(t, descriptionsOwnerName, owner) + assert.Equal(t, descriptionsRepoName, repo) + assert.Equal(t, "descriptions", path) + assert.Equal(t, &github.RepositoryContentGetOptions{Ref: "main"}, opts) + dir := []*github.RepositoryContent{ + {Name: github.String("ghes-3.1")}, + {Name: github.String("ghes-3.2")}, + {Name: github.String("ignore_me")}, + {Name: github.String("api.github.com")}, + {Name: github.String("ghec")}, + } + return nil, dir, &github.Response{Response: &http.Response{StatusCode: 200}}, nil + }, + downloadContents: func(_ context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) { + assert.Equal(t, descriptionsOwnerName, owner) + assert.Equal(t, descriptionsRepoName, repo) + assert.Equal(t, &github.RepositoryContentGetOptions{Ref: "main"}, opts) + contents := `{"info": {"version": "1.2.3"}}` + switch filepath { + case "descriptions/api.github.com/api.github.com.json": + case "descriptions/ghes-3.1/ghes-3.1.json": + case "descriptions/ghes-3.2/ghes-3.2.json": + case "descriptions/ghec/ghec.json": + default: + t.Errorf("unexpected filepath: %s", filepath) + } + return io.NopCloser(strings.NewReader(contents)), &github.Response{Response: &http.Response{StatusCode: 200}}, nil + }, + } + wantFiles := []string{ + "descriptions/api.github.com/api.github.com.json", + "descriptions/ghec/ghec.json", + "descriptions/ghes-3.2/ghes-3.2.json", + "descriptions/ghes-3.1/ghes-3.1.json", + } + got, err := GetDescriptions(ctx, client, "main") + require.NoError(t, err) + require.Equal(t, len(wantFiles), len(got)) + for i := range wantFiles { + require.Equal(t, wantFiles[i], got[i].Filename) + require.Equal(t, "1.2.3", got[i].Description.Info.Version) + } +} diff --git a/tools/internal/validate.go b/tools/internal/validate.go new file mode 100644 index 00000000000..4fa5ad23d4e --- /dev/null +++ b/tools/internal/validate.go @@ -0,0 +1,83 @@ +package internal + +import ( + "fmt" + "slices" + "sort" +) + +// ValidateMetadata returns a list of issues with the metadata file. An error means +// there was an error validating the file, not that there are issues with the file. +func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { + undocumentedMethods, err := getUndocumentedMethods(dir, meta) + if err != nil { + return nil, err + } + var result []string + for _, m := range undocumentedMethods { + msg := fmt.Sprintf("Undocumented method %s. Please add it to metadata.", m.Name()) + result = append(result, msg) + } + metaMethodMap := map[string]bool{} + for _, m := range meta.UndocumentedMethods { + metaMethodMap[m] = true + } + for _, op := range meta.Operations { + for _, m := range op.GoMethods { + metaMethodMap[m] = true + } + } + var metaMethods []string + for m := range metaMethodMap { + metaMethods = append(metaMethods, m) + } + sort.Strings(metaMethods) + missing, err := missingMethods(dir, metaMethods) + if err != nil { + return nil, err + } + for _, m := range missing { + msg := fmt.Sprintf("Method %s in metadata does not exist in github package.", m) + result = append(result, msg) + } + return result, nil +} + +// getUndocumentedMethods returns a list of methods that are not mapped to any operation in metadata.yaml +func getUndocumentedMethods(dir string, metadata *Metadata) ([]*ServiceMethod, error) { + var result []*ServiceMethod + methods, err := GetServiceMethods(dir) + if err != nil { + return nil, err + } + for _, method := range methods { + ops := metadata.OperationsForMethod(method.Name()) + if len(ops) > 0 { + continue + } + if slices.Contains(metadata.UndocumentedMethods, method.Name()) { + continue + } + result = append(result, method) + } + return result, nil +} + +// missingMethods returns the set from methods that do not exist in the github package. +func missingMethods(dir string, methods []string) ([]string, error) { + var result []string + existingMap := map[string]bool{} + sm, err := GetServiceMethods(dir) + if err != nil { + return nil, err + } + for _, method := range sm { + existingMap[method.Name()] = true + } + for _, m := range methods { + if !existingMap[m] { + result = append(result, m) + } + } + return result, nil +} diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go new file mode 100644 index 00000000000..d4efa69ab5d --- /dev/null +++ b/tools/metadata/metadata.go @@ -0,0 +1,174 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/alecthomas/kong" + "github.com/google/go-github/tools/internal" + "github.com/google/go-github/v55/github" +) + +var helpVars = kong.Vars{ + "update_help": `Update metadata.yaml from OpenAPI descriptions in github.com/github/rest-api-description.`, + "format_help": `Format metadata.yaml.`, + "validate_help": `Validate that metadata.yaml is consistent with source code.`, + "unused_ops_help": `List operations in metadata.yaml that don't have any associated go methods'.`, +} + +type rootCmd struct { + WorkingDir string `kong:"short=C,default='.',help='Working directory. Must be within a go-github root.'"` + Filename string `kong:"help='Path to metadata.yaml. Defaults to /metadata.yaml.'"` + GithubDir string `kong:"help='Path to the github package. Defaults to /github.'"` + UpdateMetadata updateMetadataCmd `kong:"cmd,help=${update_help}"` + UpdateUrls updateUrlsCmd `kong:"cmd,help='Update documentation URLs in the Go source files in the github directory to match the urls in the metadata file.'"` + Format formatCmd `kong:"cmd,help=${format_help}"` + Validate validateCmd `kong:"cmd,help=${validate_help}"` + UnusedOps unusedOpsCmd `kong:"cmd,help=${unused_ops_help}"` +} + +func (c *rootCmd) metadata() (string, *internal.Metadata, error) { + filename := c.Filename + if filename == "" { + dir, err := internal.ProjRootDir(c.WorkingDir) + if err != nil { + return "", nil, err + } + filename = filepath.Join(dir, "metadata.yaml") + } + var meta internal.Metadata + err := internal.LoadMetadataFile(filename, &meta) + if err != nil { + return "", nil, err + } + return filename, &meta, nil +} + +func (c *rootCmd) githubDir() (string, error) { + dir := c.GithubDir + if dir == "" { + githubDir, err := internal.ProjRootDir(c.WorkingDir) + if err != nil { + return "", err + } + dir = filepath.Join(githubDir, "github") + } + return dir, nil +} + +type updateMetadataCmd struct { + Ref string `kong:"default='main',help='git ref to pull OpenAPI descriptions from'"` +} + +func (c *updateMetadataCmd) Run(root *rootCmd) error { + ctx := context.Background() + filename, meta, err := root.metadata() + if err != nil { + return err + } + token := os.Getenv("GITHUB_TOKEN") + if token == "" { + return fmt.Errorf("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") + } + client := github.NewClient(nil).WithAuthToken(token).Repositories + err = meta.UpdateFromGithub(ctx, client, c.Ref) + if err != nil { + return err + } + return meta.SaveFile(filename) +} + +type formatCmd struct{} + +func (c *formatCmd) Run(root *rootCmd) error { + filename, meta, err := root.metadata() + if err != nil { + return err + } + return meta.SaveFile(filename) +} + +type validateCmd struct{} + +func (c *validateCmd) Run(root *rootCmd) error { + githubDir, err := root.githubDir() + if err != nil { + return err + } + filename, meta, err := root.metadata() + if err != nil { + return err + } + issues, err := internal.ValidateMetadata(githubDir, meta) + if err != nil { + return err + } + if len(issues) == 0 { + return nil + } + for _, issue := range issues { + fmt.Fprintln(os.Stderr, issue) + } + return fmt.Errorf("found %d issues in %s", len(issues), filename) +} + +type updateUrlsCmd struct{} + +func (c *updateUrlsCmd) Run(root *rootCmd) error { + githubDir, err := root.githubDir() + if err != nil { + return err + } + _, meta, err := root.metadata() + if err != nil { + return err + } + err = internal.UpdateDocLinks(meta, githubDir) + return err +} + +type unusedOpsCmd struct { + JSON bool `kong:"help='Output JSON.'"` +} + +func (c *unusedOpsCmd) Run(root *rootCmd) error { + _, meta, err := root.metadata() + if err != nil { + return err + } + var unused []*internal.Operation + for _, op := range meta.Operations { + if len(op.GoMethods) == 0 { + unused = append(unused, op) + } + } + if c.JSON { + enc := json.NewEncoder(os.Stdout) + enc.SetIndent("", " ") + return enc.Encode(unused) + } + fmt.Printf("Found %d unused operations\n", len(unused)) + if len(unused) == 0 { + return nil + } + fmt.Println("") + for _, op := range unused { + fmt.Printf("%s %s\n", op.Method(), op.EndpointURL()) + fmt.Printf("summary: %s\n", op.Summary()) + fmt.Printf("plans: %s\n", strings.Join(op.Plans(), ", ")) + fmt.Printf("doc: %s\n", op.DocumentationURL()) + fmt.Println("") + } + return nil +} + +func main() { + var cmd rootCmd + k := kong.Parse(&cmd, helpVars) + err := k.Run() + k.FatalIfErrorf(err) +} diff --git a/update-urls/activity-events_test.go b/update-urls/activity-events_test.go deleted file mode 100644 index 10dce865b29..00000000000 --- a/update-urls/activity-events_test.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2020 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 main - -import ( - _ "embed" - "strings" - "testing" -) - -func newActivitiesEventsPipeline() *pipelineSetup { - return &pipelineSetup{ - baseURL: "https://docs.github.com/en/rest/activity/events/", - endpointsFromWebsite: activityEventsWant, - filename: "activity_events.go", - serviceName: "ActivityService", - originalGoSource: strings.ReplaceAll(activityEventsGoFileOriginal, "\r", ""), - wantGoSource: strings.ReplaceAll(activityEventsGoFileWant, "\r", ""), - wantNumEndpoints: 7, - } -} - -func TestPipeline_ActivityEvents(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, false, false) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstStripAllURLs(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, true, false) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstDestroyReceivers(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, false, true) - ps.validate(t) -} - -func TestPipeline_ActivityEvents_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { - ps := newActivitiesEventsPipeline() - ps.setup(t, true, true) - ps.validate(t) -} - -func TestParseWebPageEndpoints_ActivityEvents(t *testing.T) { - got := parseWebPageEndpoints(activityEventsTestWebPage) - testWebPageHelper(t, got, activityEventsWant) -} - -var activityEventsWant = endpointsByFragmentID{ - "list-public-events": []*Endpoint{ - {urlFormats: []string{"events"}, httpMethod: "GET"}, - }, - - "list-repository-events": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-for-a-network-of-repositories": []*Endpoint{ - {urlFormats: []string{"networks/%v/%v/events"}, httpMethod: "GET"}, - }, - - "list-events-received-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/received_events"}, httpMethod: "GET"}, - }, - - "list-events-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-for-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events/public"}, httpMethod: "GET"}, - }, - - "list-organization-events-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"users/%v/events/orgs/%v"}, httpMethod: "GET"}, - }, - - "list-public-organization-events": []*Endpoint{ - {urlFormats: []string{"orgs/%v/events"}, httpMethod: "GET"}, - }, - - "list-public-events-received-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/received_events/public"}, httpMethod: "GET"}, - }, - - // Updated docs - consolidated into single page. - - "delete-a-thread-subscription": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "DELETE"}, - }, - - "mark-notifications-as-read": []*Endpoint{ - {urlFormats: []string{"notifications"}, httpMethod: "PUT"}, - }, - - "set-a-thread-subscription": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "PUT"}, - }, - - "delete-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "DELETE"}, - }, - - "star-a-repository-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "PUT"}, - }, - - "list-repositories-starred-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred"}, httpMethod: "GET"}, - }, - - "list-watchers": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscribers"}, httpMethod: "GET"}, - }, - - "get-feeds": []*Endpoint{ - {urlFormats: []string{"feeds"}, httpMethod: "GET"}, - }, - - "get-a-thread": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v"}, httpMethod: "GET"}, - }, - - "mark-a-thread-as-read": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v"}, httpMethod: "PATCH"}, - }, - - "list-stargazers": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/stargazers"}, httpMethod: "GET"}, - }, - - "list-repositories-watched-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/subscriptions"}, httpMethod: "GET"}, - }, - - "list-repository-notifications-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/notifications"}, httpMethod: "GET"}, - }, - - "mark-repository-notifications-as-read": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/notifications"}, httpMethod: "PUT"}, - }, - - "check-if-a-repository-is-starred-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "GET"}, - }, - - "list-notifications-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"notifications"}, httpMethod: "GET"}, - }, - - "get-a-thread-subscription-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"notifications/threads/%v/subscription"}, httpMethod: "GET"}, - }, - - "unstar-a-repository-for-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/starred/%v/%v"}, httpMethod: "DELETE"}, - }, - - "list-repositories-watched-by-the-authenticated-user": []*Endpoint{ - {urlFormats: []string{"user/subscriptions"}, httpMethod: "GET"}, - }, - - "get-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "GET"}, - }, - - "set-a-repository-subscription": []*Endpoint{ - {urlFormats: []string{"repos/%v/%v/subscription"}, httpMethod: "PUT"}, - }, - - "list-repositories-starred-by-a-user": []*Endpoint{ - {urlFormats: []string{"users/%v/starred"}, httpMethod: "GET"}, - }, -} - -//go:embed testdata/activity-events.html -var activityEventsTestWebPage string - -//go:embed testdata/activity_events-original.go -var activityEventsGoFileOriginal string - -//go:embed testdata/activity_events-want.go -var activityEventsGoFileWant string diff --git a/update-urls/go.mod b/update-urls/go.mod deleted file mode 100644 index 8fcf97b0614..00000000000 --- a/update-urls/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/google/go-github/v55/update-urls - -go 1.16 - -require ( - github.com/google/go-cmp v0.5.9 - github.com/pmezard/go-difflib v1.0.0 -) diff --git a/update-urls/go.sum b/update-urls/go.sum deleted file mode 100644 index 915dea3a949..00000000000 --- a/update-urls/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/update-urls/main.go b/update-urls/main.go deleted file mode 100644 index 77938be6de7..00000000000 --- a/update-urls/main.go +++ /dev/null @@ -1,1352 +0,0 @@ -// Copyright 2020 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. - -// update-urls updates GitHub URL docs for each service endpoint. -// -// It is meant to be used periodically by go-github repo maintainers -// to update stale GitHub Developer v3 API documentation URLs. -// -// Usage (from go-github directory): -// -// go run ./update-urls/main.go -// go generate ./... -// go test ./... -// go vet ./... -// -// When confronted with "PLEASE CHECK MANUALLY AND FIX", the problematic -// URL needs to be debugged. To debug a specific file, run like this: -// -// go run ./update-urls/main.go -v -d enterprise_actions_runners.go -package main - -import ( - "errors" - "flag" - "fmt" - "go/ast" - "go/parser" - "go/token" - "io" - "log" - "net/http" - "os" - "regexp" - "sort" - "strings" - "time" - - "github.com/google/go-cmp/cmp" -) - -const ( - codeLegacySplitString = `` - codeSplitString = `await octokit.request('` - skipPrefix = "gen-" - - // enterpriseURL = "docs.github.com" - stdURL = "docs.github.com" - - enterpriseRefFmt = "// GitHub Enterprise API docs: %v" - stdRefFmt = "// GitHub API docs: %v" - - httpGetDelay = 1 * time.Second -) - -var ( - verbose = flag.Bool("v", false, "Print verbose log messages") - debugFile = flag.String("d", "", "Debug named file only") - - fragmentIDStringRE = regexp.MustCompile(`

]*id="`) - stripHTMLRE = regexp.MustCompile(`<\/?[^>]+\/?>`) - condenseWhitespaceRE = regexp.MustCompile(`\s+`) - - // skipMethods holds methods which are skipped because they do not have GitHub v3 - // API URLs or are otherwise problematic in parsing, discovering, and/or fixing. - skipMethods = map[string]bool{ - "ActionsService.DownloadArtifact": true, - "AdminService.CreateOrg": true, - "AdminService.CreateUser": true, - "AdminService.CreateUserImpersonation": true, - "AdminService.DeleteUserImpersonation": true, - "AdminService.GetAdminStats": true, - "AdminService.RenameOrg": true, - "AdminService.RenameOrgByName": true, - "AdminService.UpdateTeamLDAPMapping": true, - "AdminService.UpdateUserLDAPMapping": true, - "AppsService.CreateAttachment": true, - "AppsService.FindRepositoryInstallationByID": true, - "AuthorizationsService.CreateImpersonation": true, - "AuthorizationsService.DeleteImpersonation": true, - "IssueImportService.CheckStatus": true, - "IssueImportService.CheckStatusSince": true, - "IssueImportService.Create": true, - "MarketplaceService.marketplaceURI": true, - "MigrationService.UserMigrationArchiveURL": true, - "OrganizationsService.GetByID": true, - "RepositoriesService.CompareCommits": true, - "RepositoriesService.CompareCommitsRaw": true, - "RepositoriesService.DeletePreReceiveHook": true, - "RepositoriesService.DownloadContents": true, - "RepositoriesService.DownloadContentsWithMeta": true, - "RepositoriesService.GetArchiveLink": true, - "RepositoriesService.GetByID": true, - "RepositoriesService.GetPreReceiveHook": true, - "RepositoriesService.ListPreReceiveHooks": true, - "RepositoriesService.UpdatePreReceiveHook": true, - "SearchService.search": true, - "TeamsService.ListTeamMembersByID": true, - "UsersService.DemoteSiteAdmin": true, - "UsersService.GetByID": true, - "UsersService.PromoteSiteAdmin": true, - "UsersService.Suspend": true, - "UsersService.Unsuspend": true, - } - - helperOverrides = map[string]overrideFunc{ - "s.search": func(arg string) (httpMethod, url string) { - return "GET", fmt.Sprintf("search/%v", arg) - }, - } - - // methodOverrides contains overrides for troublesome endpoints. - methodOverrides = map[string]string{ - "OrganizationsService.EditOrgMembership: method orgs/%v/memberships/%v": "PUT", - "OrganizationsService.EditOrgMembership: PUT user/memberships/orgs/%v": "PATCH", - } - - paramLegacyRE = regexp.MustCompile(`:[a-z_]+`) - paramRE = regexp.MustCompile(`{[a-z_]+}`) -) - -type overrideFunc func(arg string) (httpMethod, url string) - -func logf(fmt string, args ...interface{}) { - if *verbose { - log.Printf(fmt, args...) - } -} - -type servicesMap map[string]*Service -type endpointsMap map[string]*Endpoint - -func main() { - flag.Parse() - fset := token.NewFileSet() - - sourceFilter := func(fi os.FileInfo) bool { - return !strings.HasSuffix(fi.Name(), "_test.go") && !strings.HasPrefix(fi.Name(), skipPrefix) - } - - if err := os.Chdir("./github"); err != nil { - if err := os.Chdir("../github"); err != nil { - log.Fatalf("Please run this from the go-github directory.") - } - } - - pkgs, err := parser.ParseDir(fset, ".", sourceFilter, parser.ParseComments) - if err != nil { - log.Fatal(err) - } - - // Step 1 - get a map of all services. - services := findAllServices(pkgs) - - // Step 2 - find all the API service endpoints. - iter := &realAstFileIterator{fset: fset, pkgs: pkgs} - endpoints, err := findAllServiceEndpoints(iter, services) - if err != nil { - log.Fatalf("\n%v", err) - } - - // Step 3 - resolve all missing httpMethods from helperMethods. - // Additionally, use existing URLs as hints to pre-cache all apiDocs. - docCache := &documentCache{positioner: iter} - usedHelpers, endpointsByFilename := resolveHelpersAndCacheDocs(endpoints, docCache) - - // Step 4 - validate and rewrite all URLs, skipping used helper methods. - frw := &liveFileRewriter{fset: fset} - validateRewriteURLs(usedHelpers, endpointsByFilename, docCache, frw) - - logf("Done.") -} - -type usedHelpersMap map[string]bool -type endpointsByFilenameMap map[string][]*Endpoint - -// FileRewriter read/writes files and converts AST token positions. -type FileRewriter interface { - Position(token.Pos) token.Position - ReadFile(filename string) ([]byte, error) - WriteFile(filename string, buf []byte, mode os.FileMode) error -} - -// liveFileRewriter implements FileRewriter. -type liveFileRewriter struct { - fset *token.FileSet -} - -func (lfr *liveFileRewriter) Position(pos token.Pos) token.Position { return lfr.fset.Position(pos) } -func (lfr *liveFileRewriter) ReadFile(filename string) ([]byte, error) { - return os.ReadFile(filename) -} -func (lfr *liveFileRewriter) WriteFile(filename string, buf []byte, mode os.FileMode) error { - return os.WriteFile(filename, buf, mode) -} - -func validateRewriteURLs(usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap, docCache documentCacheReader, fileRewriter FileRewriter) { - for filename, slc := range endpointsByFilename { - logf("Step 4 - Processing %v methods in %v ...", len(slc), filename) - - var fileEdits []*FileEdit - for _, endpoint := range slc { - fullName := fmt.Sprintf("%v.%v", endpoint.serviceName, endpoint.endpointName) - if usedHelpers[fullName] { - logf("Step 4 - skipping used helper method %q", fullName) - continue - } - - // First, find the correct GitHub v3 API URL by httpMethod and urlFormat. - for _, path := range endpoint.urlFormats { - path = strings.ReplaceAll(path, "%d", "%v") - path = strings.ReplaceAll(path, "%s", "%v") - - // Check the overrides. - endpoint.checkHTTPMethodOverride(path) - - methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path) - url, ok := docCache.URLByMethodAndPath(methodAndPath) - if !ok { - if i := len(endpoint.endpointComments); i > 0 { - pos := fileRewriter.Position(endpoint.endpointComments[i-1].Pos()) - fmt.Printf("%v:%v:%v: WARNING: unable to find online docs for %q: (%v)\nPLEASE CHECK MANUALLY AND FIX.\n", pos.Filename, pos.Line, pos.Column, fullName, methodAndPath) - } else { - fmt.Printf("%v: WARNING: unable to find online docs for %q: (%v)\nPLEASE CHECK MANUALLY AND FIX.\n", filename, fullName, methodAndPath) - } - continue - } - logf("found %q for: %q (%v)", url, fullName, methodAndPath) - - // Make sure URL is up-to-date. - switch { - case len(endpoint.enterpriseRefLines) > 1: - log.Printf("WARNING: multiple Enterprise GitHub URLs found - skipping:") - for i, refLine := range endpoint.enterpriseRefLines { - log.Printf("line %v: %#v", i, refLine) - } - case len(endpoint.enterpriseRefLines) > 0: - line := fmt.Sprintf(enterpriseRefFmt, url) - cmt := endpoint.enterpriseRefLines[0] - if cmt.Text != line { - pos := fileRewriter.Position(cmt.Pos()) - logf("At byte offset %v:\nFOUND %q\nWANT: %q", pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - } - case len(endpoint.stdRefLines) > 1: - var foundMatch bool - line := fmt.Sprintf(stdRefFmt, url) - for i, stdRefLine := range endpoint.stdRefLines { - if stdRefLine.Text == line { - foundMatch = true - logf("found match with %v, not editing and removing from list", line) - // Remove matching line - endpoint.stdRefLines = append(endpoint.stdRefLines[:i], endpoint.stdRefLines[i+1:]...) - break - } - } - if !foundMatch { // Edit last stdRefLine, then remove it. - cmt := endpoint.stdRefLines[len(endpoint.stdRefLines)-1] - pos := fileRewriter.Position(cmt.Pos()) - logf("stdRefLines=%v: At byte offset %v:\nFOUND %q\nWANT: %q", len(endpoint.stdRefLines), pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - endpoint.stdRefLines = endpoint.stdRefLines[:len(endpoint.stdRefLines)-1] - } - case len(endpoint.stdRefLines) > 0: - line := fmt.Sprintf(stdRefFmt, url) - cmt := endpoint.stdRefLines[0] - if cmt.Text != line { - pos := fileRewriter.Position(cmt.Pos()) - logf("stdRefLines=1: At byte offset %v:\nFOUND %q\nWANT: %q", pos.Offset, cmt.Text, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: cmt.Text, - toText: line, - }) - } - endpoint.stdRefLines = nil - case len(endpoint.endpointComments) > 0: - lastCmt := endpoint.endpointComments[len(endpoint.endpointComments)-1] - // logf("lastCmt.Text=%q (len=%v)", lastCmt.Text, len(lastCmt.Text)) - pos := fileRewriter.Position(lastCmt.Pos()) - pos.Offset += len(lastCmt.Text) - line := "\n" + fmt.Sprintf(stdRefFmt, url) - if lastCmt.Text != "//" { - line = "\n//" + line // Add blank comment line before URL. - } - // logf("line=%q (len=%v)", line, len(line)) - // logf("At byte offset %v: adding missing documentation:\n%q", pos.Offset, line) - fileEdits = append(fileEdits, &FileEdit{ - pos: pos, - fromText: "", - toText: line, - }) - default: // Missing documentation - add it. - log.Printf("WARNING: file %v has no godoc comment string for method %v", fullName, methodAndPath) - } - } - } - - if len(fileEdits) > 0 { - b, err := fileRewriter.ReadFile(filename) - if err != nil { - log.Fatalf("ReadFile: %v", err) - } - - log.Printf("Performing %v edits on file %v", len(fileEdits), filename) - b = performBufferEdits(b, fileEdits) - - if err := fileRewriter.WriteFile(filename, b, 0644); err != nil { - log.Fatalf("WriteFile: %v", err) - } - } - } -} - -func performBufferEdits(b []byte, fileEdits []*FileEdit) []byte { - fileEdits = sortAndMergeFileEdits(fileEdits) - - for _, edit := range fileEdits { - prelude := b[0:edit.pos.Offset] - postlude := b[edit.pos.Offset+len(edit.fromText):] - logf("At byte offset %v, replacing %v bytes with %v bytes\nBEFORE: %v\nAFTER : %v", edit.pos.Offset, len(edit.fromText), len(edit.toText), edit.fromText, edit.toText) - b = []byte(fmt.Sprintf("%s%v%s", prelude, edit.toText, postlude)) - } - - return b -} - -func sortAndMergeFileEdits(fileEdits []*FileEdit) []*FileEdit { - // Sort edits from last to first in the file. - // If the offsets are identical, sort the comment "toText" strings, ascending. - var foundDups bool - sort.Slice(fileEdits, func(a, b int) bool { - if fileEdits[a].pos.Offset == fileEdits[b].pos.Offset { - foundDups = true - return fileEdits[a].toText < fileEdits[b].toText - } - return fileEdits[a].pos.Offset > fileEdits[b].pos.Offset - }) - - if !foundDups { - return fileEdits - } - - // Merge the duplicate edits. - var mergedEdits []*FileEdit - var dupOffsets []*FileEdit - - mergeFunc := func() { - if len(dupOffsets) > 1 { - isInsert := dupOffsets[0].fromText == "" - var hasBlankCommentLine bool - - // Merge dups - var lines []string - for _, dup := range dupOffsets { - if isInsert && strings.HasPrefix(dup.toText, "\n//\n//") { - lines = append(lines, strings.TrimPrefix(dup.toText, "\n//")) - hasBlankCommentLine = true - } else { - lines = append(lines, dup.toText) - } - } - sort.Strings(lines) - - var joinStr string - // if insert, no extra newlines - if !isInsert { // if replacement - add newlines - joinStr = "\n" - } - toText := strings.Join(lines, joinStr) - if hasBlankCommentLine { // Add back in - toText = "\n//" + toText - } - mergedEdits = append(mergedEdits, &FileEdit{ - pos: dupOffsets[0].pos, - fromText: dupOffsets[0].fromText, - toText: toText, - }) - } else if len(dupOffsets) > 0 { - // Move non-dup to final output - mergedEdits = append(mergedEdits, dupOffsets[0]) - } - dupOffsets = nil - } - - lastOffset := -1 - for _, fileEdit := range fileEdits { - if fileEdit.pos.Offset != lastOffset { - mergeFunc() - } - dupOffsets = append(dupOffsets, fileEdit) - lastOffset = fileEdit.pos.Offset - } - mergeFunc() - return mergedEdits -} - -// astFileIterator iterates over all files in an ast.Package. -type astFileIterator interface { - // Finds the position of a token. - Position(token.Pos) token.Position - // Reset resets the iterator. - Reset() - // Next returns the next filenameAstFilePair pair or nil if done. - Next() *filenameAstFilePair -} - -type filenameAstFilePair struct { - filename string - astFile *ast.File -} - -// realAstFileIterator implements astFileIterator. -type realAstFileIterator struct { - fset *token.FileSet - pkgs map[string]*ast.Package - ch chan *filenameAstFilePair - closed bool -} - -func (rafi *realAstFileIterator) Position(pos token.Pos) token.Position { - return rafi.fset.Position(pos) -} - -func (rafi *realAstFileIterator) Reset() { - if !rafi.closed && rafi.ch != nil { - logf("Closing old channel on Reset") - close(rafi.ch) - } - rafi.ch = make(chan *filenameAstFilePair, 10) - rafi.closed = false - - go func() { - var count int - for _, pkg := range rafi.pkgs { - for filename, f := range pkg.Files { - // logf("Sending file #%v: %v to channel", count, filename) - rafi.ch <- &filenameAstFilePair{filename: filename, astFile: f} - count++ - } - } - rafi.closed = true - close(rafi.ch) - logf("Closed channel after sending %v files", count) - if count == 0 { - log.Fatalf("Processed no files. Did you run this from the go-github directory?") - } - }() -} - -func (rafi *realAstFileIterator) Next() *filenameAstFilePair { - for pair := range rafi.ch { - // logf("Next: returning file %v", pair.filename) - return pair - } - return nil -} - -func findAllServices(pkgs map[string]*ast.Package) servicesMap { - services := servicesMap{} - for _, pkg := range pkgs { - for filename, f := range pkg.Files { - if filename != "github.go" { - continue - } - - logf("Step 1 - Processing %v ...", filename) - if err := findClientServices(f, services); err != nil { - log.Fatal(err) - } - } - } - return services -} - -func findAllServiceEndpoints(iter astFileIterator, services servicesMap) (endpointsMap, error) { - endpoints := endpointsMap{} - iter.Reset() - var errs []string // Collect all the errors and return in a big batch. - for next := iter.Next(); next != nil; next = iter.Next() { - filename, f := next.filename, next.astFile - if filename == "github.go" { - continue - } - - if *debugFile != "" && !strings.Contains(filename, *debugFile) { - continue - } - - logf("Step 2 - Processing %v ...", filename) - if err := processAST(filename, f, services, endpoints, iter); err != nil { - errs = append(errs, err.Error()) - } - } - - if len(errs) > 0 { - return nil, errors.New(strings.Join(errs, "\n")) - } - - return endpoints, nil -} - -func resolveHelpersAndCacheDocs(endpoints endpointsMap, docCache documentCacheWriter) (usedHelpers usedHelpersMap, endpointsByFilename endpointsByFilenameMap) { - logf("Step 3 - resolving helpers and cache docs ...") - usedHelpers = usedHelpersMap{} - endpointsByFilename = endpointsByFilenameMap{} - for k, v := range endpoints { - if _, ok := endpointsByFilename[v.filename]; !ok { - endpointsByFilename[v.filename] = []*Endpoint{} - } - endpointsByFilename[v.filename] = append(endpointsByFilename[v.filename], v) - - for _, cmt := range v.enterpriseRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) - } - for _, cmt := range v.stdRefLines { - docCache.CacheDocFromInternet(cmt.Text, v.filename, docCache.Position(cmt.Pos())) - } - - if v.httpMethod == "" && v.helperMethod != "" { - fullName := fmt.Sprintf("%v.%v", v.serviceName, v.helperMethod) - hm, ok := endpoints[fullName] - if !ok { - log.Fatalf("Unable to find helper method %q for %q", fullName, k) - } - if hm.httpMethod == "" { - log.Fatalf("Helper method %q for %q has empty httpMethod: %#v", fullName, k, hm) - } - v.httpMethod = hm.httpMethod - usedHelpers[fullName] = true - } - } - - return usedHelpers, endpointsByFilename -} - -type documentCacheReader interface { - URLByMethodAndPath(string) (string, bool) -} - -type documentCacheWriter interface { - CacheDocFromInternet(urlWithFragmentID, filename string, pos token.Position) - Position(token.Pos) token.Position -} - -type positioner interface { - Position(token.Pos) token.Position -} - -// documentCache implements documentCacheReader and documentCachWriter. -type documentCache struct { - apiDocs map[string]map[string][]*Endpoint // cached by URL, then mapped by web fragment identifier. - urlByMethodAndPath map[string]string - positioner positioner -} - -func (dc *documentCache) URLByMethodAndPath(methodAndPath string) (string, bool) { - url, ok := dc.urlByMethodAndPath[methodAndPath] - return url, ok -} - -func (dc *documentCache) CacheDocFromInternet(urlWithID, filename string, pos token.Position) { - if dc.apiDocs == nil { - dc.apiDocs = map[string]map[string][]*Endpoint{} // cached by URL, then mapped by web fragment identifier. - dc.urlByMethodAndPath = map[string]string{} - } - - baseURL, fullURL := getURL(urlWithID) - if _, ok := dc.apiDocs[baseURL]; ok { - return // already cached - } - - logf("GET %q ...", fullURL) - time.Sleep(httpGetDelay) - //nolint:gosec // G107: Potential HTTP request made with variable url - resp, err := http.Get(fullURL) - check("Unable to get URL: %v: %v", fullURL, err) - switch resp.StatusCode { - case http.StatusTooManyRequests, http.StatusServiceUnavailable: - logf("Sleeping 60 seconds and trying again...") - time.Sleep(60 * time.Second) - //nolint:gosec // G107: Potential HTTP request made with variable url - resp, err = http.Get(fullURL) - check("Unable to get URL: %v: %v", fullURL, err) - case http.StatusOK: - default: - log.Fatalf("url %v - StatusCode=%v\ngithub/%v:%v:%v %v", fullURL, resp.StatusCode, filename, pos.Line, pos.Column, urlWithID) - } - - finalURL := resp.Request.URL.String() - baseURL, fullURL = getURL(finalURL) - url := baseURL - logf("urlWithID: %v ; finalURL: %v ; baseURL: %v, fullURL: %v", urlWithID, finalURL, baseURL, fullURL) - - b, err := io.ReadAll(resp.Body) - check("Unable to read body of URL: %v, %v", url, err) - check("Unable to close body of URL: %v, %v", url, resp.Body.Close()) - dc.apiDocs[url] = parseWebPageEndpoints(string(b)) - check("Unable to parse web page endpoints: url: %v, filename: %v, err: %v", url, filename, err) - logf("Found %v web page fragment identifiers.", len(dc.apiDocs[url])) - if len(dc.apiDocs[url]) == 0 { - logf("webage text: %s", b) - } - - // Now reverse-map the methods+paths to URLs. - for fragID, v := range dc.apiDocs[url] { - logf("For fragID=%q, found %v endpoints.", fragID, len(v)) - for _, endpoint := range v { - logf("For fragID=%q, endpoint=%q, found %v paths.", fragID, endpoint, len(endpoint.urlFormats)) - for _, path := range endpoint.urlFormats { - methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path) - dc.urlByMethodAndPath[methodAndPath] = fmt.Sprintf("%v#%v", strings.TrimRight(url, "/"), fragID) - logf("urlByMethodAndPath[%q] = %q", methodAndPath, dc.urlByMethodAndPath[methodAndPath]) - } - } - } -} - -func (dc *documentCache) Position(pos token.Pos) token.Position { - return dc.positioner.Position(pos) -} - -// FileEdit represents an edit that needs to be performed on a file. -type FileEdit struct { - pos token.Position - fromText string - toText string -} - -func getURL(s string) (baseURL, fullURL string) { - i := strings.Index(s, "http") - if i < 0 { - return "", "" - } - j := strings.Index(s, "#") - if j < i { - if !strings.HasSuffix(s, "/") { // Prevent unnecessary redirects if possible. - s += "/" - } - baseURL = s[i:] - fullURL = s[i:] - } else { - fullURL = s[i:] - baseURL = s[i:j] - if !strings.HasSuffix(baseURL, "/") { // Prevent unnecessary redirects if possible. - baseURL += "/" - } - } - return baseURL, fullURL -} - -// Service represents a go-github service. -type Service struct { - serviceName string -} - -// Endpoint represents an API endpoint in this repo. -type Endpoint struct { - endpointName string - filename string - serviceName string - urlFormats []string - httpMethod string - helperMethod string // If populated, httpMethod lives in helperMethod. - - enterpriseRefLines []*ast.Comment - stdRefLines []*ast.Comment - endpointComments []*ast.Comment -} - -// String helps with debugging by providing an easy-to-read summary of the endpoint. -func (e *Endpoint) String() string { - if e == nil { - return "Endpoint{nil}" - } - var b strings.Builder - if e.filename != "" { - b.WriteString(fmt.Sprintf(" filename: %v\n", e.filename)) - } - if e.serviceName != "" { - b.WriteString(fmt.Sprintf(" serviceName: %v\n", e.serviceName)) - } - if e.endpointName != "" { - b.WriteString(fmt.Sprintf(" endpointName: %v\n", e.endpointName)) - } - b.WriteString(fmt.Sprintf(" httpMethod: %v\n", e.httpMethod)) - if e.helperMethod != "" { - b.WriteString(fmt.Sprintf(" helperMethod: %v\n", e.helperMethod)) - } - for i := 0; i < len(e.urlFormats); i++ { - b.WriteString(fmt.Sprintf(" urlFormats[%v]: %v\n", i, e.urlFormats[i])) - } - for i := 0; i < len(e.enterpriseRefLines); i++ { - b.WriteString(fmt.Sprintf(" enterpriseRefLines[%v]: comment: %v\n", i, e.enterpriseRefLines[i].Text)) - } - for i := 0; i < len(e.stdRefLines); i++ { - b.WriteString(fmt.Sprintf(" stdRefLines[%v]: comment: %v\n", i, e.stdRefLines[i].Text)) - } - return b.String() -} - -func (e *Endpoint) checkHTTPMethodOverride(path string) { - lookupOverride := fmt.Sprintf("%v.%v: %v %v", e.serviceName, e.endpointName, e.httpMethod, path) - logf("Looking up override for %q", lookupOverride) - if v, ok := methodOverrides[lookupOverride]; ok { - logf("overriding method for %v to %q", lookupOverride, v) - e.httpMethod = v - return - } -} - -func processAST(filename string, f *ast.File, services servicesMap, endpoints endpointsMap, iter astFileIterator) error { - var errs []string - - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: // Doc, Recv, Name, Type, Body - if decl.Recv == nil || len(decl.Recv.List) != 1 || decl.Name == nil || decl.Body == nil { - continue - } - - recv := decl.Recv.List[0] - se, ok := recv.Type.(*ast.StarExpr) // Star, X - if !ok || se.X == nil || len(recv.Names) != 1 { - if decl.Name.Name != "String" && decl.Name.Name != "Equal" && decl.Name.Name != "IsPullRequest" { - pos := iter.Position(recv.Pos()) - if id, ok := recv.Type.(*ast.Ident); ok { - pos = iter.Position(id.Pos()) - } - errs = append(errs, fmt.Sprintf("%v:%v:%v: method %v does not use a pointer receiver and needs fixing!", pos.Filename, pos.Line, pos.Column, decl.Name)) - } - continue - } - recvType, ok := se.X.(*ast.Ident) // NamePos, Name, Obj - if !ok { - return fmt.Errorf("unhandled se.X = %T", se.X) - } - serviceName := recvType.Name - if _, ok := services[serviceName]; !ok { - continue - } - endpointName := decl.Name.Name - fullName := fmt.Sprintf("%v.%v", serviceName, endpointName) - if skipMethods[fullName] { - logf("skipping %v", fullName) - continue - } - - receiverName := recv.Names[0].Name - - logf("\n\nast.FuncDecl: %#v", *decl) // Doc, Recv, Name, Type, Body - logf("ast.FuncDecl.Name: %#v", *decl.Name) // NamePos, Name, Obj(nil) - // logf("ast.FuncDecl.Recv: %#v", *decl.Recv) // Opening, List, Closing - logf("ast.FuncDecl.Recv.List[0]: %#v", *recv) // Doc, Names, Type, Tag, Comment - // for i, name := range decl.Recv.List[0].Names { - // logf("recv.name[%v] = %v", i, name.Name) - // } - logf("recvType = %#v", recvType) - var enterpriseRefLines []*ast.Comment - var stdRefLines []*ast.Comment - var endpointComments []*ast.Comment - if decl.Doc != nil { - endpointComments = decl.Doc.List - for i, comment := range decl.Doc.List { - logf("doc.comment[%v] = %#v", i, *comment) - // if strings.Contains(comment.Text, enterpriseURL) { - // enterpriseRefLines = append(enterpriseRefLines, comment) - // } else - if strings.Contains(comment.Text, stdURL) { - stdRefLines = append(stdRefLines, comment) - } - } - logf("%v comment lines, %v enterprise URLs, %v standard URLs", len(decl.Doc.List), len(enterpriseRefLines), len(stdRefLines)) - } - - bd := &bodyData{receiverName: receiverName} - if err := bd.parseBody(decl.Body); err != nil { // Lbrace, List, Rbrace - return fmt.Errorf("parseBody: %v", err) - } - - ep := &Endpoint{ - endpointName: endpointName, - filename: filename, - serviceName: serviceName, - urlFormats: bd.urlFormats, - httpMethod: bd.httpMethod, - helperMethod: bd.helperMethod, - enterpriseRefLines: enterpriseRefLines, - stdRefLines: stdRefLines, - endpointComments: endpointComments, - } - // ep.checkHTTPMethodOverride("") - endpoints[fullName] = ep - logf("endpoints[%q] = %#v", fullName, endpoints[fullName]) - if ep.httpMethod == "" && (ep.helperMethod == "" || len(ep.urlFormats) == 0) { - return fmt.Errorf("filename=%q, endpoint=%q: could not find body info: %#v", filename, fullName, *ep) - } - case *ast.GenDecl: - default: - return fmt.Errorf("unhandled decl type: %T", decl) - } - } - - if len(errs) > 0 { - return errors.New(strings.Join(errs, "\n")) - } - - return nil -} - -// bodyData contains information found in a BlockStmt. -type bodyData struct { - receiverName string // receiver name of method to help identify helper methods. - httpMethod string - urlVarName string - urlFormats []string - assignments []lhsrhs - helperMethod string // If populated, httpMethod lives in helperMethod. -} - -func (b *bodyData) parseBody(body *ast.BlockStmt) error { - logf("body=%#v", *body) - - // Find the variable used for the format string, its one-or-more values, - // and the httpMethod used for the NewRequest. - for _, stmt := range body.List { - switch stmt := stmt.(type) { - case *ast.AssignStmt: - hm, uvn, hlp, asgn := processAssignStmt(b.receiverName, stmt) - if b.httpMethod != "" && hm != "" && b.httpMethod != hm { - return fmt.Errorf("found two httpMethod values: %q and %q", b.httpMethod, hm) - } - if hm != "" { - b.httpMethod = hm - // logf("parseBody: httpMethod=%v", b.httpMethod) - } - if hlp != "" { - b.helperMethod = hlp - } - b.assignments = append(b.assignments, asgn...) - // logf("assignments=%#v", b.assignments) - if b.urlVarName == "" && uvn != "" { - b.urlVarName = uvn - // logf("parseBody: urlVarName=%v", b.urlVarName) - // By the time the urlVarName is found, all assignments should - // have already taken place so that we can find the correct - // ones and determine the urlFormats. - for _, lr := range b.assignments { - if lr.lhs == b.urlVarName { - b.urlFormats = append(b.urlFormats, lr.rhs) - logf("found urlFormat: %v", lr.rhs) - } - } - } - case *ast.DeclStmt: - logf("*ast.DeclStmt: %#v", *stmt) - case *ast.DeferStmt: - logf("*ast.DeferStmt: %#v", *stmt) - case *ast.ExprStmt: - logf("*ast.ExprStmt: %#v", *stmt) - case *ast.IfStmt: - if err := b.parseIf(stmt); err != nil { - return err - } - case *ast.RangeStmt: - logf("*ast.RangeStmt: %#v", *stmt) - case *ast.ReturnStmt: // Return Results - logf("*ast.ReturnStmt: %#v", *stmt) - if len(stmt.Results) > 0 { - switch rslt0 := stmt.Results[0].(type) { - case *ast.CallExpr: - recv, funcName, args := processCallExpr(rslt0) - logf("return CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - // If the httpMethod has not been found at this point, but - // this method is calling a helper function, then see if - // any of its arguments match a previous assignment, then - // record the urlFormat and remember the helper method. - if b.httpMethod == "" && len(args) > 1 && recv == b.receiverName { - if args[0] != "ctx" { - return fmt.Errorf("expected helper function to get ctx as first arg: %#v, %#v", args, *b) - } - if len(b.assignments) == 0 && len(b.urlFormats) == 0 { - b.urlFormats = append(b.urlFormats, strings.Trim(args[1], `"`)) - b.helperMethod = funcName - switch b.helperMethod { - case "deleteReaction": - b.httpMethod = "DELETE" - default: - logf("WARNING: helper method %q not found", b.helperMethod) - } - logf("found urlFormat: %v and helper method: %v, httpMethod: %v", b.urlFormats[0], b.helperMethod, b.httpMethod) - } else { - for _, lr := range b.assignments { - if lr.lhs == args[1] { // Multiple matches are possible. Loop over all assignments. - b.urlVarName = args[1] - b.urlFormats = append(b.urlFormats, lr.rhs) - b.helperMethod = funcName - switch b.helperMethod { - case "deleteReaction": - b.httpMethod = "DELETE" - default: - logf("WARNING: helper method %q not found", b.helperMethod) - } - logf("found urlFormat: %v and helper method: %v, httpMethod: %v", lr.rhs, b.helperMethod, b.httpMethod) - } - } - } - } - default: - logf("WARNING: stmt.Results[0] unhandled type = %T = %#v", stmt.Results[0], stmt.Results[0]) - } - } - case *ast.SwitchStmt: - logf("*ast.SwitchStmt: %#v", *stmt) - default: - return fmt.Errorf("unhandled stmt type: %T", stmt) - } - } - logf("parseBody: assignments=%#v", b.assignments) - - return nil -} - -func (b *bodyData) parseIf(stmt *ast.IfStmt) error { - logf("parseIf: *ast.IfStmt: %#v", *stmt) - if err := b.parseBody(stmt.Body); err != nil { - return err - } - logf("parseIf: if body: b=%#v", *b) - if stmt.Else != nil { - switch els := stmt.Else.(type) { - case *ast.BlockStmt: - if err := b.parseBody(els); err != nil { - return err - } - logf("parseIf: if else: b=%#v", *b) - case *ast.IfStmt: - if err := b.parseIf(els); err != nil { - return err - } - default: - return fmt.Errorf("unhandled else stmt type %T", els) - } - } - - return nil -} - -// lhsrhs represents an assignment with a variable name on the left -// and a string on the right - used to find the URL format string. -type lhsrhs struct { - lhs string - rhs string -} - -func processAssignStmt(receiverName string, stmt *ast.AssignStmt) (httpMethod, urlVarName, helperMethod string, assignments []lhsrhs) { - logf("*ast.AssignStmt: %#v", *stmt) // Lhs, TokPos, Tok, Rhs - var lhs []string - for _, expr := range stmt.Lhs { - switch expr := expr.(type) { - case *ast.Ident: // NamePos, Name, Obj - logf("processAssignStmt: *ast.Ident: %#v", expr) - lhs = append(lhs, expr.Name) - case *ast.SelectorExpr: // X, Sel - logf("processAssignStmt: *ast.SelectorExpr: %#v", expr) - default: - log.Fatalf("unhandled AssignStmt Lhs type: %T", expr) - } - } - - for i, expr := range stmt.Rhs { - switch expr := expr.(type) { - case *ast.BasicLit: // ValuePos, Kind, Value - v := strings.Trim(expr.Value, `"`) - if !strings.HasPrefix(v, "?") { // Hack to remove "?recursive=1" - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: v}) - } - case *ast.BinaryExpr: - logf("processAssignStmt: *ast.BinaryExpr: %#v", *expr) - case *ast.CallExpr: // Fun, Lparen, Args, Ellipsis, Rparen - recv, funcName, args := processCallExpr(expr) - logf("processAssignStmt: CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - switch funcName { - case "addOptions": - if v := strings.Trim(args[0], `"`); v != args[0] { - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: v}) - urlVarName = lhs[i] - } else { - urlVarName = args[0] - } - case "Sprintf": - assignments = append(assignments, lhsrhs{lhs: lhs[i], rhs: strings.Trim(args[0], `"`)}) - case "NewRequest": - httpMethod = strings.Trim(args[0], `"`) - urlVarName = args[1] - case "NewUploadRequest": - httpMethod = "POST" - urlVarName = args[0] - case "roundTripWithOptionalFollowRedirect": - httpMethod = "GET" - urlVarName = args[1] - default: - logf("WARNING: processAssignStmt: unhandled CallExpr: recv=%q, funcName=%q, args=%#v", recv, funcName, args) - } - if recv == receiverName && len(args) > 1 && args[0] == "ctx" { // This might be a helper method. - fullName := fmt.Sprintf("%v.%v", recv, funcName) - logf("checking for override: fullName=%v", fullName) - if fn, ok := helperOverrides[fullName]; ok { - logf("found helperOverride for %v", fullName) - hm, url := fn(strings.Trim(args[1], `"`)) - httpMethod = hm - urlVarName = "u" // arbitrary - assignments = []lhsrhs{{lhs: urlVarName, rhs: url}} - } else { - urlVarName = args[1] // For this to work correctly, the URL must be the second arg to the helper method! - helperMethod = funcName - logf("found possible helper method: funcName=%v, urlVarName=%v", funcName, urlVarName) - } - } - case *ast.CompositeLit: // Type, Lbrace, Elts, Rbrace, Incomplete - logf("processAssignStmt: *ast.CompositeLit: %#v", *expr) - case *ast.FuncLit: - logf("processAssignStmt: *ast.FuncLit: %#v", *expr) - case *ast.SelectorExpr: - logf("processAssignStmt: *ast.SelectorExpr: %#v", *expr) - case *ast.UnaryExpr: // OpPos, Op, X - logf("processAssignStmt: *ast.UnaryExpr: %#v", *expr) - case *ast.TypeAssertExpr: // X, Lparen, Type, Rparen - logf("processAssignStmt: *ast.TypeAssertExpr: %#v", *expr) - case *ast.Ident: // NamePos, Name, Obj - logf("processAssignStmt: *ast.Ident: %#v", *expr) - default: - log.Fatalf("unhandled AssignStmt Rhs type: %T", expr) - } - } - logf("urlVarName=%v, assignments=%#v", urlVarName, assignments) - - return httpMethod, urlVarName, helperMethod, assignments -} - -func processCallExpr(expr *ast.CallExpr) (recv, funcName string, args []string) { - logf("*ast.CallExpr: %#v", *expr) - - for _, arg := range expr.Args { - switch arg := arg.(type) { - case *ast.ArrayType: - logf("processCallExpr: *ast.ArrayType: %#v", arg) - case *ast.BasicLit: // ValuePos, Kind, Value - args = append(args, arg.Value) // Do not trim quotes here so as to identify it later as a string literal. - case *ast.CallExpr: // Fun, Lparen, Args, Ellipsis, Rparen - logf("processCallExpr: *ast.CallExpr: %#v", arg) - r, fn, as := processCallExpr(arg) - if r == "fmt" && fn == "Sprintf" && len(as) > 0 { // Special case - return format string. - args = append(args, as[0]) - } - case *ast.CompositeLit: - logf("processCallExpr: *ast.CompositeLit: %#v", arg) // Type, Lbrace, Elts, Rbrace, Incomplete - case *ast.Ident: // NamePos, Name, Obj - args = append(args, arg.Name) - case *ast.MapType: - logf("processCallExpr: *ast.MapType: %#v", arg) - case *ast.SelectorExpr: // X, Sel - logf("processCallExpr: *ast.SelectorExpr: %#v", arg) - x, ok := arg.X.(*ast.Ident) - if ok { // special case - switch name := fmt.Sprintf("%v.%v", x.Name, arg.Sel.Name); name { - case "http.MethodGet": - args = append(args, http.MethodGet) - case "http.MethodHead": - args = append(args, http.MethodHead) - case "http.MethodPost": - args = append(args, http.MethodPost) - case "http.MethodPut": - args = append(args, http.MethodPut) - case "http.MethodPatch": - args = append(args, http.MethodPatch) - case "http.MethodDelete": - args = append(args, http.MethodDelete) - case "http.MethodConnect": - args = append(args, http.MethodConnect) - case "http.MethodOptions": - args = append(args, http.MethodOptions) - case "http.MethodTrace": - args = append(args, http.MethodTrace) - default: - args = append(args, name) - } - } - case *ast.StarExpr: - logf("processCallExpr: *ast.StarExpr: %#v", arg) - case *ast.StructType: - logf("processCallExpr: *ast.StructType: %#v", arg) - case *ast.UnaryExpr: // OpPos, Op, X - switch x := arg.X.(type) { - case *ast.Ident: - args = append(args, x.Name) - case *ast.CompositeLit: // Type, Lbrace, Elts, Rbrace, Incomplete - logf("processCallExpr: *ast.CompositeLit: %#v", x) - default: - log.Fatalf("processCallExpr: unhandled UnaryExpr.X arg type: %T", arg.X) - } - default: - log.Fatalf("processCallExpr: unhandled arg type: %T", arg) - } - } - - switch fun := expr.Fun.(type) { - case *ast.Ident: // NamePos, Name, Obj - funcName = fun.Name - case *ast.SelectorExpr: // X, Sel - funcName = fun.Sel.Name - switch x := fun.X.(type) { - case *ast.Ident: // NamePos, Name, Obj - logf("processCallExpr: X recv *ast.Ident=%#v", x) - recv = x.Name - case *ast.ParenExpr: - logf("processCallExpr: X recv *ast.ParenExpr: %#v", x) - case *ast.SelectorExpr: // X, Sel - logf("processCallExpr: X recv *ast.SelectorExpr: %#v", x.Sel) - recv = x.Sel.Name - case *ast.CallExpr: // Fun, LParen, Args, Ellipsis, RParen - logf("processCallExpr: X recv *ast.CallExpr: %#v", x) - default: - log.Fatalf("processCallExpr: unhandled X receiver type: %T, funcName=%q", x, funcName) - } - default: - log.Fatalf("processCallExpr: unhandled Fun: %T", expr.Fun) - } - - return recv, funcName, args -} - -// findClientServices finds all go-github services from the Client struct. -func findClientServices(f *ast.File, services servicesMap) error { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.GenDecl: - if decl.Tok != token.TYPE || len(decl.Specs) != 1 { - continue - } - ts, ok := decl.Specs[0].(*ast.TypeSpec) - if !ok || decl.Doc == nil || ts.Name == nil || ts.Type == nil || ts.Name.Name != "Client" { - continue - } - st, ok := ts.Type.(*ast.StructType) - if !ok || st.Fields == nil || len(st.Fields.List) == 0 { - continue - } - - for _, field := range st.Fields.List { - se, ok := field.Type.(*ast.StarExpr) - if !ok || se.X == nil || len(field.Names) != 1 { - continue - } - id, ok := se.X.(*ast.Ident) - if !ok { - continue - } - name := id.Name - if !strings.HasSuffix(name, "Service") { - continue - } - - services[name] = &Service{serviceName: name} - } - - return nil // Found all services in Client struct. - } - } - - return fmt.Errorf("unable to find Client struct in github.go") -} - -func check(fmtStr string, args ...interface{}) { - if err := args[len(args)-1]; err != nil { - log.Fatalf(fmtStr, args...) - } -} - -func endpointsEqual(a, b *Endpoint) bool { - if a == nil || b == nil { - return false - } - if a.httpMethod != b.httpMethod { - return false - } - return cmp.Equal(a.urlFormats, b.urlFormats) -} - -// parseWebPageEndpoints returns endpoint information, mapped by -// web page fragment identifier. -func parseWebPageEndpoints(buf string) map[string][]*Endpoint { - result := map[string][]*Endpoint{} - - // The GitHub v3 API web pages do not appear to be auto-generated - // and therefore, the XML decoder is too strict to reliably parse them. - // Here is a tiny example where the XML decoder completely fails - // due to mal-formed HTML: - // - // - //

- // - // ... - // - - parts := splitHTML(buf) - var lastFragmentID string - - addDedup := func(endpoint *Endpoint) { - for _, v := range result[lastFragmentID] { - if endpointsEqual(v, endpoint) { - return - } - } - result[lastFragmentID] = append(result[lastFragmentID], endpoint) - } - - for i, part := range parts { - noHTML := stripHTML(part) - - m := fragmentIDStringRE.FindAllStringSubmatch(part, -1) - if len(m) > 0 { - fragmentIDString := m[len(m)-1][0] - if i := strings.LastIndex(part, fragmentIDString); i >= 0 { - b := part[i+len(fragmentIDString):] - i = strings.Index(b, `"`) - if i >= 0 { - lastFragmentID = b[:i] - if j := strings.Index(lastFragmentID, "--"); j > 0 { - lastFragmentID = lastFragmentID[:j] // chop off trailing "--code-samples" for example. - } - logf("Found lastFragmentID: %v", lastFragmentID) - } - } - } - - for _, method := range httpMethods { - if strings.HasPrefix(part, method) { - if lastFragmentID == "" { - logf("WARNING: ignoring empty lastFragmentID: part #%v: noHTML=\n%v", i+1, noHTML) - continue - } - endpoint := parseEndpoint(part, method) - addDedup(endpoint) - continue - } - - if endpoint := parseNewfangledEndpoint(noHTML, method); endpoint != nil && lastFragmentID != "" { - logf("part #%v: adding newfangled endpoint: %#v", i+1, endpoint) - addDedup(endpoint) - } - } - } - - return result -} - -func stripHTML(s string) string { - s = strings.ReplaceAll(s, "", "") - s = strings.ReplaceAll(s, "", "") - s = stripHTMLRE.ReplaceAllString(s, " ") - return condenseWhitespaceRE.ReplaceAllString(s, " ") -} - -func splitHTML(buf string) []string { - var result []string - for buf != "" { - i := strings.Index(buf, codeLegacySplitString) - j := strings.Index(buf, codeSplitString) - switch { - case i < 0 && j < 0: - result = append(result, buf) - buf = "" - logf("splitHTML region #%v (%v bytes): case 1: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - case j < 0, i >= 0 && j >= 0 && i < j: - result = append(result, buf[:i]) - buf = buf[i+len(codeLegacySplitString):] - logf("splitHTML region #%v (%v bytes): case 2: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - case i < 0, i >= 0 && j >= 0 && j < i: - result = append(result, buf[:j]) - buf = buf[j+len(codeSplitString):] - logf("splitHTML region #%v (%v bytes): case 3: i=%v, j=%v", len(result), len(result[len(result)-1]), i, j) - default: - log.Fatalf("splitHTML: i=%v, j=%v", i, j) - } - } - return result -} - -func parseNewfangledEndpoint(s, method string) *Endpoint { - parts := strings.Split(s, " ") - if len(parts) < 2 { - return nil - } - for i, part := range parts[:len(parts)-1] { - if strings.EqualFold(part, method) && strings.HasPrefix(parts[i+1], "/") { - return parseEndpoint(method+" "+parts[i+1], method) - } - } - return nil -} - -func parseEndpoint(s, method string) *Endpoint { - eol := strings.Index(s, "\n") - if eol < 0 { - eol = len(s) - } - if v := strings.Index(s, "'"); v > len(method) && v < eol { - eol = v - } - if v := strings.Index(s, "<"); v > len(method) && v < eol { - eol = v - } - // if v := strings.Index(s, "{"); v > len(method) && v < eol { - // eol = v - // } - path := strings.TrimSpace(s[len(method):eol]) - path = strings.TrimPrefix(path, "{server}") - path = paramLegacyRE.ReplaceAllString(path, "%v") - path = paramRE.ReplaceAllString(path, "%v") - // strip leading garbage - if i := strings.Index(path, "/"); i >= 0 { - path = path[i+1:] - } - path = strings.TrimSuffix(path, ".") - logf("Found endpoint: %v %v", method, path) - return &Endpoint{ - urlFormats: []string{path}, - httpMethod: method, - } -} - -var httpMethods = []string{ - "GET", - "HEAD", - "POST", - "PUT", - "PATCH", - "DELETE", - "CONNECT", - "OPTIONS", - "TRACE", -} diff --git a/update-urls/main_test.go b/update-urls/main_test.go deleted file mode 100644 index d4696e1e967..00000000000 --- a/update-urls/main_test.go +++ /dev/null @@ -1,617 +0,0 @@ -// Copyright 2020 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 main - -import ( - "fmt" - "go/parser" - "go/token" - "os" - "regexp" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/pmezard/go-difflib/difflib" -) - -type pipelineSetup struct { - // Fields filled in by the unit test: - baseURL string - endpointsFromWebsite endpointsByFragmentID - filename string - serviceName string - originalGoSource string - wantGoSource string - wantNumEndpoints int - - // Fields filled in by setup: - docCache *fakeDocCache - fileRewriter *fakeFileRewriter - iter *fakeAstFileIterator - services servicesMap - wantFailure bool -} - -func (ps *pipelineSetup) setup(t *testing.T, stripURLs, destroyReceiverPointers bool) *pipelineSetup { - t.Helper() - - if stripURLs { - // For every GitHub API doc URL, remove it from the original source, - // and alternate between stripping the previous blank comment line and not. - for removeBlank := false; true; removeBlank = !removeBlank { - var changes bool - if removeBlank { - ps.originalGoSource, changes = removeNextURLAndOptionalBlank(ps.originalGoSource) - } else { - ps.originalGoSource, changes = removeNextURLLineOnly(ps.originalGoSource) - } - if !changes { - break - } - } - // log.Printf("Modified Go Source:\n%v", ps.originalGoSource) - } - - if destroyReceiverPointers { - from := fmt.Sprintf(" *%v) ", ps.serviceName) - to := fmt.Sprintf(" %v) ", ps.serviceName) - ps.originalGoSource = strings.ReplaceAll(ps.originalGoSource, from, to) - ps.wantFailure = true // receiver pointers must be fixed before running. - } - - ps.docCache = &fakeDocCache{ - t: t, - baseURL: ps.baseURL, - endpoints: ps.endpointsFromWebsite, - } - fset := token.NewFileSet() - ps.fileRewriter = &fakeFileRewriter{fset: fset, in: ps.originalGoSource} - ps.services = servicesMap{ps.serviceName: &Service{serviceName: ps.serviceName}} - astFile, err := parser.ParseFile(fset, ps.filename, ps.originalGoSource, parser.ParseComments) - if err != nil { - t.Fatalf("ParseFile: %v", err) - } - ps.iter = &fakeAstFileIterator{ - fset: fset, - orig: &filenameAstFilePair{ - filename: ps.filename, - astFile: astFile, - }, - } - - return ps -} - -func (ps *pipelineSetup) validate(t *testing.T) { - t.Helper() - - // Call pipeline - endpoints, err := findAllServiceEndpoints(ps.iter, ps.services) - if ps.wantFailure { - if err != nil { - // test successful - receivers must be pointers first - return - } - t.Fatalf("Expected non-pointer receivers to fail parsing, but no error was raised") - } - if err != nil { - t.Fatalf("Fail detected but not expected: %v", err) - } - - // log.Printf("endpoints=%#v (%v)", endpoints, len(endpoints)) - if len(endpoints) != ps.wantNumEndpoints { - t.Errorf("got %v endpoints, want %v", len(endpoints), ps.wantNumEndpoints) - } - usedHelpers, endpointsByFilename := resolveHelpersAndCacheDocs(endpoints, ps.docCache) - // log.Printf("endpointsByFilename=%#v (%v)", endpointsByFilename, len(endpointsByFilename[ps.filename])) - if len(endpointsByFilename[ps.filename]) != ps.wantNumEndpoints { - t.Errorf("got %v endpointsByFilename, want %v", len(endpointsByFilename[ps.filename]), ps.wantNumEndpoints) - } - validateRewriteURLs(usedHelpers, endpointsByFilename, ps.docCache, ps.fileRewriter) - - if ps.fileRewriter.out == "" { - t.Fatalf("No modifications were made to the file") - } - - if ps.fileRewriter.out != ps.wantGoSource { - diff := difflib.ContextDiff{ - A: difflib.SplitLines(ps.fileRewriter.out), - B: difflib.SplitLines(ps.wantGoSource), - FromFile: "got", - ToFile: "want", - Context: 1, - Eol: "\n", - } - result, _ := difflib.GetContextDiffString(diff) - t.Errorf(strings.Replace(result, "\t", " ", -1)) - } -} - -var ( - urlWithBlankCommentRE = regexp.MustCompile(`(//\n)?// GitHub API docs: [^\n]+\n`) - urlLineOnlyRE = regexp.MustCompile(`// GitHub API docs: [^\n]+\n`) -) - -func removeNextURLAndOptionalBlank(s string) (string, bool) { - parts := urlWithBlankCommentRE.Split(s, 2) - if len(parts) == 1 { - return parts[0], false - } - return parts[0] + parts[1], true -} - -func TestRemoveNextURLAndOptionalBlank(t *testing.T) { - tests := []struct { - name string - s string - want string - changes bool - }{ - {name: "empty string"}, - {name: "no URLs", s: "// line 1\n//\n// line 3", want: "// line 1\n//\n// line 3"}, - { - name: "URL without prior blank comment", - s: "// line 1\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - { - name: "URL with prior blank comment", - s: "// line 1\n//\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got, changes := removeNextURLAndOptionalBlank(tt.s) - if got != tt.want { - t.Errorf("got = %v, want %v", got, tt.want) - } - if changes != tt.changes { - t.Errorf("got changes = %v, want %v", changes, tt.changes) - } - }) - } -} - -func removeNextURLLineOnly(s string) (string, bool) { - parts := urlLineOnlyRE.Split(s, 2) - if len(parts) == 1 { - return parts[0], false - } - return parts[0] + parts[1], true -} - -func TestRemoveNextURLLineOnly(t *testing.T) { - tests := []struct { - name string - s string - want string - changes bool - }{ - {name: "empty string"}, - {name: "no URLs", s: "// line 1\n//\n// line 3", want: "// line 1\n//\n// line 3"}, - { - name: "URL without prior blank comment", - s: "// line 1\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\nfunc MyFunc() {\n", - changes: true, - }, - { - name: "URL with prior blank comment", - s: "// line 1\n//\n// GitHub API docs: yeah\nfunc MyFunc() {\n", - want: "// line 1\n//\nfunc MyFunc() {\n", - changes: true, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got, changes := removeNextURLLineOnly(tt.s) - if got != tt.want { - t.Errorf("got = %v, want %v", got, tt.want) - } - if changes != tt.changes { - t.Errorf("got changes = %v, want %v", changes, tt.changes) - } - }) - } -} - -type endpointsByFragmentID map[string][]*Endpoint - -// fakeDocCache implements documentCacheReader and documentCacheWriter. -type fakeDocCache struct { - t *testing.T - baseURL string - endpoints endpointsByFragmentID -} - -func (f *fakeDocCache) URLByMethodAndPath(methodAndPath string) (string, bool) { - f.t.Helper() - for fragmentID, endpoints := range f.endpoints { - for _, endpoint := range endpoints { - for _, urlFormat := range endpoint.urlFormats { - key := fmt.Sprintf("%v %v", endpoint.httpMethod, urlFormat) - if key == methodAndPath { - url := fmt.Sprintf("%v#%v", f.baseURL, fragmentID) - // log.Printf("URLByMethodAndPath(%q) = (%q, true)", methodAndPath, url) - return url, true - } - } - } - } - f.t.Fatalf("fakeDocCache.URLByMethodAndPath: unable to find method %v", methodAndPath) - return "", false -} - -func (f *fakeDocCache) CacheDocFromInternet(url, filename string, pos token.Position) {} // no-op -func (f *fakeDocCache) Position(pos token.Pos) token.Position { return token.Position{} } // no-op - -// fakeFileRewriter implements FileRewriter. -type fakeFileRewriter struct { - fset *token.FileSet - in string - out string -} - -func (f *fakeFileRewriter) Position(pos token.Pos) token.Position { - return f.fset.Position(pos) -} - -func (f *fakeFileRewriter) ReadFile(filename string) ([]byte, error) { - return []byte(f.in), nil -} - -func (f *fakeFileRewriter) WriteFile(filename string, buf []byte, mode os.FileMode) error { - f.out = string(buf) - return nil -} - -// fakeAstFileIterator implements astFileIterator. -type fakeAstFileIterator struct { - orig, next *filenameAstFilePair - fset *token.FileSet -} - -func (f *fakeAstFileIterator) Position(pos token.Pos) token.Position { return f.fset.Position(pos) } -func (f *fakeAstFileIterator) Reset() { f.next = f.orig } -func (f *fakeAstFileIterator) Next() *filenameAstFilePair { - v := f.next - f.next = nil - return v -} - -func TestSortAndMergeFileEdits(t *testing.T) { - tests := []struct { - name string - fileEdits []*FileEdit - want []*FileEdit - }{ - {name: "no edits"}, - { - name: "one edit", - fileEdits: []*FileEdit{ - {toText: "one edit"}, - }, - want: []*FileEdit{ - {toText: "one edit"}, - }, - }, - { - name: "two inserts at same offset - no extra blank comment", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n// one insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n// second insert"}, - }, - want: []*FileEdit{ - {pos: token.Position{Offset: 2}, toText: "\n// one insert\n// second insert"}, - }, - }, - { - name: "two inserts at same offset - strip extra blank comment", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n//\n// one insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\n//\n// second insert"}, - }, - want: []*FileEdit{ - {pos: token.Position{Offset: 2}, toText: "\n//\n// one insert\n// second insert"}, - }, - }, - { - name: "two non-overlapping edits, low offset to high", - fileEdits: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - }, - { - name: "two non-overlapping edits, high offset to low", - fileEdits: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit two"}, - {fromText: ".", pos: token.Position{Offset: 0}, toText: "edit one"}, - }, - }, - { - name: "two overlapping edits, text low to high", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 0"}, - {fromText: ".", toText: "edit 1"}, - }, - want: []*FileEdit{ - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "two overlapping edits, text high to low", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - }, - want: []*FileEdit{ - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "dup, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "non-dup, dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 1"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0\nedit 1"}, - {fromText: ".", toText: "edit 2"}, - }, - }, - { - name: "dup, non-dup, dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 4"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3\nedit 4"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 2"}, - {fromText: ".", toText: "edit 0\nedit 1"}, - }, - }, - { - name: "non-dup, dup, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 1"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0"}, - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 200}, toText: "edit 3"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 0\nedit 1"}, - {fromText: ".", toText: "edit 2"}, - }, - }, - { - name: "triplet, non-dup", - fileEdits: []*FileEdit{ - {fromText: ".", toText: "edit 1"}, - {fromText: ".", toText: "edit 0"}, - {fromText: ".", toText: "edit 2"}, - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 3"}, - }, - want: []*FileEdit{ - {fromText: ".", pos: token.Position{Offset: 100}, toText: "edit 3"}, - {fromText: ".", toText: "edit 0\nedit 1\nedit 2"}, - }, - }, - } - - fileEditEqual := cmp.Comparer(func(a, b *FileEdit) bool { - return a.fromText == b.fromText && a.pos == b.pos && a.toText == b.toText - }) - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got := sortAndMergeFileEdits(tt.fileEdits) - - if len(got) != len(tt.want) { - t.Errorf("len(got) = %v, len(want) = %v", len(got), len(tt.want)) - } - for i := 0; i < len(got); i++ { - var wantFileEdit *FileEdit - if i < len(tt.want) { - wantFileEdit = tt.want[i] - } - if !cmp.Equal(got[i], wantFileEdit, fileEditEqual) { - t.Errorf("got[%v] =\n%#v\nwant[%v]:\n%#v", i, got[i], i, wantFileEdit) - } - } - }) - } -} - -func TestPerformBufferEdits(t *testing.T) { - tests := []struct { - name string - fileEdits []*FileEdit - s string - want string - }{ - {name: "no edits", s: "my\nshort\nfile\n", want: "my\nshort\nfile\n"}, - { - name: "one edit", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 3}, fromText: "short", toText: "one edit"}, - }, - s: "my\nshort\nfile\n", - want: "my\none edit\nfile\n", - }, - { - name: "one insert", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\none insert"}, - }, - s: "my\nshort\nfile\n", - want: "my\none insert\nshort\nfile\n", - }, - { - name: "two inserts at same offset", - fileEdits: []*FileEdit{ - {pos: token.Position{Offset: 2}, fromText: "", toText: "\none insert"}, - {pos: token.Position{Offset: 2}, fromText: "", toText: "\nsecond insert"}, - }, - s: "my\nshort\nfile\n", - want: "my\none insert\nsecond insert\nshort\nfile\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - b := performBufferEdits([]byte(tt.s), tt.fileEdits) - got := string(b) - - if len(got) != len(tt.want) { - t.Errorf("len(got) = %v, len(want) = %v", len(got), len(tt.want)) - } - if got != tt.want { - t.Errorf("got = %v, want = %v", got, tt.want) - } - }) - } -} - -func TestGitURL(t *testing.T) { - tests := []struct { - name string - s string - wantBase string - wantFull string - }{ - {name: "empty string"}, - {name: "non-http", s: "howdy"}, - { - name: "normal URL, no slash", - s: "https://docs.github.com/en/rest/activity/events", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/", - }, - { - name: "normal URL, with slash", - s: "https://docs.github.com/en/rest/activity/events/", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/", - }, - { - name: "normal URL, with fragment identifier", - s: "https://docs.github.com/en/rest/activity/events/#list-public-events", - wantBase: "https://docs.github.com/en/rest/activity/events/", - wantFull: "https://docs.github.com/en/rest/activity/events/#list-public-events", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - gotBase, gotFull := getURL(tt.s) - - if gotBase != tt.wantBase { - t.Errorf("getURL base = %v ; want %v", gotBase, tt.wantBase) - } - - if gotFull != tt.wantFull { - t.Errorf("getURL full = %v ; want %v", gotFull, tt.wantFull) - } - }) - } -} - -var endpointsEqualCmp = cmp.Comparer(endpointsEqual) - -func testWebPageHelper(t *testing.T, got, want map[string][]*Endpoint) { - t.Helper() - - for k := range got { - w, ok := want[k] - if len(got[k]) != len(w) { - t.Errorf("len(got[%q]) = %v, len(want[%q]) = %v", k, len(got[k]), k, len(w)) - } - - for i := 0; i < len(got[k]); i++ { - var wantEndpoint *Endpoint - if ok && i < len(w) { - wantEndpoint = w[i] - } - - if diff := cmp.Diff(wantEndpoint, got[k][i], endpointsEqualCmp); diff != "" { - t.Errorf("endpoint %q i=%v mismatch (-want +got):\n%v", k, i, diff) - } - } - } - - for k := range want { - if _, ok := got[k]; !ok { - t.Errorf("got[%q] = nil\nwant[%q]:\n%#v", k, k, want[k]) - } - } -} - -func TestParseEndpoint(t *testing.T) { - tests := []struct { - name string - s string - method string - want *Endpoint - }{ - { - name: "orgs_projects: list-repository-projects", - s: `GET /repos/{owner}/{repo}/projects'
, { -`, - method: "GET", - want: &Endpoint{urlFormats: []string{"repos/%v/%v/projects"}, httpMethod: "GET"}, - }, - { - name: "orgs_projects: ListProjects", - s: `GET /orgs/{org}/projects', { -`, - method: "GET", - want: &Endpoint{urlFormats: []string{"orgs/%v/projects"}, httpMethod: "GET"}, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("test #%v: %v", i, tt.name), func(t *testing.T) { - got := parseEndpoint(tt.s, tt.method) - - if !cmp.Equal(got, tt.want, endpointsEqualCmp) { - t.Errorf("parseEndpoint = %#v, want %#v", got, tt.want) - } - }) - } -} diff --git a/update-urls/reactions_test.go b/update-urls/reactions_test.go deleted file mode 100644 index 8d0504ec699..00000000000 --- a/update-urls/reactions_test.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020 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 main - -import ( - _ "embed" - "strings" - "testing" -) - -func newReactionsPipeline() *pipelineSetup { - return &pipelineSetup{ - baseURL: "https://docs.github.com/en/rest/reactions/", - endpointsFromWebsite: reactionsWant, - filename: "reactions.go", - serviceName: "ReactionsService", - originalGoSource: strings.ReplaceAll(reactionsGoFileOriginal, "\r", ""), - wantGoSource: strings.ReplaceAll(reactionsGoFileWant, "\r", ""), - wantNumEndpoints: 25, - } -} - -func TestPipeline_Reactions(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, false, false) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstStripAllURLs(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, true, false) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstDestroyReceivers(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, false, true) - ps.validate(t) -} - -func TestPipeline_Reactions_FirstStripAllURLsAndDestroyReceivers(t *testing.T) { - ps := newReactionsPipeline() - ps.setup(t, true, true) - ps.validate(t) -} - -func TestParseWebPageEndpoints_Reactions(t *testing.T) { - got := parseWebPageEndpoints(reactionsTestWebPage) - testWebPageHelper(t, got, reactionsWant) -} - -var reactionsWant = endpointsByFragmentID{ - "list-reactions-for-a-commit-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-a-commit-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-an-issue": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/%v/reactions"}, httpMethod: "POST"}}, - - "delete-an-issue-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/issues/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/issues/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-a-pull-request-review-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions"}, httpMethod: "POST"}}, - - "list-reactions-for-a-team-discussion": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions"}, httpMethod: "GET"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions"}, httpMethod: "GET"}, - }, - - "delete-a-reaction-legacy": []*Endpoint{{urlFormats: []string{"reactions/%v"}, httpMethod: "DELETE"}}, - - "list-reactions-for-a-team-discussion-comment-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-an-issue-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/issues/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-pull-request-review-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions"}, httpMethod: "GET"}}, - - "create-reaction-for-a-team-discussion-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-team-discussion-comment-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-commit-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/comments/%v/reactions"}, httpMethod: "POST"}}, - - "list-reactions-for-an-issue": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/%v/reactions"}, httpMethod: "GET"}}, - - "create-reaction-for-an-issue-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions"}, httpMethod: "POST"}}, - - "create-reaction-for-a-team-discussion": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions"}, httpMethod: "POST"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions"}, httpMethod: "POST"}, - }, - - "delete-team-discussion-reaction": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "create-reaction-for-a-team-discussion-comment": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "POST"}, - }, - - "list-reactions-for-an-issue-comment": []*Endpoint{{urlFormats: []string{"repos/%v/%v/issues/comments/%v/reactions"}, httpMethod: "GET"}}, - - "delete-a-pull-request-comment-reaction": []*Endpoint{ - {urlFormats: []string{"repositories/%v/pulls/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"repos/%v/%v/pulls/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-team-discussion-comment": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions"}, httpMethod: "GET"}, - }, - - "delete-team-discussion-comment-reaction": []*Endpoint{ - {urlFormats: []string{"organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - {urlFormats: []string{"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v"}, httpMethod: "DELETE"}, - }, - - "list-reactions-for-a-team-discussion-legacy": []*Endpoint{{urlFormats: []string{"teams/%v/discussions/%v/reactions"}, httpMethod: "GET"}}, -} - -//go:embed testdata/reactions.html -var reactionsTestWebPage string - -//go:embed testdata/reactions-original.go -var reactionsGoFileOriginal string - -//go:embed testdata/reactions-want.go -var reactionsGoFileWant string diff --git a/update-urls/testdata/activity-events.html b/update-urls/testdata/activity-events.html deleted file mode 100644 index 90eac2f59ff..00000000000 --- a/update-urls/testdata/activity-events.html +++ /dev/null @@ -1,5686 +0,0 @@ - - - Activity - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - -
-
- -
- - - Article version: GitHub.com - - - - -
- - -
-
- - -
-
- -
- -
-
-

Activity

-
- -
-
- - - - - - - - -
-
-
- -

In this article

- - -
- -
-

- Did this doc help you? -

-

- - - - -

- - - - - -

- - -

- - -
- -
-
-
-
- -

Events

-

The Events API is a read-only API to the GitHub events. These events power the various activity streams on the site.

-

The Events API can return different types of events triggered by activity on GitHub. For more information about the specific events that you can receive from the Events API, see "GitHub Event types." An events API for repository issues is also available. For more information, see the "Issue Events API."

-

Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

-
$ curl -I https://api.github.com/users/tater/events
-> HTTP/1.1 200 OK
-> X-Poll-Interval: 60
-> ETag: "a18c3bded88eb5dbb5c849a489412bf3"
-
-# The quotes around the ETag value are important
-$ curl -I https://api.github.com/users/tater/events \
-$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
-> HTTP/1.1 304 Not Modified
-> X-Poll-Interval: 60
-

Events support pagination, however the per_page option is unsupported. The fixed page size is 30 items. Fetching up to ten pages is supported, for a total of 300 events. For information, see "Traversing with pagination."

-

Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).

-
-
-

- List public events -

-

We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

-
-
get /events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /events')
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
- -
get /networks/{owner}/{repo}/events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/networks/octocat/hello-world/events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /networks/{owner}/{repo}/events', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
- -
get /orgs/{org}/events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
orgstringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/orgs/ORG/events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /orgs/{org}/events', {
-  org: 'org'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
- -
get /repos/{owner}/{repo}/events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/events', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
-
-

- List events for the authenticated user -

-

If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

-
-
get /users/{username}/events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/events', {
-  username: 'username'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
-
-

- List organization events for the authenticated user -

-

This is the user's organization dashboard. You must be authenticated as the user to view this.

-
-
get /users/{username}/events/orgs/{org}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
orgstringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/events/orgs/ORG
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/events/orgs/{org}', {
-  username: 'username',
-  org: 'org'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - - -
-
-
-
- -
get /users/{username}/events/public
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/events/public
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/events/public', {
-  username: 'username'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
-
-

- List events received by the authenticated user -

-

These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

-
-
get /users/{username}/received_events
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/received_events
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/received_events', {
-  username: 'username'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-
- -
get /users/{username}/received_events/public
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/received_events/public
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/received_events/public', {
-  username: 'username'
-})
-
- - - - -

Response

-
Status: 200 OK
-
- - -

Notes

- - - -
-
-
-

Feeds

-
-
-

- Get feeds -

-

GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:

-
    -
  • Timeline: The GitHub global public timeline
  • -
  • User: The public timeline for any user, using URI template
  • -
  • Current user public: The public timeline for the authenticated user
  • -
  • Current user: The private timeline for the authenticated user
  • -
  • Current user actor: The private timeline for activity created by the authenticated user
  • -
  • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
  • -
  • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
  • -
-

Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

-
-
get /feeds
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/feeds
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /feeds')
-
- - - - -

Default response

-
Status: 200 OK
-
{
-  "timeline_url": "https://github.com/timeline",
-  "user_url": "https://github.com/{user}",
-  "current_user_public_url": "https://github.com/octocat",
-  "current_user_url": "https://github.com/octocat.private?token=abc123",
-  "current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123",
-  "current_user_organization_url": "",
-  "current_user_organization_urls": [
-    "https://github.com/organizations/github/octocat.private.atom?token=abc123"
-  ],
-  "security_advisories_url": "https://github.com/security-advisories",
-  "_links": {
-    "timeline": {
-      "href": "https://github.com/timeline",
-      "type": "application/atom+xml"
-    },
-    "user": {
-      "href": "https://github.com/{user}",
-      "type": "application/atom+xml"
-    },
-    "current_user_public": {
-      "href": "https://github.com/octocat",
-      "type": "application/atom+xml"
-    },
-    "current_user": {
-      "href": "https://github.com/octocat.private?token=abc123",
-      "type": "application/atom+xml"
-    },
-    "current_user_actor": {
-      "href": "https://github.com/octocat.private.actor?token=abc123",
-      "type": "application/atom+xml"
-    },
-    "current_user_organization": {
-      "href": "",
-      "type": ""
-    },
-    "current_user_organizations": [
-      {
-        "href": "https://github.com/organizations/github/octocat.private.atom?token=abc123",
-        "type": "application/atom+xml"
-      }
-    ],
-    "security_advisories": {
-      "href": "https://github.com/security-advisories",
-      "type": "application/atom+xml"
-    }
-  }
-}
-
- - -

Notes

- - - -
-
-
-

Example of getting an Atom feed

-

To get a feed in Atom format, you must specify the application/atom+xml type in the Accept header. For example, to get the Atom feed for GitHub security advisories:

-
curl -H "Accept: application/atom+xml" https://github.com/security-advisories
-
-

Response

-
Status: 200 OK
-
<?xml version="1.0" encoding="UTF-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
-  <id>tag:github.com,2008:/security-advisories</id>
-  <link rel="self" type="application/atom+xml" href="https://github.com/security-advisories.atom"/>
-  <title>GitHub Security Advisory Feed</title>
-  <author>
-    <name>GitHub</name>
-  </author>
-  <updated>2019-01-14T19:34:52Z</updated>
-     <entry>
-      <id>tag:github.com,2008:GHSA-abcd-12ab-23cd</id>
-      <published>2018-07-26T15:14:52Z</published>
-      <updated>2019-01-14T19:34:52Z</updated>
-      <title type="html">[GHSA-abcd-12ab-23cd] Moderate severity vulnerability that affects Octoapp</title>
-        <category term="NPM"/>
-      <content type="html">
-        &lt;p&gt;Octoapp node module before 4.17.5 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via defaultsDeep, merge, and mergeWith functions, which allows a malicious user to modify the prototype of &quot;Object&quot; via &lt;strong&gt;proto&lt;/strong&gt;, causing the addition or modification of an existing property that will exist on all objects.&lt;/p&gt;
-          &lt;p&gt;&lt;strong&gt;Affected Packages&lt;/strong&gt;&lt;/p&gt;
-
-  &lt;dl&gt;
-      &lt;dt&gt;Octoapp&lt;/dt&gt;
-      &lt;dd&gt;Ecosystem: npm&lt;/dd&gt;
-      &lt;dd&gt;Severity: moderate&lt;/dd&gt;
-      &lt;dd&gt;Versions: &amp;lt; 4.17.5&lt;/dd&gt;
-        &lt;dd&gt;Fixed in: 4.17.5&lt;/dd&gt;
-  &lt;/dl&gt;
-
-          &lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
-
-  &lt;ul&gt;
-      &lt;li&gt;https://nvd.nist.gov/vuln/detail/CVE-2018-123&lt;/li&gt;
-  &lt;/ul&gt;
-
-      </content>
-    </entry>
-</feed>
-
-

Notifications

-

Users receive notifications for conversations in repositories they watch including:

-
    -
  • Issues and their comments
  • -
  • Pull Requests and their comments
  • -
  • Comments on any commits
  • -
-

Notifications are also sent for conversations in unwatched repositories when the user is involved including:

-
    -
  • @mentions
  • -
  • Issue assignments
  • -
  • Commits the user authors or commits
  • -
  • Any discussion in which the user actively participates
  • -
-

All Notification API calls require the notifications or repo API scopes. Doing this will give read-only access to some issue and commit content. You will still need the repo scope to access issues and commits from their respective endpoints.

-

Notifications come back as "threads". A thread contains information about the current discussion of an issue, pull request, or commit.

-

Notifications are optimized for polling with the Last-Modified header. If there are no new notifications, you will see a 304 Not Modified response, leaving your current rate limit untouched. There is an X-Poll-Interval header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

-
# Add authentication to your requests
-$ curl -I https://api.github.com/notifications
-HTTP/1.1 200 OK
-Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
-X-Poll-Interval: 60
-
-# Pass the Last-Modified header exactly
-$ curl -I https://api.github.com/notifications
-$    -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
-> HTTP/1.1 304 Not Modified
-> X-Poll-Interval: 60
-

Notification reasons

-

When retrieving responses from the Notifications API, each payload has a key titled reason. These correspond to events that trigger a notification.

-

Here's a list of potential reasons for receiving a notification:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Reason NameDescription
assignYou were assigned to the issue.
authorYou created the thread.
commentYou commented on the thread.
invitationYou accepted an invitation to contribute to the repository.
manualYou subscribed to the thread (via an issue or pull request).
mentionYou were specifically @mentioned in the content.
review_requestedYou, or a team you're a member of, were requested to review a pull request.
security_alertGitHub discovered a security vulnerability in your repository.
state_changeYou changed the thread state (for example, closing an issue or merging a pull request).
subscribedYou're watching the repository.
team_mentionYou were on a team that was mentioned.
-

Note that the reason is modified on a per-thread basis, and can change, if the reason on a later notification is different.

-

For example, if you are the author of an issue, subsequent notifications on that issue will have a reason of author. If you're then @mentioned on the same issue, the notifications you fetch thereafter will have a reason of mention. The reason remains as mention, regardless of whether you're ever mentioned again.

-
-
-

- List notifications for the authenticated user -

-

List all notifications for the current user, sorted by most recently updated.

-
-
get /notifications
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
allbooleanquery -

If true, show notifications marked as read.

- -
participatingbooleanquery -

If true, only shows notifications in which the user is directly participating or mentioned.

- -
sincestringquery -

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

- -
beforestringquery -

Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /notifications')
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": "1",
-    "repository": {
-      "id": 1296269,
-      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-      "name": "Hello-World",
-      "full_name": "octocat/Hello-World",
-      "owner": {
-        "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
-      },
-      "private": false,
-      "html_url": "https://github.com/octocat/Hello-World",
-      "description": "This your first repo!",
-      "fork": false,
-      "url": "https://api.github.com/repos/octocat/Hello-World",
-      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-      "git_url": "git:github.com/octocat/Hello-World.git",
-      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-      "ssh_url": "git@github.com:octocat/Hello-World.git",
-      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
-    },
-    "subject": {
-      "title": "Greetings",
-      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
-      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
-      "type": "Issue"
-    },
-    "reason": "subscribed",
-    "unread": true,
-    "updated_at": "2014-11-07T22:01:45Z",
-    "last_read_at": "2014-11-07T22:01:45Z",
-    "url": "https://api.github.com/notifications/threads/1"
-  }
-]
-
- - - -
-
-
-
-
-

- Mark notifications as read -

-

Marks all notifications as "read" removes it from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

-
-
put /notifications
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
last_read_atstringbody -

Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PUT \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications \
-  -d '{"last_read_at":"last_read_at"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PUT /notifications', {
-  last_read_at: 'last_read_at'
-})
-
- - - - -

Response

-
Status: 205 Reset Content
-
- - - -
-
-
-
-
-

- Get a thread -

- -
-
get /notifications/threads/{thread_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
thread_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications/threads/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /notifications/threads/{thread_id}', {
-  thread_id: 42
-})
-
- - - - -

Default response

-
Status: 200 OK
-
{
-  "id": "1",
-  "repository": {
-    "id": 1296269,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-    "name": "Hello-World",
-    "full_name": "octocat/Hello-World",
-    "owner": {
-      "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
-    },
-    "private": false,
-    "html_url": "https://github.com/octocat/Hello-World",
-    "description": "This your first repo!",
-    "fork": false,
-    "url": "https://api.github.com/repos/octocat/Hello-World",
-    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-    "git_url": "git:github.com/octocat/Hello-World.git",
-    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-    "ssh_url": "git@github.com:octocat/Hello-World.git",
-    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
-  },
-  "subject": {
-    "title": "Greetings",
-    "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
-    "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
-    "type": "Issue"
-  },
-  "reason": "subscribed",
-  "unread": true,
-  "updated_at": "2014-11-07T22:01:45Z",
-  "last_read_at": "2014-11-07T22:01:45Z",
-  "url": "https://api.github.com/notifications/threads/1"
-}
-
- - - -
-
-
-
- -
patch /notifications/threads/{thread_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
thread_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PATCH \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications/threads/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PATCH /notifications/threads/{thread_id}', {
-  thread_id: 42
-})
-
- - - - -

Response

-
Status: 205 Reset Content
-
- - - -
-
-
-
-
-

- Get a thread subscription for the authenticated user -

-

This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

-

Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.

-
-
get /notifications/threads/{thread_id}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
thread_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications/threads/42/subscription
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /notifications/threads/{thread_id}/subscription', {
-  thread_id: 42
-})
-
- - - - -

Default response

-
Status: 200 OK
-
{
-  "subscribed": true,
-  "ignored": false,
-  "reason": null,
-  "created_at": "2012-10-06T21:34:12Z",
-  "url": "https://api.github.com/notifications/threads/1/subscription",
-  "thread_url": "https://api.github.com/notifications/threads/1"
-}
-
- - - -
-
-
-
-
-

- Set a thread subscription -

-

If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

-

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

-

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

-
-
put /notifications/threads/{thread_id}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
thread_idintegerpath - - -
ignoredbooleanbody -

Unsubscribes and subscribes you to a conversation. Set ignored to true to block all notifications from this thread.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PUT \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications/threads/42/subscription \
-  -d '{"ignored":true}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PUT /notifications/threads/{thread_id}/subscription', {
-  thread_id: 42,
-  ignored: true
-})
-
- - - - -

Default response

-
Status: 200 OK
-
{
-  "subscribed": true,
-  "ignored": false,
-  "reason": null,
-  "created_at": "2012-10-06T21:34:12Z",
-  "url": "https://api.github.com/notifications/threads/1/subscription",
-  "thread_url": "https://api.github.com/notifications/threads/1"
-}
-
- - - -
-
-
-
-
-

- Delete a thread subscription -

-

Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

-
-
delete /notifications/threads/{thread_id}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
thread_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/notifications/threads/42/subscription
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /notifications/threads/{thread_id}/subscription', {
-  thread_id: 42
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - - -
-
-
-
-
-

- List repository notifications for the authenticated user -

-

List all notifications for the current user.

-
-
get /repos/{owner}/{repo}/notifications
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
allbooleanquery -

If true, show notifications marked as read.

- -
participatingbooleanquery -

If true, only shows notifications in which the user is directly participating or mentioned.

- -
sincestringquery -

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

- -
beforestringquery -

Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/notifications
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/notifications', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": "1",
-    "repository": {
-      "id": 1296269,
-      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-      "name": "Hello-World",
-      "full_name": "octocat/Hello-World",
-      "owner": {
-        "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
-      },
-      "private": false,
-      "html_url": "https://github.com/octocat/Hello-World",
-      "description": "This your first repo!",
-      "fork": false,
-      "url": "https://api.github.com/repos/octocat/Hello-World",
-      "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-      "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-      "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-      "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-      "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-      "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-      "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-      "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-      "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-      "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-      "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-      "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-      "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-      "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-      "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-      "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-      "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-      "git_url": "git:github.com/octocat/Hello-World.git",
-      "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-      "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-      "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-      "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-      "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-      "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-      "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-      "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-      "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-      "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-      "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-      "ssh_url": "git@github.com:octocat/Hello-World.git",
-      "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-      "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-      "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-      "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-      "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-      "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-      "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}"
-    },
-    "subject": {
-      "title": "Greetings",
-      "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123",
-      "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123",
-      "type": "Issue"
-    },
-    "reason": "subscribed",
-    "unread": true,
-    "updated_at": "2014-11-07T22:01:45Z",
-    "last_read_at": "2014-11-07T22:01:45Z",
-    "url": "https://api.github.com/notifications/threads/1"
-  }
-]
-
- - - -
-
-
-
-
-

- Mark repository notifications as read -

-

Marks all notifications in a repository as "read" removes them from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false.

-
-
put /repos/{owner}/{repo}/notifications
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
last_read_atstringbody -

Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PUT \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/notifications \
-  -d '{"last_read_at":"last_read_at"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PUT /repos/{owner}/{repo}/notifications', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  last_read_at: 'last_read_at'
-})
-
- - - - -

Response

-
Status: 205 Reset Content
-
- - - -
-
-
-

Starring

-

Repository starring is a feature that lets users bookmark repositories. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed.

-

Starring vs. Watching

-

In August 2012, we changed the way watching -works on GitHub. Many API -client applications may be using the original "watcher" endpoints for accessing -this data. You can now start using the "star" endpoints instead (described -below). For more information, see the Watcher API Change post and the "Repository Watching API."

-

Custom media types for starring

-

There is one supported custom media type for the Starring REST API. When you use this custom media type, you will receive a response with the starred_at timestamp property that indicates the time the star was created. The response also has a second property that includes the resource that is returned when the custom media type is not included. The property that contains the resource will be either user or repo.

-
application/vnd.github.v3.star+json
-
-

For more information about media types, see "Custom media types."

-
-
-

- List stargazers -

-

Lists the people that have starred the repository.

-

You can also find out when stars were created by passing the following custom media type via the Accept header:

-
-
get /repos/{owner}/{repo}/stargazers
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/stargazers
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/stargazers', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "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
-  }
-]
-
- - -

Notes

- - - -
-
-
-
-
-

- List repositories starred by the authenticated user -

-

Lists repositories the authenticated user has starred.

-

You can also find out when stars were created by passing the following custom media type via the Accept header:

-
-
get /user/starred
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
sortstringquery -

One of created (when the repository was starred) or updated (when it was last pushed to).

- -
directionstringquery -

One of asc (ascending) or desc (descending).

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/user/starred
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /user/starred')
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1296269,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-    "name": "Hello-World",
-    "full_name": "octocat/Hello-World",
-    "owner": {
-      "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
-    },
-    "private": false,
-    "html_url": "https://github.com/octocat/Hello-World",
-    "description": "This your first repo!",
-    "fork": false,
-    "url": "https://api.github.com/repos/octocat/Hello-World",
-    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-    "git_url": "git:github.com/octocat/Hello-World.git",
-    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-    "ssh_url": "git@github.com:octocat/Hello-World.git",
-    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
-    "clone_url": "https://github.com/octocat/Hello-World.git",
-    "mirror_url": "git:git.example.com/octocat/Hello-World",
-    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
-    "svn_url": "https://svn.github.com/octocat/Hello-World",
-    "homepage": "https://github.com",
-    "language": null,
-    "forks_count": 9,
-    "stargazers_count": 80,
-    "watchers_count": 80,
-    "size": 108,
-    "default_branch": "master",
-    "open_issues_count": 0,
-    "is_template": true,
-    "topics": [
-      "octocat",
-      "atom",
-      "electron",
-      "api"
-    ],
-    "has_issues": true,
-    "has_projects": true,
-    "has_wiki": true,
-    "has_pages": false,
-    "has_downloads": true,
-    "archived": false,
-    "disabled": false,
-    "visibility": "public",
-    "pushed_at": "2011-01-26T19:06:43Z",
-    "created_at": "2011-01-26T19:01:12Z",
-    "updated_at": "2011-01-26T19:14:43Z",
-    "permissions": {
-      "admin": false,
-      "push": false,
-      "pull": true
-    },
-    "allow_rebase_merge": true,
-    "template_repository": null,
-    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
-    "allow_squash_merge": true,
-    "delete_branch_on_merge": true,
-    "allow_merge_commit": true,
-    "subscribers_count": 42,
-    "network_count": 0
-  }
-]
-
- - - -
-
-
-
- -
get /user/starred/{owner}/{repo}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/user/starred/octocat/hello-world
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /user/starred/{owner}/{repo}', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Response if this repository is starred by you

-
Status: 204 No Content
-
- -

Response if this repository is not starred by you

-
Status: 404 Not Found
-
- - - -
-
-
-
-
-

- Star a repository for the authenticated user -

-

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

-
-
put /user/starred/{owner}/{repo}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PUT \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/user/starred/octocat/hello-world
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PUT /user/starred/{owner}/{repo}', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - - -
-
-
-
- -
delete /user/starred/{owner}/{repo}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/user/starred/octocat/hello-world
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /user/starred/{owner}/{repo}', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - - -
-
-
-
-
-

- List repositories starred by a user -

-

Lists repositories a user has starred.

-

You can also find out when stars were created by passing the following custom media type via the Accept header:

-
-
get /users/{username}/starred
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
sortstringquery -

One of created (when the repository was starred) or updated (when it was last pushed to).

- -
directionstringquery -

One of asc (ascending) or desc (descending).

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/starred
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/starred', {
-  username: 'username'
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1296269,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-    "name": "Hello-World",
-    "full_name": "octocat/Hello-World",
-    "owner": {
-      "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
-    },
-    "private": false,
-    "html_url": "https://github.com/octocat/Hello-World",
-    "description": "This your first repo!",
-    "fork": false,
-    "url": "https://api.github.com/repos/octocat/Hello-World",
-    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-    "git_url": "git:github.com/octocat/Hello-World.git",
-    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-    "ssh_url": "git@github.com:octocat/Hello-World.git",
-    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
-    "clone_url": "https://github.com/octocat/Hello-World.git",
-    "mirror_url": "git:git.example.com/octocat/Hello-World",
-    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
-    "svn_url": "https://svn.github.com/octocat/Hello-World",
-    "homepage": "https://github.com",
-    "language": null,
-    "forks_count": 9,
-    "stargazers_count": 80,
-    "watchers_count": 80,
-    "size": 108,
-    "default_branch": "master",
-    "open_issues_count": 0,
-    "is_template": true,
-    "topics": [
-      "octocat",
-      "atom",
-      "electron",
-      "api"
-    ],
-    "has_issues": true,
-    "has_projects": true,
-    "has_wiki": true,
-    "has_pages": false,
-    "has_downloads": true,
-    "archived": false,
-    "disabled": false,
-    "visibility": "public",
-    "pushed_at": "2011-01-26T19:06:43Z",
-    "created_at": "2011-01-26T19:01:12Z",
-    "updated_at": "2011-01-26T19:14:43Z",
-    "permissions": {
-      "admin": false,
-      "push": false,
-      "pull": true
-    },
-    "allow_rebase_merge": true,
-    "template_repository": null,
-    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
-    "allow_squash_merge": true,
-    "delete_branch_on_merge": true,
-    "allow_merge_commit": true,
-    "subscribers_count": 42,
-    "network_count": 0
-  }
-]
-
- - -

Notes

- - - -
-
-
-

Watching

-

Watching a repository registers the user to receive notifications on new discussions, as well as events in the user's activity feed. For simple repository bookmarks, see "Repository starring."

-
-
-

- List watchers -

-

Lists the people watching the specified repository.

-
-
get /repos/{owner}/{repo}/subscribers
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/subscribers
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/subscribers', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "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
-  }
-]
-
- - -

Notes

- - - -
-
-
-
- -
get /repos/{owner}/{repo}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/subscription
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/subscription', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Response if you subscribe to the repository

-
Status: 200 OK
-
{
-  "subscribed": true,
-  "ignored": false,
-  "reason": null,
-  "created_at": "2012-10-06T21:34:12Z",
-  "url": "https://api.github.com/repos/octocat/example/subscription",
-  "repository_url": "https://api.github.com/repos/octocat/example"
-}
-
- -

Response if you don t subscribe to the repository

-
Status: 404 Not Found
-
- - - -
-
-
-
-
-

- Set a repository subscription -

-

If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.

-
-
put /repos/{owner}/{repo}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
subscribedbooleanbody -

Determines if notifications should be received from this repository.

- -
ignoredbooleanbody -

Determines if all notifications should be blocked from this repository.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X PUT \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/subscription \
-  -d '{"subscribed":true}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('PUT /repos/{owner}/{repo}/subscription', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  subscribed: true
-})
-
- - - - -

Default response

-
Status: 200 OK
-
{
-  "subscribed": true,
-  "ignored": false,
-  "reason": null,
-  "created_at": "2012-10-06T21:34:12Z",
-  "url": "https://api.github.com/repos/octocat/example/subscription",
-  "repository_url": "https://api.github.com/repos/octocat/example"
-}
-
- - - -
-
-
-
-
-

- Delete a repository subscription -

-

This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.

-
-
delete /repos/{owner}/{repo}/subscription
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
ownerstringpath - - -
repostringpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/repos/octocat/hello-world/subscription
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /repos/{owner}/{repo}/subscription', {
-  owner: 'octocat',
-  repo: 'hello-world'
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - - -
-
-
-
-
-

- List repositories watched by the authenticated user -

-

Lists repositories the authenticated user is watching.

-
-
get /user/subscriptions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/user/subscriptions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /user/subscriptions')
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1296269,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-    "name": "Hello-World",
-    "full_name": "octocat/Hello-World",
-    "owner": {
-      "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
-    },
-    "private": false,
-    "html_url": "https://github.com/octocat/Hello-World",
-    "description": "This your first repo!",
-    "fork": false,
-    "url": "https://api.github.com/repos/octocat/Hello-World",
-    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-    "git_url": "git:github.com/octocat/Hello-World.git",
-    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-    "ssh_url": "git@github.com:octocat/Hello-World.git",
-    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
-    "clone_url": "https://github.com/octocat/Hello-World.git",
-    "mirror_url": "git:git.example.com/octocat/Hello-World",
-    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
-    "svn_url": "https://svn.github.com/octocat/Hello-World",
-    "homepage": "https://github.com",
-    "language": null,
-    "forks_count": 9,
-    "stargazers_count": 80,
-    "watchers_count": 80,
-    "size": 108,
-    "default_branch": "master",
-    "open_issues_count": 0,
-    "is_template": true,
-    "topics": [
-      "octocat",
-      "atom",
-      "electron",
-      "api"
-    ],
-    "has_issues": true,
-    "has_projects": true,
-    "has_wiki": true,
-    "has_pages": false,
-    "has_downloads": true,
-    "archived": false,
-    "disabled": false,
-    "visibility": "public",
-    "pushed_at": "2011-01-26T19:06:43Z",
-    "created_at": "2011-01-26T19:01:12Z",
-    "updated_at": "2011-01-26T19:14:43Z",
-    "permissions": {
-      "admin": false,
-      "push": false,
-      "pull": true
-    },
-    "template_repository": null,
-    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
-    "delete_branch_on_merge": true,
-    "subscribers_count": 42,
-    "network_count": 0,
-    "license": {
-      "key": "mit",
-      "name": "MIT License",
-      "spdx_id": "MIT",
-      "url": "https://api.github.com/licenses/mit",
-      "node_id": "MDc6TGljZW5zZW1pdA=="
-    }
-  }
-]
-
- - - -
-
-
-
-
-

- List repositories watched by a user -

-

Lists repositories a user is watching.

-
-
get /users/{username}/subscriptions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

Setting to application/vnd.github.v3+json is recommended

- -
usernamestringpath - - -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.v3+json" \
-  https://api.github.com/users/USERNAME/subscriptions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /users/{username}/subscriptions', {
-  username: 'username'
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1296269,
-    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
-    "name": "Hello-World",
-    "full_name": "octocat/Hello-World",
-    "owner": {
-      "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
-    },
-    "private": false,
-    "html_url": "https://github.com/octocat/Hello-World",
-    "description": "This your first repo!",
-    "fork": false,
-    "url": "https://api.github.com/repos/octocat/Hello-World",
-    "archive_url": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
-    "assignees_url": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}",
-    "blobs_url": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
-    "branches_url": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}",
-    "collaborators_url": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
-    "comments_url": "http://api.github.com/repos/octocat/Hello-World/comments{/number}",
-    "commits_url": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}",
-    "compare_url": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
-    "contents_url": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}",
-    "contributors_url": "http://api.github.com/repos/octocat/Hello-World/contributors",
-    "deployments_url": "http://api.github.com/repos/octocat/Hello-World/deployments",
-    "downloads_url": "http://api.github.com/repos/octocat/Hello-World/downloads",
-    "events_url": "http://api.github.com/repos/octocat/Hello-World/events",
-    "forks_url": "http://api.github.com/repos/octocat/Hello-World/forks",
-    "git_commits_url": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
-    "git_refs_url": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
-    "git_tags_url": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
-    "git_url": "git:github.com/octocat/Hello-World.git",
-    "issue_comment_url": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
-    "issue_events_url": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
-    "issues_url": "http://api.github.com/repos/octocat/Hello-World/issues{/number}",
-    "keys_url": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
-    "labels_url": "http://api.github.com/repos/octocat/Hello-World/labels{/name}",
-    "languages_url": "http://api.github.com/repos/octocat/Hello-World/languages",
-    "merges_url": "http://api.github.com/repos/octocat/Hello-World/merges",
-    "milestones_url": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}",
-    "notifications_url": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
-    "pulls_url": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}",
-    "releases_url": "http://api.github.com/repos/octocat/Hello-World/releases{/id}",
-    "ssh_url": "git@github.com:octocat/Hello-World.git",
-    "stargazers_url": "http://api.github.com/repos/octocat/Hello-World/stargazers",
-    "statuses_url": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
-    "subscribers_url": "http://api.github.com/repos/octocat/Hello-World/subscribers",
-    "subscription_url": "http://api.github.com/repos/octocat/Hello-World/subscription",
-    "tags_url": "http://api.github.com/repos/octocat/Hello-World/tags",
-    "teams_url": "http://api.github.com/repos/octocat/Hello-World/teams",
-    "trees_url": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
-    "clone_url": "https://github.com/octocat/Hello-World.git",
-    "mirror_url": "git:git.example.com/octocat/Hello-World",
-    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks",
-    "svn_url": "https://svn.github.com/octocat/Hello-World",
-    "homepage": "https://github.com",
-    "language": null,
-    "forks_count": 9,
-    "stargazers_count": 80,
-    "watchers_count": 80,
-    "size": 108,
-    "default_branch": "master",
-    "open_issues_count": 0,
-    "is_template": true,
-    "topics": [
-      "octocat",
-      "atom",
-      "electron",
-      "api"
-    ],
-    "has_issues": true,
-    "has_projects": true,
-    "has_wiki": true,
-    "has_pages": false,
-    "has_downloads": true,
-    "archived": false,
-    "disabled": false,
-    "visibility": "public",
-    "pushed_at": "2011-01-26T19:06:43Z",
-    "created_at": "2011-01-26T19:01:12Z",
-    "updated_at": "2011-01-26T19:14:43Z",
-    "permissions": {
-      "admin": false,
-      "push": false,
-      "pull": true
-    },
-    "template_repository": null,
-    "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
-    "delete_branch_on_merge": true,
-    "subscribers_count": 42,
-    "network_count": 0,
-    "license": {
-      "key": "mit",
-      "name": "MIT License",
-      "spdx_id": "MIT",
-      "url": "https://api.github.com/licenses/mit",
-      "node_id": "MDc6TGljZW5zZW1pdA=="
-    }
-  }
-]
-
- - -

Notes

- - - -
-
-
-
-
-
-
- -
-

- Did this doc help you? -

-

- - - - -

- - - - - -

- - -

- - -
- -
-
- - - -
-
-
-
-

Ask a human

-

Can't find what you're looking for?

- Contact us -
-
- -
-
-
-
- - - - - -
- - diff --git a/update-urls/testdata/activity_events-original.go b/update-urls/testdata/activity_events-original.go deleted file mode 100644 index eec0f956de7..00000000000 --- a/update-urls/testdata/activity_events-original.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2013 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" -) - -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-an-organization -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-an-organization -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} diff --git a/update-urls/testdata/activity_events-want.go b/update-urls/testdata/activity_events-want.go deleted file mode 100644 index 760793e6985..00000000000 --- a/update-urls/testdata/activity_events-want.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2013 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" -) - -// ListEvents drinks from the firehose of all public events across GitHub. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events -func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { - u, err := addOptions("events", opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListRepositoryEvents lists events for a repository. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-repository-events -func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// Note that ActivityService.ListIssueEventsForRepository was moved to: -// IssuesService.ListRepositoryEvents. - -// ListEventsForRepoNetwork lists public events for a network of repositories. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-network-of-repositories -func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("networks/%v/%v/events", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsForOrganization lists public events for an organization. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-organization-events -func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("orgs/%v/events", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-for-a-user -func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/events/public", user) - } else { - u = fmt.Sprintf("users/%v/events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListEventsReceivedByUser lists the events received by a user. If publicOnly is -// true, only public events will be returned. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-public-events-received-by-a-user -func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { - var u string - if publicOnly { - u = fmt.Sprintf("users/%v/received_events/public", user) - } else { - u = fmt.Sprintf("users/%v/received_events", user) - } - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} - -// ListUserEventsForOrganization provides the user’s organization dashboard. You -// must be authenticated as the user to view this. -// -// GitHub API docs: https://docs.github.com/en/rest/activity/events/#list-organization-events-for-the-authenticated-user -func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { - u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var events []*Event - resp, err := s.client.Do(ctx, req, &events) - if err != nil { - return nil, resp, err - } - - return events, resp, nil -} diff --git a/update-urls/testdata/reactions-original.go b/update-urls/testdata/reactions-original.go deleted file mode 100644 index d3e57bdb819..00000000000 --- a/update-urls/testdata/reactions-original.go +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 `json:"id,omitempty"` - User *User `json:"user,omitempty"` - NodeID *string `json:"node_id,omitempty"` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string `json:"content,omitempty"` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int `json:"total_count,omitempty"` - PlusOne *int `json:"+1,omitempty"` - MinusOne *int `json:"-1,omitempty"` - Laugh *int `json:"laugh,omitempty"` - Confused *int `json:"confused,omitempty"` - Heart *int `json:"heart,omitempty"` - Hooray *int `json:"hooray,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string `url:"content,omitempty"` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} diff --git a/update-urls/testdata/reactions-want.go b/update-urls/testdata/reactions-want.go deleted file mode 100644 index 4e70c458706..00000000000 --- a/update-urls/testdata/reactions-want.go +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright 2016 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" -) - -// ReactionsService provides access to the reactions-related functions in the -// GitHub API. -type ReactionsService service - -// Reaction represents a GitHub reaction. -type Reaction struct { - // ID is the Reaction ID. - ID *int64 `json:"id,omitempty"` - User *User `json:"user,omitempty"` - NodeID *string `json:"node_id,omitempty"` - // Content is the type of reaction. - // Possible values are: - // "+1", "-1", "laugh", "confused", "heart", "hooray". - Content *string `json:"content,omitempty"` -} - -// Reactions represents a summary of GitHub reactions. -type Reactions struct { - TotalCount *int `json:"total_count,omitempty"` - PlusOne *int `json:"+1,omitempty"` - MinusOne *int `json:"-1,omitempty"` - Laugh *int `json:"laugh,omitempty"` - Confused *int `json:"confused,omitempty"` - Heart *int `json:"heart,omitempty"` - Hooray *int `json:"hooray,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (r Reaction) String() string { - return Stringify(r) -} - -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { - // Content restricts the returned comment reactions to only those with the given type. - // Omit this parameter to list all reactions to a commit comment. - // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content string `url:"content,omitempty"` - - ListOptions -} - -// ListCommentReactions lists the reactions for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-commit-comment -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateCommentReaction creates a reaction for a commit comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-commit-comment -func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteCommentReaction deletes the reaction for a commit comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-commit-comment-reaction -func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, u) -} - -// ListIssueReactions lists the reactions for an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueReaction creates a reaction for an issue. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue -func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueReaction deletes the reaction to an issue. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueReactionByID deletes the reaction to an issue by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-reaction -func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListIssueCommentReactions lists the reactions for an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-an-issue-comment -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateIssueCommentReaction creates a reaction for an issue comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-an-issue-comment -func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteIssueCommentReaction deletes the reaction to an issue comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-an-issue-comment-reaction -func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListPullRequestCommentReactions lists the reactions for a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-pull-request-review-comment -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreatePullRequestCommentReaction creates a reaction for a pull request review comment. -// Note that if you have already created a reaction of type content, the -// previously created reaction will be returned with Status: 200 OK. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-pull-request-review-comment -func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-a-pull-request-comment-reaction -func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { - url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionReactions lists the reactions for a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-legacy -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// CreateTeamDiscussionReaction creates a reaction for a team discussion. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-legacy -func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionReaction deletes the reaction to a team discussion. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-reaction -func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#list-reactions-for-a-team-discussion-comment-legacy -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - var m []*Reaction - resp, err := s.client.Do(ctx, req, &m) - if err != nil { - return nil, nil, err - } - return m, resp, nil -} - -// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. -// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray". -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#create-reaction-for-a-team-discussion-comment-legacy -func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { - u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - - body := &Reaction{Content: String(content)} - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - req.Header.Set("Accept", mediaTypeReactionsPreview) - - m := &Reaction{} - resp, err := s.client.Do(ctx, req, m) - if err != nil { - return nil, resp, err - } - - return m, resp, nil -} - -// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. -// -// GitHub API docs: https://docs.github.com/en/rest/reactions/#delete-team-discussion-comment-reaction -func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { - url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) - - return s.deleteReaction(ctx, url) -} - -func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) { - req, err := s.client.NewRequest(http.MethodDelete, url, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeReactionsPreview) - - return s.client.Do(ctx, req, nil) -} diff --git a/update-urls/testdata/reactions.html b/update-urls/testdata/reactions.html deleted file mode 100644 index 2669f856c09..00000000000 --- a/update-urls/testdata/reactions.html +++ /dev/null @@ -1,5690 +0,0 @@ - - - Reactions - GitHub Docs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - -
-
- -
- - - Article version: GitHub.com - - - - -
- - -
-
- - -
-
- -
- -
-
-

Reactions

-
- -
-
- - - - - - - - -
-
-
- -

In this article

- - -
- -
-

- Did this doc help you? -

-

- - - - -

- - - - - -

- - -

- - -
- -
-
-
-
- -

Reaction types

-

When creating a reaction, the allowed values for the content parameter are as follows (with the corresponding emoji for reference):

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
contentemoji
+1👍
-1👎
laugh😄
confused😕
heart❤️
hooray🎉
rocket🚀
eyes👀
-
-
-

- List reactions for a team discussion comment -

-

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

-

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

-
-
get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
comment_numberintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  comment_number: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a team discussion comment -

-

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

-

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

-
-
post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
comment_numberintegerpath - - -
contentstringbody -

Required. The reaction type to add to the team discussion comment.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  comment_number: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete team discussion comment reaction -

-

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

-

Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

-
-
delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
comment_numberintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/comments/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  comment_number: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for a team discussion -

-

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

-

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

-
-
get /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a team discussion -

-

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

-

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

-
-
post /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
contentstringbody -

Required. The reaction type to add to the team discussion.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete team discussion reaction -

-

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

-

Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

-
-
delete /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
orgstringpath - - -
team_slugstringpath - - -
discussion_numberintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}', {
-  org: 'org',
-  team_slug: 'team_slug',
-  discussion_number: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete a reaction (Legacy) -

-

Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

-

OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.

-
-
delete /reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /reactions/{reaction_id}', {
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for a commit comment -

-

List the reactions to a commit comment.

-
-
get /repos/{owner}/{repo}/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a commit comment.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/comments/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a commit comment -

-

Create a reaction to a commit comment. A response with a Status: 200 OK means that you already added the reaction type to this commit comment.

-
-
post /repos/{owner}/{repo}/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringbody -

Required. The reaction type to add to the commit comment.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/comments/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /repos/{owner}/{repo}/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete a commit comment reaction -

-

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

-

Delete a reaction to a commit comment.

-
-
delete /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/comments/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for an issue comment -

-

List the reactions to an issue comment.

-
-
get /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to an issue comment.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for an issue comment -

-

Create a reaction to an issue comment. A response with a Status: 200 OK means that you already added the reaction type to this issue comment.

-
-
post /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringbody -

Required. The reaction type to add to the issue comment.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete an issue comment reaction -

-

Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

-

Delete a reaction to an issue comment.

-
-
delete /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/comments/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for an issue -

-

List the reactions to an issue.

-
-
get /repos/{owner}/{repo}/issues/{issue_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
issue_numberintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to an issue.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  issue_number: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for an issue -

-

Create a reaction to an issue. A response with a Status: 200 OK means that you already added the reaction type to this issue.

-
-
post /repos/{owner}/{repo}/issues/{issue_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
issue_numberintegerpath - - -
contentstringbody -

Required. The reaction type to add to the issue.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  issue_number: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete an issue reaction -

-

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

-

Delete a reaction to an issue.

-
-
delete /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
issue_numberintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/issues/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  issue_number: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
- -
get /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a pull request review comment.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a pull request review comment -

-

Create a reaction to a pull request review comment. A response with a Status: 200 OK means that you already added the reaction type to this pull request review comment.

-
-
post /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
contentstringbody -

Required. The reaction type to add to the pull request review comment.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Delete a pull request comment reaction -

-

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

-

Delete a reaction to a pull request review comment.

-
-
delete /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
ownerstringpath - - -
repostringpath - - -
comment_idintegerpath - - -
reaction_idintegerpath - - -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X DELETE \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/repos/octocat/hello-world/pulls/comments/42/reactions/42
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}', {
-  owner: 'octocat',
-  repo: 'hello-world',
-  comment_id: 42,
-  reaction_id: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default Response

-
Status: 204 No Content
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for a team discussion comment (Legacy) -

-

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

-

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

-
-
get /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
team_idintegerpath - - -
discussion_numberintegerpath - - -
comment_numberintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/teams/42/discussions/42/comments/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
-  team_id: 42,
-  discussion_number: 42,
-  comment_number: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a team discussion comment (Legacy) -

-

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion comment endpoint.

-

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion comment.

-
-
post /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
team_idintegerpath - - -
discussion_numberintegerpath - - -
comment_numberintegerpath - - -
contentstringbody -

Required. The reaction type to add to the team discussion comment.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/teams/42/discussions/42/comments/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', {
-  team_id: 42,
-  discussion_number: 42,
-  comment_number: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- List reactions for a team discussion (Legacy) -

-

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

-

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

-
-
get /teams/{team_id}/discussions/{discussion_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
team_idintegerpath - - -
discussion_numberintegerpath - - -
contentstringquery -

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

- -
per_pageintegerquery -

Results per page (max 100)

- -
pageintegerquery -

Page number of the results to fetch.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/teams/42/discussions/42/reactions
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('GET /teams/{team_id}/discussions/{discussion_number}/reactions', {
-  team_id: 42,
-  discussion_number: 42,
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 200 OK
-
[
-  {
-    "id": 1,
-    "node_id": "MDg6UmVhY3Rpb24x",
-    "user": {
-      "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
-    },
-    "content": "heart",
-    "created_at": "2016-05-20T20:09:31Z"
-  }
-]
-
- - -

Notes

- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-

- Create reaction for a team discussion (Legacy) -

-

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

-

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with a Status: 200 OK means that you already added the reaction type to this team discussion.

-
-
post /teams/{team_id}/discussions/{discussion_number}/reactions
-
- -

- Parameters -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInDescription
acceptstringheader -

This API is under preview and subject to change.

- - - - See preview notice. - - -
team_idintegerpath - - -
discussion_numberintegerpath - - -
contentstringbody -

Required. The reaction type to add to the team discussion.

- -
- - -

- Code samples -

- - -
- - Shell - -
-
curl \
-  -X POST \
-  -H "Accept: application/vnd.github.squirrel-girl-preview+json" \
-  https://api.github.com/teams/42/discussions/42/reactions \
-  -d '{"content":"content"}'
-
- - - -
- - JavaScript (@octokit/core.js) - -
-
await octokit.request('POST /teams/{team_id}/discussions/{discussion_number}/reactions', {
-  team_id: 42,
-  discussion_number: 42,
-  content: 'content',
-  mediaType: {
-    previews: [
-      'squirrel-girl'
-    ]
-  }
-})
-
- - - - -

Default response

-
Status: 201 Created
-
{
-  "id": 1,
-  "node_id": "MDg6UmVhY3Rpb24x",
-  "user": {
-    "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
-  },
-  "content": "heart",
-  "created_at": "2016-05-20T20:09:31Z"
-}
-
- - - -

- - Preview notice - -

- -
-

An additional reactions object in the issue comment payload is currently available for developers to preview. During -the preview period, the APIs may change without advance notice. Please see the blog -post for full details.

-

To access the API you must provide a custom media type in the Accept header:

-
application/vnd.github.squirrel-girl-preview
-
-

The reactions key will have the following payload where url can be used to construct the API location for listing -and creating reactions.

-
{
-  "total_count": 5,
-  "+1": 3,
-  "-1": 1,
-  "laugh": 0,
-  "confused": 0,
-  "heart": 1,
-  "hooray": 0,
-  "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/reactions"
-}
-
- ☝️ This header is required. -
- - -
-
-
-
-
-
-
- -
-

- Did this doc help you? -

-

- - - - -

- - - - - -

- - -

- - -
- -
-
- - - -
-
-
-
-

Ask a human

-

Can't find what you're looking for?

- Contact us -
-
- -
-
-
-
- - - - - -
- - From 462108e1ca505321ce97bde95ea0150b4def2baf Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 15:24:23 -0500 Subject: [PATCH 03/34] trigger From 67d827bcdd22b85d67677c70ae3365edfadd1dfa Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 16:18:58 -0500 Subject: [PATCH 04/34] minor refactor --- script/metadata | 4 +- tools/{ => cmd}/metadata/metadata.go | 0 tools/internal/internal.go | 51 ++++++++------- tools/internal/metadata.go | 94 ++++++++-------------------- tools/internal/openapi.go | 32 +++++----- tools/internal/openapi_test.go | 6 +- tools/internal/validate.go | 16 ++--- 7 files changed, 77 insertions(+), 126 deletions(-) rename tools/{ => cmd}/metadata/metadata.go (100%) diff --git a/script/metadata b/script/metadata index 05f440b68e2..12d58555a8d 100755 --- a/script/metadata +++ b/script/metadata @@ -1,5 +1,5 @@ #!/bin/sh -#/ metadata builds and runs tools/metadata with the given arguments. +#/ metadata builds and runs tools/cmd/metadata with the given arguments. set -e @@ -9,7 +9,7 @@ mkdir -p "$REPO_DIR"/bin ( cd "$REPO_DIR"/tools - go build -o "$REPO_DIR"/bin/metadata ./metadata + go build -o "$REPO_DIR"/bin/metadata ./cmd/metadata ) exec "$REPO_DIR"/bin/metadata "$@" diff --git a/tools/metadata/metadata.go b/tools/cmd/metadata/metadata.go similarity index 100% rename from tools/metadata/metadata.go rename to tools/cmd/metadata/metadata.go diff --git a/tools/internal/internal.go b/tools/internal/internal.go index 0dee2861793..06800481fa9 100644 --- a/tools/internal/internal.go +++ b/tools/internal/internal.go @@ -34,6 +34,9 @@ func ProjRootDir(dir string) (string, error) { return ProjRootDir(parent) } +// isGoGithubRoot determines whether dir is the repo root of go-github. It does +// this by checking whether go.mod exists and contains a module directive with +// the path "github.com/google/go-github/vNN". func isGoGithubRoot(dir string) (bool, error) { filename := filepath.Join(dir, "go.mod") b, err := os.ReadFile(filename) @@ -59,30 +62,22 @@ func isGoGithubRoot(dir string) (bool, error) { return base == "github.com/google/go-github", nil } -func ExitErr(err error) { - if err == nil { - return - } - fmt.Fprintf(os.Stderr, "error: %v\n", err) - os.Exit(1) -} - -type ServiceMethod struct { - ReceiverName string - MethodName string - Filename string +type serviceMethod struct { + receiverName string + methodName string + filename string } -func (m *ServiceMethod) Name() string { - return fmt.Sprintf("%s.%s", m.ReceiverName, m.MethodName) +func (m *serviceMethod) name() string { + return fmt.Sprintf("%s.%s", m.receiverName, m.methodName) } -func GetServiceMethods(dir string) ([]*ServiceMethod, error) { +func getServiceMethods(dir string) ([]*serviceMethod, error) { dirEntries, err := os.ReadDir(dir) if err != nil { return nil, err } - var serviceMethods []*ServiceMethod + var serviceMethods []*serviceMethod for _, filename := range dirEntries { m, err := getServiceMethodsFromFile(filepath.Join(dir, filename.Name())) if err != nil { @@ -91,15 +86,15 @@ func GetServiceMethods(dir string) ([]*ServiceMethod, error) { serviceMethods = append(serviceMethods, m...) } sort.Slice(serviceMethods, func(i, j int) bool { - if serviceMethods[i].Filename != serviceMethods[j].Filename { - return serviceMethods[i].Filename < serviceMethods[j].Filename + if serviceMethods[i].filename != serviceMethods[j].filename { + return serviceMethods[i].filename < serviceMethods[j].filename } - return serviceMethods[i].Name() < serviceMethods[j].Name() + return serviceMethods[i].name() < serviceMethods[j].name() }) return serviceMethods, nil } -func getServiceMethodsFromFile(filename string) ([]*ServiceMethod, error) { +func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { if !strings.HasSuffix(filename, ".go") || strings.HasSuffix(filename, "_test.go") { return nil, nil @@ -114,7 +109,7 @@ func getServiceMethodsFromFile(filename string) ([]*ServiceMethod, error) { if df.Name.Name != "github" { return nil, nil } - var serviceMethods []*ServiceMethod + var serviceMethods []*serviceMethod dst.Inspect(df, func(n dst.Node) bool { decl, ok := n.(*dst.FuncDecl) if !ok { @@ -133,20 +128,24 @@ func getServiceMethodsFromFile(filename string) ([]*ServiceMethod, error) { } receiverName := id.Name methodName := decl.Name.Name + + // We only want exported methods on exported types. + // The receiver must either end with Service or be named Client. + // The exception is github.go, which contains Client methods we want to skip. + if !dst.IsExported(methodName) || !dst.IsExported(receiverName) { return true } if receiverName != "Client" && !strings.HasSuffix(receiverName, "Service") { return true } - // Skip Client methods in github.go if receiverName == "Client" && filepath.Base(filename) == "github.go" { return true } - serviceMethods = append(serviceMethods, &ServiceMethod{ - ReceiverName: receiverName, - MethodName: methodName, - Filename: filename, + serviceMethods = append(serviceMethods, &serviceMethod{ + receiverName: receiverName, + methodName: methodName, + filename: filename, }) return true }) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index cd8df30d069..a5840b00041 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io/fs" - "net/url" "os" "path/filepath" "regexp" @@ -102,7 +101,7 @@ func (o *Operation) Summary() string { return o.OpenAPI.Summary } -func (o *Operation) Less(other *Operation) bool { +func (o *Operation) less(other *Operation) bool { if o.EndpointURL() != other.EndpointURL() { return o.EndpointURL() < other.EndpointURL() } @@ -111,7 +110,7 @@ func (o *Operation) Less(other *Operation) bool { // matchesOpenAPIDesc returns true if this is describing the same operation as desc // based on endpoint and method. -func (o *Operation) matchesOpenAPIDesc(desc *OperationDesc) bool { +func (o *Operation) matchesOpenAPIDesc(desc OperationDesc) bool { if o.Method() != desc.Method { return false } @@ -175,11 +174,14 @@ func (m *Metadata) SaveFile(filename string) (errOut error) { return enc.Encode(m) } -func (m *Metadata) AddOperation(filename string, desc *OperationDesc) { - update := func(op *Operation) { +func (m *Metadata) addOperation(filename string, desc OperationDesc) { + for _, op := range m.Operations { + if !op.matchesOpenAPIDesc(desc) { + continue + } if len(op.OpenAPIFiles) == 0 { op.OpenAPIFiles = append(op.OpenAPIFiles, filename) - op.OpenAPI = *desc + op.OpenAPI = desc return } // just append to files, but only add the first ghes file @@ -193,51 +195,15 @@ func (m *Metadata) AddOperation(filename string, desc *OperationDesc) { } } op.OpenAPIFiles = append(op.OpenAPIFiles, filename) - } - for _, op := range m.Operations { - if op.matchesOpenAPIDesc(desc) { - update(op) - return - } + return } m.Operations = append(m.Operations, &Operation{ OpenAPIFiles: []string{filename}, - OpenAPI: *desc, + OpenAPI: desc, }) } -func (m *Metadata) OperationsByDocURL(docURL string) *Operation { - wantIdx := urlIndex(docURL) - var found []*Operation - for _, op := range m.Operations { - hasIdx := urlIndex(op.DocumentationURL()) - if hasIdx == wantIdx { - found = append(found, op) - } - } - switch len(found) { - case 0: - return nil - case 1: - return found[0] - } - fmt.Println("found multiple operations for", wantIdx) - for _, op := range found { - fmt.Println(" ", op.OpenAPI.EndpointURL, op.OpenAPI.Method) - } - return nil -} - -func (m *Metadata) DocLinksForMethod(method string) []string { - var links []string - for _, op := range m.OperationsForMethod(method) { - links = append(links, op.DocumentationURL()) - } - sort.Strings(links) - return links -} - -func (m *Metadata) OperationsForMethod(method string) []*Operation { +func (m *Metadata) operationsForMethod(method string) []*Operation { var operations []*Operation for _, op := range m.Operations { if !slices.Contains(op.GoMethods, method) { @@ -246,13 +212,13 @@ func (m *Metadata) OperationsForMethod(method string) []*Operation { operations = append(operations, op) } sort.Slice(operations, func(i, j int) bool { - return operations[i].Less(operations[j]) + return operations[i].less(operations[j]) }) return operations } func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, ref string) error { - descs, err := GetDescriptions(ctx, client, ref) + descs, err := getDescriptions(ctx, client, ref) if err != nil { return err } @@ -260,13 +226,13 @@ func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, op.OpenAPIFiles = op.OpenAPIFiles[:0] } for _, desc := range descs { - for p, pathItem := range desc.Description.Paths { + for p, pathItem := range desc.description.Paths { for method, op := range pathItem.Operations() { docURL := "" if op.ExternalDocs != nil { docURL = op.ExternalDocs.URL } - m.AddOperation(desc.Filename, &OperationDesc{ + m.addOperation(desc.filename, OperationDesc{ Method: method, EndpointURL: p, DocumentationURL: docURL, @@ -276,7 +242,7 @@ func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, } } sort.Slice(m.Operations, func(i, j int) bool { - return m.Operations[i].Less(m.Operations[j]) + return m.Operations[i].less(m.Operations[j]) }) return nil } @@ -301,7 +267,7 @@ func UpdateDocLinks(meta *Metadata, dir string) error { if err != nil { return err } - updatedContent, err := UpdateDocsLinksInFile(meta, content) + updatedContent, err := updateDocsLinksInFile(meta, content) if err != nil { return err } @@ -317,8 +283,8 @@ func UpdateDocLinks(meta *Metadata, dir string) error { }) } -// UpdateDocsLinksInFile updates in the code comments in content with doc urls from metadata. -func UpdateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { +// updateDocsLinksInFile updates in the code comments in content with doc urls from metadata. +func updateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { df, err := decorator.Parse(content) if err != nil { return nil, err @@ -364,7 +330,12 @@ func UpdateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { starts = starts[:len(starts)-1] } - docLinks := metadata.DocLinksForMethod(strings.Join([]string{receiverType, methodName}, ".")) + var links []string + for _, op := range metadata.operationsForMethod(strings.Join([]string{receiverType, methodName}, ".")) { + links = append(links, op.DocumentationURL()) + } + sort.Strings(links) + docLinks := links // add an empty line before adding doc links if len(docLinks) > 0 { @@ -385,18 +356,3 @@ func UpdateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { } return buf.Bytes(), nil } - -// urlIndex returns the part of the path that comes after /rest/ followed by the fragment. -func urlIndex(s string) string { - u, err := url.Parse(s) - if err != nil { - return "" - } - restIdx := strings.Index(u.Path, "/rest/") - if restIdx == -1 { - return "" - } - p := u.Path[restIdx+len("/rest/"):] - p = strings.TrimSuffix(p, "/") - return p + "#" + u.Fragment -} diff --git a/tools/internal/openapi.go b/tools/internal/openapi.go index f40fb2c8650..3527fb66d7c 100644 --- a/tools/internal/openapi.go +++ b/tools/internal/openapi.go @@ -19,10 +19,10 @@ const ( descriptionsPath = "descriptions" ) -type OpenapiFile struct { - Description openapi3.T - Filename string - plan string +type openapiFile struct { + description *openapi3.T + filename string + plan string planIdx int releaseMajor int releaseMinor int @@ -33,12 +33,12 @@ type contentsClient interface { GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) } -func (o *OpenapiFile) loadDescription(ctx context.Context, client contentsClient, gitRef string) error { +func (o *openapiFile) loadDescription(ctx context.Context, client contentsClient, gitRef string) error { contents, resp, err := client.DownloadContents( ctx, descriptionsOwnerName, descriptionsRepoName, - o.Filename, + o.filename, &github.RepositoryContentGetOptions{Ref: gitRef}, ) if err != nil { @@ -55,19 +55,15 @@ func (o *OpenapiFile) loadDescription(ctx context.Context, client contentsClient if err != nil { return err } - desc, err := openapi3.NewLoader().LoadFromData(b) - if err != nil { - return err - } - o.Description = *desc - return nil + o.description, err = openapi3.NewLoader().LoadFromData(b) + return err } // less sorts by the following rules: // - planIdx ascending // - releaseMajor descending // - releaseMinor descending -func (o *OpenapiFile) less(other *OpenapiFile) bool { +func (o *openapiFile) less(other *openapiFile) bool { if o.planIdx != other.planIdx { return o.planIdx < other.planIdx } @@ -83,14 +79,14 @@ var dirPatterns = []*regexp.Regexp{ regexp.MustCompile(`^(?Pghes)(-(?P\d+)\.(?P\d+))?$`), } -// GetDescriptions loads OpenapiFiles for all the OpenAPI 3.0 description files in github/rest-api-description. +// getDescriptions loads OpenapiFiles for all the OpenAPI 3.0 description files in github/rest-api-description. // This assumes that all directories in "descriptions/" contain OpenAPI 3.0 description files with the same // name as the directory (plus the ".json" extension). For example, "descriptions/api.github.com/api.github.com.json". // Results are sorted by these rules: // - Directories that don't match any of the patterns in dirPatterns are removed. // - Directories are sorted by the pattern that matched in the same order they appear in dirPatterns. // - Directories are then sorted by major and minor version in descending order. -func GetDescriptions(ctx context.Context, client contentsClient, gitRef string) ([]*OpenapiFile, error) { +func getDescriptions(ctx context.Context, client contentsClient, gitRef string) ([]*openapiFile, error) { _, dir, resp, err := client.GetContents( ctx, descriptionsOwnerName, @@ -104,7 +100,7 @@ func GetDescriptions(ctx context.Context, client contentsClient, gitRef string) if resp.StatusCode != 200 { return nil, fmt.Errorf("unexpected status code: %s", resp.Status) } - files := make([]*OpenapiFile, 0, len(dir)) + files := make([]*openapiFile, 0, len(dir)) for _, d := range dir { for i, pattern := range dirPatterns { m := pattern.FindStringSubmatch(d.GetName()) @@ -118,8 +114,8 @@ func GetDescriptions(ctx context.Context, client contentsClient, gitRef string) continue } filename := fmt.Sprintf("descriptions/%s/%s.json", d.GetName(), d.GetName()) - files = append(files, &OpenapiFile{ - Filename: filename, + files = append(files, &openapiFile{ + filename: filename, plan: plan, planIdx: i, releaseMajor: major, diff --git a/tools/internal/openapi_test.go b/tools/internal/openapi_test.go index 27108840c51..59f4f7b11e0 100644 --- a/tools/internal/openapi_test.go +++ b/tools/internal/openapi_test.go @@ -69,11 +69,11 @@ func TestGetDescriptions(t *testing.T) { "descriptions/ghes-3.2/ghes-3.2.json", "descriptions/ghes-3.1/ghes-3.1.json", } - got, err := GetDescriptions(ctx, client, "main") + got, err := getDescriptions(ctx, client, "main") require.NoError(t, err) require.Equal(t, len(wantFiles), len(got)) for i := range wantFiles { - require.Equal(t, wantFiles[i], got[i].Filename) - require.Equal(t, "1.2.3", got[i].Description.Info.Version) + require.Equal(t, wantFiles[i], got[i].filename) + require.Equal(t, "1.2.3", got[i].description.Info.Version) } } diff --git a/tools/internal/validate.go b/tools/internal/validate.go index 4fa5ad23d4e..4d06a135a77 100644 --- a/tools/internal/validate.go +++ b/tools/internal/validate.go @@ -15,7 +15,7 @@ func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { } var result []string for _, m := range undocumentedMethods { - msg := fmt.Sprintf("Undocumented method %s. Please add it to metadata.", m.Name()) + msg := fmt.Sprintf("Undocumented method %s. Please add it to metadata.", m.name()) result = append(result, msg) } metaMethodMap := map[string]bool{} @@ -44,18 +44,18 @@ func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { } // getUndocumentedMethods returns a list of methods that are not mapped to any operation in metadata.yaml -func getUndocumentedMethods(dir string, metadata *Metadata) ([]*ServiceMethod, error) { - var result []*ServiceMethod - methods, err := GetServiceMethods(dir) +func getUndocumentedMethods(dir string, metadata *Metadata) ([]*serviceMethod, error) { + var result []*serviceMethod + methods, err := getServiceMethods(dir) if err != nil { return nil, err } for _, method := range methods { - ops := metadata.OperationsForMethod(method.Name()) + ops := metadata.operationsForMethod(method.name()) if len(ops) > 0 { continue } - if slices.Contains(metadata.UndocumentedMethods, method.Name()) { + if slices.Contains(metadata.UndocumentedMethods, method.name()) { continue } result = append(result, method) @@ -67,12 +67,12 @@ func getUndocumentedMethods(dir string, metadata *Metadata) ([]*ServiceMethod, e func missingMethods(dir string, methods []string) ([]string, error) { var result []string existingMap := map[string]bool{} - sm, err := GetServiceMethods(dir) + sm, err := getServiceMethods(dir) if err != nil { return nil, err } for _, method := range sm { - existingMap[method.Name()] = true + existingMap[method.name()] = true } for _, m := range methods { if !existingMap[m] { From 73e22207166fd2b55097e91c41de2b28ad9bf4fa Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 16:22:09 -0500 Subject: [PATCH 05/34] go fmt --- tools/internal/openapi.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/internal/openapi.go b/tools/internal/openapi.go index 3527fb66d7c..9b1d2c3b9b4 100644 --- a/tools/internal/openapi.go +++ b/tools/internal/openapi.go @@ -20,9 +20,9 @@ const ( ) type openapiFile struct { - description *openapi3.T - filename string - plan string + description *openapi3.T + filename string + plan string planIdx int releaseMajor int releaseMinor int From d6360bddd415831e1a45b1cf76f04a2029d69b71 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 17:11:54 -0500 Subject: [PATCH 06/34] update tools module --- tools/cmd/metadata/metadata.go | 3 ++- tools/go.mod | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/cmd/metadata/metadata.go b/tools/cmd/metadata/metadata.go index d4efa69ab5d..309edc61d5a 100644 --- a/tools/cmd/metadata/metadata.go +++ b/tools/cmd/metadata/metadata.go @@ -8,8 +8,9 @@ import ( "path/filepath" "strings" + "tools/internal" + "github.com/alecthomas/kong" - "github.com/google/go-github/tools/internal" "github.com/google/go-github/v55/github" ) diff --git a/tools/go.mod b/tools/go.mod index e384d36518d..bda14ac3b13 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,4 +1,4 @@ -module github.com/google/go-github/tools +module tools go 1.21 From 7f4b553976d31ef0f16ea0e2d9e9ef662f9d38d4 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 17:29:54 -0500 Subject: [PATCH 07/34] revert script dir --- .github/workflows/linter.yml | 2 +- .github/workflows/tests.yml | 3 ++- .gitignore | 1 - github/github.go | 2 +- script/diff-check | 50 ------------------------------------ script/golangci-lint | 22 ---------------- script/lint | 27 ------------------- script/metadata | 15 ----------- 8 files changed, 4 insertions(+), 118 deletions(-) delete mode 100755 script/diff-check delete mode 100755 script/golangci-lint delete mode 100755 script/lint delete mode 100755 script/metadata diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c7e8b037605..6e06208e727 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -30,6 +30,6 @@ jobs: - name: golangci-lint ${{ matrix.working-directory }} uses: golangci/golangci-lint-action@v3 with: - version: v1.54.2 + version: latest working-directory: ${{ matrix.working-directory}} args: --verbose diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa0983a5ea8..6e88b232e95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,4 +84,5 @@ jobs: - name: Validate metadata.yaml if: ${{ matrix.update-coverage }} - run: script/metadata validate + working-directory: tools + run: go run ./cmd/metadata validate diff --git a/.gitignore b/.gitignore index 8e43a1dd010..af5b765077b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.sh *.test coverage.out -/bin # intellij files .idea/ diff --git a/github/github.go b/github/github.go index edbf3484c2c..aa01440a4f3 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate ../script/metadata update-urls +//go:generate go run -C ../tools ./cmd/metadata update-urls package github diff --git a/script/diff-check b/script/diff-check deleted file mode 100755 index 486cee6b453..00000000000 --- a/script/diff-check +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -#/ diff-check checks whether running the given command results in changes to the repo. -#/ The given command is run with a working directory that is the top level of the repo in a -#/ temporary git worktree. The command exits non-zero and outputs the diff if the command results -#/ in changes to the worktree. -#/ -#/ Usage: script/diff-check -#/ -#/ Example: -#/ script/diff-check 'go generate ./...' - -set -e - -CDPATH="" cd -- "$(dirname -- "$0")/.." - -usage() { - grep '^#/' "$0" | cut -c4- - exit 1 -} - -if [ "$1" = "--help" ]; then - usage -fi - -if [ $# -ne 1 ]; then - usage -fi - -GENTEMP="$(mktemp -d)" -git worktree add -q --detach "$GENTEMP" -trap 'git worktree remove -f "$GENTEMP"; rm -rf "$GENTEMP"' EXIT -for f in $(git ls-files -com --exclude-standard); do - target="$GENTEMP/$f" - mkdir -p "$(dirname -- "$target")" - cp "$f" "$target" -done -if [ -f "$(pwd)"/bin ]; then - ln -s "$(pwd)"/bin "$GENTEMP"/bin -fi - -cd "$GENTEMP" -git add . -git -c user.name='bot' -c user.email='bot@localhost' commit -m "diff-check" -q --allow-empty -sh -c "$*" -git add -N . -[ -z "$(git status --porcelain)" ] || { - echo "$* resulted in changes." 1>&2 - git diff -u . "$GENTEMP" - exit 1 -} diff --git a/script/golangci-lint b/script/golangci-lint deleted file mode 100755 index fc3912a30c4..00000000000 --- a/script/golangci-lint +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -#/ golangci-lint installs golangci-lint and runs it with the given arguments. - -set -e - -GOLANGCI_LINT_VERSION="v1.54.2" - -REPO_DIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)" -export GOBIN="$REPO_DIR"/bin -mkdir -p "$GOBIN" - -install_golangci_lint() { - if [ -f "$GOBIN"/golangci-lint ]; then - if "$GOBIN"/golangci-lint --version | grep -q "$GOLANGCI_LINT_VERSION"; then - return - fi - fi - go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} -} - -install_golangci_lint -exec "$GOBIN"/golangci-lint "$@" diff --git a/script/lint b/script/lint deleted file mode 100755 index ddc005ba63d..00000000000 --- a/script/lint +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -#/ lint approximates the linting done in CI. - -set -e - -CDPATH="" cd -- "$(dirname -- "$0")/.." -REPO_DIR="$(pwd -P)" - -MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname)" - -for dir in $MOD_DIRS; do - # skip example/newreposecretwithlibsodium because it requires libsodium - if [ "$dir" = "example/newreposecretwithlibsodium" ]; then - continue - fi - echo "linting $dir" - ( - cd "$dir" - "$REPO_DIR"/script/golangci-lint run --path-prefix="$dir" - ) -done - -echo validating metadata.yaml -script/metadata validate - -echo validating generated files are up to date -script/diff-check 'go generate ./...' diff --git a/script/metadata b/script/metadata deleted file mode 100755 index 12d58555a8d..00000000000 --- a/script/metadata +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -#/ metadata builds and runs tools/cmd/metadata with the given arguments. - -set -e - -REPO_DIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)" - -mkdir -p "$REPO_DIR"/bin - -( - cd "$REPO_DIR"/tools - go build -o "$REPO_DIR"/bin/metadata ./cmd/metadata -) - -exec "$REPO_DIR"/bin/metadata "$@" From 4aa1c119df60c60c06136223c58c36e31d80692e Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 17:34:52 -0500 Subject: [PATCH 08/34] restore gen-accessors.go and gen-stringify-test.go --- github/gen-accessors.go | 9 ++++++++- github/gen-stringify-test.go | 9 ++++++++- tools/internal/metadata.go | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 59b981dba8d..4bc22acdc15 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -196,11 +196,18 @@ func (t *templateData) dump() error { } logf("Writing %v...", filename) + if err := os.Chmod(filename, 0644); err != nil { + return fmt.Errorf("os.Chmod(%q, 0644): %v", filename, err) + } - if err := os.WriteFile(filename, clean, 0644); err != nil { + if err := os.WriteFile(filename, clean, 0444); err != nil { return err } + if err := os.Chmod(filename, 0444); err != nil { + return fmt.Errorf("os.Chmod(%q, 0444): %v", filename, err) + } + return nil } diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 018d5ac335c..5a42082b93d 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -351,11 +351,18 @@ func (t *templateData) dump() error { } logf("Writing %v...", t.filename) + if err := os.Chmod(t.filename, 0644); err != nil { + return fmt.Errorf("os.Chmod(%q, 0644): %v", t.filename, err) + } - if err := os.WriteFile(t.filename, clean, 0644); err != nil { + if err := os.WriteFile(t.filename, clean, 0444); err != nil { return err } + if err := os.Chmod(t.filename, 0444); err != nil { + return fmt.Errorf("os.Chmod(%q, 0444): %v", t.filename, err) + } + return nil } diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index a5840b00041..18af6ec4bc5 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -271,6 +271,9 @@ func UpdateDocLinks(meta *Metadata, dir string) error { if err != nil { return err } + if bytes.Equal(content, updatedContent) { + return nil + } f, err := os.Create(path) if err != nil { return err From a1ba628fec39edf670587cbe832061c61022b82b Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 17:38:16 -0500 Subject: [PATCH 09/34] restore .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index af5b765077b..704f4ef5b54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.sh *.test coverage.out - # intellij files .idea/ vendor/ From 7b7df59ff0683e56456d559e10528d75d2654069 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 8 Sep 2023 17:48:04 -0500 Subject: [PATCH 10/34] go 1.20 --- .github/workflows/linter.yml | 3 --- .github/workflows/tests.yml | 3 --- tools/go.mod | 7 ++++--- tools/go.sum | 18 ++++++------------ tools/internal/metadata.go | 2 +- tools/internal/validate.go | 3 ++- 6 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6e06208e727..5443eabfda2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -23,9 +23,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version: 1.x - name: golangci-lint ${{ matrix.working-directory }} uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e88b232e95..cb9c7e437bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,7 +58,6 @@ jobs: restore-keys: ${{ runner.os }}-go- - name: Ensure go generate produces a zero diff - if: ${{ matrix.update-coverage }} shell: bash run: go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) @@ -79,10 +78,8 @@ jobs: uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3.1.4 - name: Run go test for tools - if: ${{ matrix.update-coverage }} run: cd tools && go test -v -race ./... - name: Validate metadata.yaml - if: ${{ matrix.update-coverage }} working-directory: tools run: go run ./cmd/metadata validate diff --git a/tools/go.mod b/tools/go.mod index bda14ac3b13..f14a10b195b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module tools -go 1.21 +go 1.20 require ( github.com/alecthomas/kong v0.8.0 @@ -8,6 +8,7 @@ require ( github.com/getkin/kin-openapi v0.119.0 github.com/google/go-github/v55 v55.0.0 github.com/stretchr/testify v1.8.4 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/mod v0.12.0 golang.org/x/sync v0.3.0 gopkg.in/yaml.v3 v3.0.1 @@ -27,6 +28,6 @@ require ( github.com/perimeterx/marshmallow v1.1.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/tools v0.1.12 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/tools v0.13.0 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index b88d4da8eac..224a611f2a1 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,11 +1,9 @@ github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= -github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s= github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= -github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= @@ -14,7 +12,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc= github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc= github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg= -github.com/dave/jennifer v1.5.0/go.mod h1:4MnyiFIlZS3l5tSDn8VnzE6ffAhYBMB2SZntBsZGUok= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -26,16 +23,13 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= 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= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -55,7 +49,6 @@ github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0V github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -65,10 +58,11 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -77,13 +71,13 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 18af6ec4bc5..def5c054fc8 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -9,13 +9,13 @@ import ( "os" "path/filepath" "regexp" - "slices" "sort" "strings" "sync" "github.com/dave/dst" "github.com/dave/dst/decorator" + "golang.org/x/exp/slices" "gopkg.in/yaml.v3" ) diff --git a/tools/internal/validate.go b/tools/internal/validate.go index 4d06a135a77..93a42a0d485 100644 --- a/tools/internal/validate.go +++ b/tools/internal/validate.go @@ -2,8 +2,9 @@ package internal import ( "fmt" - "slices" "sort" + + "golang.org/x/exp/slices" ) // ValidateMetadata returns a list of issues with the metadata file. An error means From fa02527c65762b3e4736fa509718bd8fabffe76c Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sat, 9 Sep 2023 16:35:21 -0500 Subject: [PATCH 11/34] update tooling and undocumented methods --- github/actions_required_workflows.go | 70 +++++++++++++++++++ github/issue_import.go | 6 +- github/repos_hooks.go | 4 ++ metadata.yaml | 100 +++++++++++++++++++++++---- tools/cmd/metadata/metadata.go | 4 ++ tools/internal/metadata.go | 6 +- tools/internal/validate.go | 14 ++++ 7 files changed, 183 insertions(+), 21 deletions(-) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 72f25d811df..53f84ac52a2 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -66,6 +66,13 @@ type RepoRequiredWorkflows struct { } // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -88,6 +95,13 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin } // CreateRequiredWorkflow creates the required workflow in an org. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -105,6 +119,13 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, } // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -123,6 +144,13 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri } // UpdateRequiredWorkflow updates a required workflow in an org. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -140,6 +168,13 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, } // DeleteRequiredWorkflow deletes a required workflow in an org. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -150,6 +185,13 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, } // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -171,6 +213,13 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, } // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -185,6 +234,13 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o } // AddRepoToRequiredWorkflow adds the Repository to a required workflow. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -195,6 +251,13 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri } // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -205,6 +268,13 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org } // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. +// +// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the +// [GitHub blog]. +// +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/issue_import.go b/github/issue_import.go index 04899772bd1..c56dffaa4ed 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -70,7 +70,7 @@ type IssueImportError struct { // Create a new imported issue on the specified repository. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -99,7 +99,7 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss // CheckStatus checks the status of an imported issue. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) req, err := s.client.NewRequest("GET", u, nil) @@ -121,7 +121,7 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 7fa7ef7d4e8..cbecae0a903 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -201,6 +201,8 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, } // Subscribe lets servers register to receive updates when a topic is updated. +// +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -211,6 +213,8 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, } // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. +// +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/metadata.yaml b/metadata.yaml index 6f4d1169c9c..35f698e5203 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,23 +1,8 @@ undocumented_methods: - - ActionsService.AddRepoToRequiredWorkflow - - ActionsService.CreateRequiredWorkflow - - ActionsService.DeleteRequiredWorkflow - - ActionsService.GetRequiredWorkflowByID - - ActionsService.ListOrgRequiredWorkflows - - ActionsService.ListRepoRequiredWorkflows - - ActionsService.ListRequiredWorkflowSelectedRepos - - ActionsService.RemoveRepoFromRequiredWorkflow - - ActionsService.SetRequiredWorkflowSelectedRepos - - ActionsService.UpdateRequiredWorkflow - AppsService.FindRepositoryInstallationByID - Client.ListServiceHooks - - IssueImportService.CheckStatus - - IssueImportService.CheckStatusSince - - IssueImportService.Create - OrganizationsService.GetByID - RepositoriesService.GetByID - - RepositoriesService.Subscribe - - RepositoriesService.Unsubscribe - UsersService.GetByID operations: - openapi: @@ -1495,6 +1480,13 @@ operations: - descriptions/ghes-3.10/ghes-3.10.json go_methods: - GitignoresService.Get + - override: + method: POST + endpoint_url: /hub + documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub + go_methods: + - RepositoriesService.Subscribe + - RepositoriesService.Unsubscribe - openapi: method: GET endpoint_url: /installation/repositories @@ -1979,6 +1971,60 @@ operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json + - override: + method: GET + endpoint_url: /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.ListOrgRequiredWorkflows + - override: + method: POST + endpoint_url: /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.CreateRequiredWorkflow + - override: + method: DELETE + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.DeleteRequiredWorkflow + - override: + method: GET + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.GetRequiredWorkflowByID + - override: + method: PATCH + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.UpdateRequiredWorkflow + - override: + method: GET + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.ListRequiredWorkflowSelectedRepos + - override: + method: PUT + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.SetRequiredWorkflowSelectedRepos + - override: + method: DELETE + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.RemoveRepoFromRequiredWorkflow + - override: + method: PUT + endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.AddRepoToRequiredWorkflow - openapi: method: GET endpoint_url: /orgs/{org}/actions/runner-groups @@ -4794,6 +4840,12 @@ operations: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json + - override: + method: GET + endpoint_url: /repos/{owner}/{repo}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + go_methods: + - ActionsService.ListRepoRequiredWorkflows - openapi: method: GET endpoint_url: /repos/{owner}/{repo}/actions/runners @@ -7193,6 +7245,24 @@ operations: - descriptions/ghec/ghec.json go_methods: - MigrationService.MapCommitAuthor + - override: + method: GET + endpoint_url: /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues + go_methods: + - IssueImportService.CheckStatusSince + - override: + method: POST + endpoint_url: /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import + go_methods: + - IssueImportService.Create + - override: + method: GET + endpoint_url: /repos/{owner}/{repo}/import/issues/{issue_number} + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request + go_methods: + - IssueImportService.CheckStatus - openapi: method: GET endpoint_url: /repos/{owner}/{repo}/import/large_files diff --git a/tools/cmd/metadata/metadata.go b/tools/cmd/metadata/metadata.go index 309edc61d5a..ed29f0a9479 100644 --- a/tools/cmd/metadata/metadata.go +++ b/tools/cmd/metadata/metadata.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path/filepath" + "sort" "strings" "tools/internal" @@ -90,6 +91,9 @@ func (c *formatCmd) Run(root *rootCmd) error { if err != nil { return err } + sort.Slice(meta.Operations, func(i, j int) bool { + return meta.Operations[i].Less(meta.Operations[j]) + }) return meta.SaveFile(filename) } diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index def5c054fc8..e2f78c36eff 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -101,7 +101,7 @@ func (o *Operation) Summary() string { return o.OpenAPI.Summary } -func (o *Operation) less(other *Operation) bool { +func (o *Operation) Less(other *Operation) bool { if o.EndpointURL() != other.EndpointURL() { return o.EndpointURL() < other.EndpointURL() } @@ -212,7 +212,7 @@ func (m *Metadata) operationsForMethod(method string) []*Operation { operations = append(operations, op) } sort.Slice(operations, func(i, j int) bool { - return operations[i].less(operations[j]) + return operations[i].Less(operations[j]) }) return operations } @@ -242,7 +242,7 @@ func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, } } sort.Slice(m.Operations, func(i, j int) bool { - return m.Operations[i].less(m.Operations[j]) + return m.Operations[i].Less(m.Operations[j]) }) return nil } diff --git a/tools/internal/validate.go b/tools/internal/validate.go index 93a42a0d485..42cf02a0c28 100644 --- a/tools/internal/validate.go +++ b/tools/internal/validate.go @@ -3,6 +3,7 @@ package internal import ( "fmt" "sort" + "strings" "golang.org/x/exp/slices" ) @@ -23,9 +24,11 @@ func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { for _, m := range meta.UndocumentedMethods { metaMethodMap[m] = true } + methodOperations := map[string][]*Operation{} for _, op := range meta.Operations { for _, m := range op.GoMethods { metaMethodMap[m] = true + methodOperations[m] = append(methodOperations[m], op) } } var metaMethods []string @@ -41,6 +44,17 @@ func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { msg := fmt.Sprintf("Method %s in metadata does not exist in github package.", m) result = append(result, msg) } + for _, m := range meta.UndocumentedMethods { + if len(methodOperations[m]) == 0 { + continue + } + var ops []string + for _, op := range methodOperations[m] { + ops = append(ops, fmt.Sprintf("%s %s", op.Method(), op.EndpointURL())) + } + msg := fmt.Sprintf("Method %s is listed as undocumented in metadata and also in these operations: %s", m, strings.Join(ops, ", ")) + result = append(result, msg) + } return result, nil } From d85528671ad8a4801b33ba0ced51e9a8136ab664 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 10:05:31 -0500 Subject: [PATCH 12/34] leave existing doc links in place --- tools/internal/metadata.go | 163 +++++++++++++++++++++++++------------ 1 file changed, 112 insertions(+), 51 deletions(-) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index e2f78c36eff..193e71a508b 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io/fs" + "net/url" "os" "path/filepath" "regexp" @@ -15,6 +16,7 @@ import ( "github.com/dave/dst" "github.com/dave/dst/decorator" + "golang.org/x/exp/maps" "golang.org/x/exp/slices" "gopkg.in/yaml.v3" ) @@ -247,11 +249,6 @@ func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, return nil } -var ( - docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:`) - emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) -) - // UpdateDocLinks updates the code comments in dir with doc urls from metadata. func UpdateDocLinks(meta *Metadata, dir string) error { return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { @@ -299,63 +296,127 @@ func updateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { } dst.Inspect(df, func(n dst.Node) bool { - d, ok := n.(*dst.FuncDecl) - if !ok || - !d.Name.IsExported() || - d.Recv == nil { - return true - } + return updateDocsLinksForNode(metadata, n) + }) - // Get the method's receiver. It can be either an identifier or a pointer to an identifier. - // This assumes all receivers are named and we don't have something like: `func (Client) Foo()`. - methodName := d.Name.Name - receiverType := "" - switch x := d.Recv.List[0].Type.(type) { - case *dst.Ident: - receiverType = x.Name - case *dst.StarExpr: - receiverType = x.X.(*dst.Ident).Name - } + var buf bytes.Buffer + err = decorator.Fprint(&buf, df) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} - // create copy of comments without doc links - var starts []string - for _, s := range d.Decs.Start.All() { - if !docLineRE.MatchString(s) { - starts = append(starts, s) - } - } +var ( + docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s+(https?://\S+)`) + emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) +) + +func updateDocsLinksForNode(metadata *Metadata, n dst.Node) bool { + d, ok := n.(*dst.FuncDecl) + if !ok || + !d.Name.IsExported() || + d.Recv == nil { + return true + } + + // Get the method's receiver. It can be either an identifier or a pointer to an identifier. + // This assumes all receivers are named and we don't have something like: `func (Client) Foo()`. + methodName := d.Name.Name + receiverType := "" + switch x := d.Recv.List[0].Type.(type) { + case *dst.Ident: + receiverType = x.Name + case *dst.StarExpr: + receiverType = x.X.(*dst.Ident).Name + } + + linksMap := map[string]struct{}{} + ops := metadata.operationsForMethod(strings.Join([]string{receiverType, methodName}, ".")) + for _, op := range ops { + linksMap[op.DocumentationURL()] = struct{}{} + } - // remove trailing empty lines - for len(starts) > 0 { - if !emptyLineRE.MatchString(starts[len(starts)-1]) { + // create copy of comments with non-matching doc links removed + var commentLines []string + for _, line := range d.Decs.Start.All() { + match := docLineRE.FindStringSubmatch(line) + if match == nil { + commentLines = append(commentLines, line) + continue + } + matchesLink := false + for link := range linksMap { + if sameDocLink(match[2], link) { + //fmt.Println("match", match[2], link) + matchesLink = true + delete(linksMap, link) break } - starts = starts[:len(starts)-1] } - - var links []string - for _, op := range metadata.operationsForMethod(strings.Join([]string{receiverType, methodName}, ".")) { - links = append(links, op.DocumentationURL()) + if matchesLink { + commentLines = append(commentLines, line) } - sort.Strings(links) - docLinks := links + } - // add an empty line before adding doc links - if len(docLinks) > 0 { - starts = append(starts, "//") - } + docLinks := maps.Keys(linksMap) + sort.Strings(docLinks) - for _, dl := range docLinks { - starts = append(starts, fmt.Sprintf("// GitHub API docs: %s", dl)) + // remove trailing empty lines + for len(commentLines) > 0 { + if !emptyLineRE.MatchString(commentLines[len(commentLines)-1]) { + break } - d.Decs.Start.Replace(starts...) - return true - }) + commentLines = commentLines[:len(commentLines)-1] + } - var buf bytes.Buffer - err = decorator.Fprint(&buf, df) + // add an empty line before adding doc links + if len(docLinks) > 0 && + len(commentLines) > 0 && + !emptyLineRE.MatchString(commentLines[len(commentLines)-1]) { + commentLines = append(commentLines, "//") + } + + for _, dl := range docLinks { + dl = normalizeDocURLPath(dl) + commentLines = append(commentLines, fmt.Sprintf("// GitHub API docs: %s", dl)) + } + d.Decs.Start.Replace(commentLines...) + return true +} + +const docURLPrefix = "https://docs.github.com/rest/" + +var docURLPrefixRE = regexp.MustCompile(`^https://docs\.github\.com.*/rest/`) + +func normalizeDocURLPath(u string) string { + pre := docURLPrefixRE.FindString(u) + if pre == "" { + return u + } + return docURLPrefix + strings.TrimPrefix(u, pre) +} + +// sameDocLink returns true if the two doc links are going to end up rendering the same page pointed +// to the same section. +// +// If a url path starts with *./rest/ it ignores query parameters and everything before /rest/ when +// making the comparison. +func sameDocLink(left, right string) bool { + if !docURLPrefixRE.MatchString(left) || + !docURLPrefixRE.MatchString(right) { + return left == right + } + left = stripURLQuery(normalizeDocURLPath(left)) + right = stripURLQuery(normalizeDocURLPath(right)) + return left == right +} + +func stripURLQuery(u string) string { + p, err := url.Parse(u) if err != nil { - return nil, err + return u } - return buf.Bytes(), nil + p.RawQuery = "" + return p.String() } From 43c32160ba24caf430e9f57cb8eff35b241e64a1 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 10:07:10 -0500 Subject: [PATCH 13/34] restore github dir --- github/actions_artifacts.go | 10 +- github/actions_cache.go | 14 +- github/actions_oidc.go | 8 +- github/actions_required_workflows.go | 70 ++-------- github/actions_runner_groups.go | 26 ++-- github/actions_runners.go | 36 ++--- github/actions_secrets.go | 38 +++--- github/actions_variables.go | 38 +++--- github/actions_workflow_jobs.go | 6 +- github/actions_workflow_runs.go | 30 ++--- github/actions_workflows.go | 22 +-- github/activity.go | 2 - github/activity_events.go | 20 +-- github/activity_notifications.go | 18 +-- github/activity_star.go | 12 +- github/activity_watching.go | 12 +- github/admin.go | 4 +- github/admin_orgs.go | 6 +- github/admin_stats.go | 2 +- github/admin_users.go | 8 +- github/apps.go | 26 ++-- github/apps_hooks.go | 4 +- github/apps_hooks_deliveries.go | 6 +- github/apps_installation.go | 10 +- github/apps_manifest.go | 2 +- github/apps_marketplace.go | 13 +- github/authorizations.go | 12 +- github/billing.go | 14 +- github/checks.go | 24 ++-- github/code-scanning.go | 28 ++-- github/codespaces.go | 12 +- github/codespaces_secrets.go | 46 +++---- github/dependabot_alerts.go | 6 +- github/dependabot_secrets.go | 28 ++-- github/dependency_graph.go | 2 +- github/enterprise_actions_runner_groups.go | 26 ++-- github/enterprise_actions_runners.go | 10 +- github/enterprise_audit_log.go | 2 +- .../enterprise_code_security_and_analysis.go | 6 +- github/gists.go | 30 ++--- github/gists_comments.go | 10 +- github/git_blobs.go | 6 +- github/git_commits.go | 4 +- github/git_refs.go | 10 +- github/git_tags.go | 4 +- github/git_trees.go | 4 +- github/gitignore.go | 4 +- github/interactions_orgs.go | 6 +- github/interactions_repos.go | 6 +- github/issue_import.go | 6 +- github/issues.go | 20 +-- github/issues_assignees.go | 8 +- github/issues_comments.go | 12 +- github/issues_events.go | 6 +- github/issues_labels.go | 22 +-- github/issues_milestones.go | 10 +- github/issues_timeline.go | 2 +- github/licenses.go | 4 +- github/migrations.go | 12 +- github/migrations_source_import.go | 16 +-- github/migrations_user.go | 12 +- github/misc.go | 16 +-- github/orgs.go | 14 +- github/orgs_actions_allowed.go | 4 +- github/orgs_actions_permissions.go | 4 +- github/orgs_audit_log.go | 2 +- github/orgs_credential_authorizations.go | 4 +- github/orgs_custom_roles.go | 8 +- github/orgs_hooks.go | 12 +- github/orgs_hooks_configuration.go | 4 +- github/orgs_hooks_deliveries.go | 6 +- github/orgs_members.go | 34 ++--- github/orgs_outside_collaborators.go | 6 +- github/orgs_packages.go | 16 +-- github/orgs_personal_access_tokens.go | 2 +- github/orgs_projects.go | 4 +- github/orgs_rules.go | 10 +- github/orgs_security_managers.go | 6 +- github/orgs_users_blocking.go | 8 +- github/projects.go | 38 +++--- github/pulls.go | 22 +-- github/pulls_comments.go | 14 +- github/pulls_reviewers.go | 6 +- github/pulls_reviews.go | 18 +-- github/reactions.go | 50 +++---- github/repos.go | 126 +++++++++--------- github/repos_actions_access.go | 4 +- github/repos_actions_allowed.go | 4 +- github/repos_actions_permissions.go | 4 +- github/repos_autolinks.go | 8 +- github/repos_codeowners.go | 2 +- github/repos_collaborators.go | 10 +- github/repos_comments.go | 12 +- github/repos_commits.go | 15 ++- github/repos_community_health.go | 2 +- github/repos_contents.go | 17 +-- github/repos_deployment_branch_policies.go | 10 +- github/repos_deployments.go | 14 +- github/repos_environments.go | 8 +- github/repos_forks.go | 4 +- github/repos_hooks.go | 18 +-- github/repos_hooks_configuration.go | 4 +- github/repos_hooks_deliveries.go | 6 +- github/repos_invitations.go | 6 +- github/repos_keys.go | 8 +- github/repos_lfs.go | 4 +- github/repos_merging.go | 4 +- github/repos_pages.go | 18 +-- github/repos_prereceive_hooks.go | 8 +- github/repos_projects.go | 4 +- github/repos_releases.go | 28 ++-- github/repos_rules.go | 12 +- github/repos_stats.go | 10 +- github/repos_statuses.go | 6 +- github/repos_tags.go | 6 +- github/repos_traffic.go | 8 +- github/scim.go | 12 +- github/search.go | 14 +- github/secret_scanning.go | 12 +- github/security_advisories.go | 2 +- github/teams.go | 75 +++++------ github/teams_discussion_comments.go | 20 +-- github/teams_discussions.go | 20 +-- github/teams_members.go | 20 +-- github/users.go | 16 +-- github/users_administration.go | 8 +- github/users_blocking.go | 8 +- github/users_emails.go | 8 +- github/users_followers.go | 16 +-- github/users_gpg_keys.go | 10 +- github/users_keys.go | 10 +- github/users_packages.go | 32 ++--- github/users_projects.go | 4 +- github/users_ssh_signing_keys.go | 10 +- 134 files changed, 902 insertions(+), 966 deletions(-) diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index c45332302ee..441a53910e3 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -52,7 +52,7 @@ type ArtifactList struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-artifacts-for-a-repository func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) @@ -76,7 +76,7 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) u, err := addOptions(u, opts) @@ -100,7 +100,7 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) @@ -120,7 +120,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) @@ -144,7 +144,7 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) diff --git a/github/actions_cache.go b/github/actions_cache.go index 3b6136e82dc..9592d9ab62f 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -77,7 +77,7 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) @@ -127,7 +127,7 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -144,7 +144,7 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +167,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage-by-repository", org) u, err := addOptions(u, opts) @@ -195,7 +195,7 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -217,7 +217,7 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index 9e463fcf564..b7f2d26ae9c 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -18,7 +18,7 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -26,7 +26,7 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -49,7 +49,7 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) @@ -57,7 +57,7 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 53f84ac52a2..3566eb9d207 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -67,12 +67,7 @@ type RepoRequiredWorkflows struct { // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -96,12 +91,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // CreateRequiredWorkflow creates the required workflow in an org. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -120,12 +110,7 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -145,12 +130,7 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri // UpdateRequiredWorkflow updates a required workflow in an org. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -169,12 +149,7 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, // DeleteRequiredWorkflow deletes a required workflow in an org. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -186,12 +161,7 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-selected-repositories-for-a-required-workflow func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -214,12 +184,7 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#sets-repositories-for-a-required-workflow func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -235,12 +200,7 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o // AddRepoToRequiredWorkflow adds the Repository to a required workflow. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -252,12 +212,7 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -269,12 +224,7 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. // -// Deprecated: This endpoint will be removed from the GitHub API on October 18th, 2023. For more information, see the -// [GitHub blog]. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -// [GitHub blog]: https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/ +// Github API docs:https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-repository-required-workflows func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 60edab62982..00b9b6ce091 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -104,7 +104,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +123,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -137,7 +137,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -156,7 +156,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -175,7 +175,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -200,7 +200,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -215,7 +215,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -230,7 +230,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -244,7 +244,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -269,7 +269,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -283,7 +283,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -298,7 +298,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/actions_runners.go b/github/actions_runners.go index 49bae5d77df..7427451ccfa 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -28,7 +28,7 @@ type ActionsEnabledOnOrgRepos struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +64,7 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) req, err := s.client.NewRequest("POST", u, request) @@ -83,7 +83,7 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -108,7 +108,7 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) @@ -151,7 +151,7 @@ type Runners struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +200,7 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) @@ -220,7 +220,7 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) @@ -234,7 +234,7 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) req, err := s.client.NewRequest("GET", u, nil) @@ -253,7 +253,7 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) @@ -273,7 +273,7 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", owner) u, err := addOptions(u, opts) @@ -297,7 +297,7 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) u, err := addOptions(u, opts) @@ -321,7 +321,7 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) @@ -342,7 +342,7 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -361,7 +361,7 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -380,7 +380,7 @@ func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner strin // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -399,7 +399,7 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) @@ -419,7 +419,7 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 5bab79ee781..49985e12afa 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -64,7 +64,7 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -72,7 +72,7 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -80,7 +80,7 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) return s.getPublicKey(ctx, url) @@ -124,7 +124,7 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-repository-secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -133,7 +133,7 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-organization-secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets", org) return s.listSecrets(ctx, url, opts) @@ -141,7 +141,7 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-environment-secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) return s.listSecrets(ctx, url, opts) @@ -164,7 +164,7 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -172,7 +172,7 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -180,7 +180,7 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.getSecret(ctx, url) @@ -213,7 +213,7 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -221,7 +221,7 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -229,7 +229,7 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -246,7 +246,7 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -254,7 +254,7 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -262,7 +262,7 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.deleteSecret(ctx, url) @@ -296,7 +296,7 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-selected-repositories-for-an-organization-secret func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.listSelectedReposForSecret(ctx, url, opts) @@ -317,7 +317,7 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#set-selected-repositories-for-an-organization-secret func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.setSelectedReposForSecret(ctx, url, ids) @@ -334,7 +334,7 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) @@ -351,7 +351,7 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#remove-selected-repository-from-an-organization-secret func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) diff --git a/github/actions_variables.go b/github/actions_variables.go index dd70fe4e933..29445edd042 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -51,7 +51,7 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-repository-variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.listVariables(ctx, url, opts) @@ -59,7 +59,7 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-organization-variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.listVariables(ctx, url, opts) @@ -67,7 +67,7 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-environment-variables func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.listVariables(ctx, url, opts) @@ -90,7 +90,7 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-a-repository-variable func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.getVariable(ctx, url) @@ -98,7 +98,7 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-organization-variable func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.getVariable(ctx, url) @@ -106,7 +106,7 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-environment-variable func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.getVariable(ctx, url) @@ -122,7 +122,7 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, variable // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-a-repository-variable func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.postVariable(ctx, url, variable) @@ -130,7 +130,7 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-organization-variable func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.postVariable(ctx, url, variable) @@ -138,7 +138,7 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.postVariable(ctx, url, variable) @@ -154,7 +154,7 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-a-repository-variable func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) return s.patchVariable(ctx, url, variable) @@ -162,7 +162,7 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-an-organization-variable func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) return s.patchVariable(ctx, url, variable) @@ -170,7 +170,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) return s.patchVariable(ctx, url, variable) @@ -187,7 +187,7 @@ func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Respo // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-a-repository-variable func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.deleteVariable(ctx, url) @@ -195,7 +195,7 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-organization-variable func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.deleteVariable(ctx, url) @@ -203,7 +203,7 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-environment-variable func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.deleteVariable(ctx, url) @@ -231,7 +231,7 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-selected-repositories-for-an-organization-variable func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.listSelectedReposForVariable(ctx, url, opts) @@ -252,7 +252,7 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#set-selected-repositories-for-an-organization-variable func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.setSelectedReposForVariable(ctx, url, ids) @@ -269,7 +269,7 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-variable func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToVariable(ctx, url) @@ -286,7 +286,7 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/en/rest/actions/variables#remove-selected-repository-from-an-organization-variable func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromVariable(ctx, url) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 176a9fb1383..1f018b3e48e 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -70,7 +70,7 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) u, err := addOptions(u, opts) @@ -94,7 +94,7 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) @@ -114,7 +114,7 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index eda2a61ab7f..00221086116 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -126,7 +126,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -134,7 +134,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) @@ -142,7 +142,7 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) u, err := addOptions(u, opts) @@ -166,7 +166,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -186,7 +186,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run-attempt func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v", owner, repo, runID, attemptNumber) u, err := addOptions(u, opts) @@ -210,7 +210,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) @@ -230,7 +230,7 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r // RerunWorkflowByID re-runs a workflow by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) @@ -244,7 +244,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) @@ -258,7 +258,7 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) @@ -272,7 +272,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) @@ -286,7 +286,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -306,7 +306,7 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str // DeleteWorkflowRun deletes a workflow run by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -320,7 +320,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // DeleteWorkflowRunLogs deletes all logs for a workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-workflow-run-logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -334,7 +334,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-workflow-run-usage func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) @@ -354,7 +354,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // -// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) diff --git a/github/actions_workflows.go b/github/actions_workflows.go index 5f19d474292..c9b47ed4be4 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -58,7 +58,7 @@ type CreateWorkflowDispatchEventRequest struct { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#list-repository-workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows", owner, repo) u, err := addOptions(u, opts) @@ -82,7 +82,7 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowID) @@ -91,7 +91,7 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowFileName) @@ -115,7 +115,7 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowID) @@ -124,7 +124,7 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowFileName) @@ -148,7 +148,7 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) @@ -157,7 +157,7 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) @@ -175,7 +175,7 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -183,7 +183,7 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) @@ -191,7 +191,7 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -199,7 +199,7 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) diff --git a/github/activity.go b/github/activity.go index f92c8e41a31..9cd9f9b71d7 100644 --- a/github/activity.go +++ b/github/activity.go @@ -57,8 +57,6 @@ type FeedLinks struct { // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. -// -// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { req, err := s.client.NewRequest("GET", "feeds", nil) if err != nil { diff --git a/github/activity_events.go b/github/activity_events.go index f16312556a5..d6f0f043b08 100644 --- a/github/activity_events.go +++ b/github/activity_events.go @@ -12,7 +12,7 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { u, err := addOptions("events", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-repository-events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("repos/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -59,7 +59,7 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -83,7 +83,7 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-network-of-repositories func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("networks/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +107,7 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-organization-events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,8 +132,8 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-user func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -163,8 +163,8 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-received-by-a-user func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -194,7 +194,7 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-organization-events-for-the-authenticated-user func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index e36f2be02f3..03476c2e2c3 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -49,7 +49,7 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := "notifications" u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -102,7 +102,7 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -118,7 +118,7 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +134,7 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -154,7 +154,7 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +169,7 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -190,7 +190,7 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#set-a-thread-subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -211,7 +211,7 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_star.go b/github/activity_star.go index 3f798ec87e6..65a316f5325 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -25,7 +25,7 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo) u, err := addOptions(u, opts) @@ -67,8 +67,8 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user -// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-a-user func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -101,7 +101,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#star-a-repository-for-the-authenticated-user func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -129,7 +129,7 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/starring#unstar-a-repository-for-the-authenticated-user func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_watching.go b/github/activity_watching.go index bdb46465d19..2d6fafcc793 100644 --- a/github/activity_watching.go +++ b/github/activity_watching.go @@ -27,7 +27,7 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-watchers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscribers", owner, repo) u, err := addOptions(u, opts) @@ -52,8 +52,8 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user -// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-a-user func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -84,7 +84,7 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#get-a-repository-subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -111,7 +111,7 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#set-a-repository-subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -135,7 +135,7 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/en/rest/activity/watching#delete-a-repository-subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/admin.go b/github/admin.go index f9d85d2b75e..1b28ef64c7d 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/en/enterprise-server/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -101,7 +101,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/en/rest/enterprise/ldap/#update-ldap-mapping-for-a-team func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 4a22deb8c98..448e51f631e 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +59,14 @@ 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 9e0bbf77f6f..17e568f62b2 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/en/rest/enterprise-admin/admin_stats/ func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index 5a7c0e8a099..d756a77e20d 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +44,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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +95,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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -115,7 +115,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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/apps.go b/github/apps.go index 50836bf358a..ab83d59ab2f 100644 --- a/github/apps.go +++ b/github/apps.go @@ -151,8 +151,8 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-app func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -177,7 +177,7 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("app/installations", opts) if err != nil { @@ -200,14 +200,14 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -232,7 +232,7 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#suspend-an-app-installation func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -246,7 +246,7 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#unsuspend-an-app-installation func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -260,7 +260,7 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) @@ -274,7 +274,7 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) @@ -294,7 +294,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment +// TODO: Find GitHub API docs. func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} @@ -317,14 +317,14 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } @@ -338,7 +338,7 @@ func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } diff --git a/github/apps_hooks.go b/github/apps_hooks.go index a11f688b2a5..e3bd2afc032 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,7 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-webhook-configuration-for-an-app func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -31,7 +31,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/en/rest/apps#update-a-webhook-configuration-for-an-app func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_hooks_deliveries.go b/github/apps_hooks_deliveries.go index 2611ea10564..33102f36d2b 100644 --- a/github/apps_hooks_deliveries.go +++ b/github/apps_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u, err := addOptions("app/hook/deliveries", opts) if err != nil { @@ -35,7 +35,7 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_installation.go b/github/apps_installation.go index 0896d744b01..b619080713f 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -19,7 +19,7 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { u, err := addOptions("installation/repositories", opts) if err != nil { @@ -52,7 +52,7 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories", id) u, err := addOptions(u, opts) @@ -84,7 +84,7 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) @@ -103,7 +103,7 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -116,7 +116,7 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/apps_manifest.go b/github/apps_manifest.go index f5a5ab53dbb..fa4c85379ca 100644 --- a/github/apps_manifest.go +++ b/github/apps_manifest.go @@ -31,7 +31,7 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-a-github-app-from-a-manifest func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 22bbeb12402..32889abd240 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -89,8 +89,7 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps#list-plans func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -114,8 +113,7 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps#list-accounts-for-a-plan func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -139,8 +137,7 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-subscription-plan-for-an-account func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) @@ -160,8 +157,8 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/github/authorizations.go b/github/authorizations.go index f8fbcc28e6c..ea0897e3627 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -143,7 +143,7 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#check-a-token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -176,7 +176,7 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#reset-a-token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -205,7 +205,7 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -226,7 +226,7 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-authorization func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/grant", clientID) @@ -249,7 +249,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://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -269,7 +269,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://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/billing.go b/github/billing.go index b3e44f0566f..7a76bf86fda 100644 --- a/github/billing.go +++ b/github/billing.go @@ -62,7 +62,7 @@ type AdvancedSecurityCommittersBreakdown struct { // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-an-organization func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -81,7 +81,7 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-an-organization func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -101,7 +101,7 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // GetStorageBillingOrg returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-an-organization func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -120,7 +120,7 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-a-user func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -163,7 +163,7 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-a-user func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -183,7 +183,7 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // GetStorageBillingUser returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-a-user func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/checks.go b/github/checks.go index 27fec0ff469..12d08530ca0 100644 --- a/github/checks.go +++ b/github/checks.go @@ -98,7 +98,7 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#get-a-check-run func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#get-a-check-suite func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +161,7 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -194,7 +194,7 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#update-a-check-run func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -215,7 +215,7 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-run-annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -257,7 +257,7 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -283,7 +283,7 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-in-a-check-suite func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/check-runs", owner, repo, checkSuiteID) u, err := addOptions(u, opts) @@ -309,7 +309,7 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/en/rest/checks/runs#rerequest-a-check-run func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) @@ -339,7 +339,7 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#list-check-suites-for-a-git-reference func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -387,7 +387,7 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#update-repository-preferences-for-check-suites func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -414,7 +414,7 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#create-a-check-suite func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -435,7 +435,7 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/en/rest/checks/suites#rerequest-a-check-suite func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/github/code-scanning.go b/github/code-scanning.go index 521b1e15312..0ae269be676 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -235,7 +235,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -263,7 +263,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -292,7 +292,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -317,7 +317,7 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -340,7 +340,7 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) u, err := addOptions(u, opts) @@ -368,7 +368,7 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -400,7 +400,7 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) @@ -424,7 +424,7 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -453,7 +453,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -486,7 +486,7 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -509,7 +509,7 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) @@ -532,7 +532,7 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) @@ -564,7 +564,7 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -605,7 +605,7 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/github/codespaces.go b/github/codespaces.go index d3d2b1a9f61..cd8b0e5bee5 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -90,7 +90,7 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { u := "user/codespaces" u, err := addOptions(u, opts) @@ -172,7 +172,7 @@ type CreateCodespaceOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) @@ -195,7 +195,7 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) @@ -218,7 +218,7 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) @@ -241,7 +241,7 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) diff --git a/github/codespaces_secrets.go b/github/codespaces_secrets.go index aa2869c88de..e11c679c668 100644 --- a/github/codespaces_secrets.go +++ b/github/codespaces_secrets.go @@ -16,7 +16,7 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { u, err := addOptions("user/codespaces/secrets", opts) if err != nil { @@ -29,7 +29,7 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets", org) u, err := addOptions(u, opts) @@ -43,7 +43,7 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets", owner, repo) u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, "user/codespaces/secrets/public-key") } @@ -83,7 +83,7 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("orgs/%v/codespaces/secrets/public-key", org)) } @@ -92,7 +92,7 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("repos/%v/%v/codespaces/secrets/public-key", owner, repo)) } @@ -118,7 +118,7 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.getSecret(ctx, u) @@ -128,7 +128,7 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.getSecret(ctx, u) @@ -138,7 +138,7 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.getSecret(ctx, u) @@ -165,7 +165,7 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -175,7 +175,7 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -185,7 +185,7 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -211,7 +211,7 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.deleteSecret(ctx, u) @@ -221,7 +221,7 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.deleteSecret(ctx, u) @@ -231,7 +231,7 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, u) @@ -256,7 +256,7 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) u, err := addOptions(u, opts) @@ -271,7 +271,7 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) u, err := addOptions(u, opts) @@ -302,7 +302,7 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -312,7 +312,7 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -340,7 +340,7 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -350,7 +350,7 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -374,7 +374,7 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) @@ -384,7 +384,7 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 8d90bab8553..177316b1dc8 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -104,7 +104,7 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo) return s.listAlerts(ctx, url, opts) @@ -112,7 +112,7 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/alerts", org) return s.listAlerts(ctx, url, opts) @@ -120,7 +120,7 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) req, err := s.client.NewRequest("GET", url, nil) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index 362e62a3af5..685f7bea8ea 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -27,7 +27,7 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -35,7 +35,7 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -64,7 +64,7 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-repository-secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -73,7 +73,7 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-organization-secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) return s.listSecrets(ctx, url, opts) @@ -96,7 +96,7 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-secret func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -104,7 +104,7 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-secret func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -134,7 +134,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -142,7 +142,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) for i, secret := range eSecret.SelectedRepositoryIDs { @@ -176,7 +176,7 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-a-repository-secret func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -184,7 +184,7 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-an-organization-secret func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -192,7 +192,7 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) u, err := addOptions(url, opts) @@ -219,7 +219,7 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { @@ -236,7 +236,7 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) @@ -249,7 +249,7 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index ba95bd3d5e3..e578965cc12 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -61,7 +61,7 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) diff --git a/github/enterprise_actions_runner_groups.go b/github/enterprise_actions_runner_groups.go index a6c1c0ceaae..b6bb70dae40 100644 --- a/github/enterprise_actions_runner_groups.go +++ b/github/enterprise_actions_runner_groups.go @@ -79,7 +79,7 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) u, err := addOptions(u, opts) @@ -103,7 +103,7 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +122,7 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) @@ -136,7 +136,7 @@ func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, ent // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) req, err := s.client.NewRequest("POST", u, createReq) @@ -155,7 +155,7 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -174,7 +174,7 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) u, err := addOptions(u, opts) @@ -199,7 +199,7 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) @@ -214,7 +214,7 @@ func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -229,7 +229,7 @@ func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -243,7 +243,7 @@ func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Cont // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) u, err := addOptions(u, opts) @@ -268,7 +268,7 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) @@ -282,7 +282,7 @@ func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterpris // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) @@ -297,7 +297,7 @@ func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterpris // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index 416badd5593..6fc30d50258 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,7 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) @@ -51,7 +51,7 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -71,7 +71,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -95,7 +95,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index ef56d768e42..40648673385 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index e43b4d1acf8..3980a86aa4b 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -20,7 +20,7 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) @@ -40,7 +40,7 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) req, err := s.client.NewRequest("PATCH", u, settings) @@ -61,7 +61,7 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/gists.go b/github/gists.go index 7fc972256c0..80961fcb908 100644 --- a/github/gists.go +++ b/github/gists.go @@ -96,8 +96,8 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-a-user func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -126,7 +126,7 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-public-gists func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -149,7 +149,7 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-starred-gists func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -172,7 +172,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -191,7 +191,7 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist-revision func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -210,7 +210,7 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#create-a-gist func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" req, err := s.client.NewRequest("POST", u, gist) @@ -229,7 +229,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#update-a-gist func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) @@ -248,7 +248,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { u := fmt.Sprintf("gists/%v/commits", id) u, err := addOptions(u, opts) @@ -272,7 +272,7 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#delete-a-gist func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -285,7 +285,7 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#star-a-gist func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("PUT", u, nil) @@ -298,7 +298,7 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#unstar-a-gist func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -311,7 +311,7 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#check-if-a-gist-is-starred func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("GET", u, nil) @@ -326,7 +326,7 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#fork-a-gist func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) req, err := s.client.NewRequest("POST", u, nil) @@ -345,7 +345,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) u, err := addOptions(u, opts) diff --git a/github/gists_comments.go b/github/gists_comments.go index bd19e99336d..ee0fbfa45f8 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -25,7 +25,7 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#list-gist-comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) u, err := addOptions(u, opts) @@ -49,7 +49,7 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#get-a-gist-comment func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -68,7 +68,7 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#create-a-gist-comment func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) req, err := s.client.NewRequest("POST", u, comment) @@ -87,7 +87,7 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#update-a-gist-comment func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -106,7 +106,7 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/en/rest/gists/comments#delete-a-gist-comment func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/git_blobs.go b/github/git_blobs.go index c32e10efecf..da0485ccbe2 100644 --- a/github/git_blobs.go +++ b/github/git_blobs.go @@ -23,7 +23,7 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +43,7 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +64,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/en/rest/git/blobs#create-a-blob func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) diff --git a/github/git_commits.go b/github/git_commits.go index c52e8ff5713..862837c0d59 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -69,7 +69,7 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object +// GitHub API docs: https://docs.github.com/en/rest/git/commits#get-a-commit func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -103,7 +103,7 @@ type createCommit struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") diff --git a/github/git_refs.go b/github/git_refs.go index 93d522034c1..e839c30f667 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -49,7 +49,7 @@ type updateRefRequest struct { // GetRef fetches a single reference in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#get-a-reference func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) @@ -88,7 +88,7 @@ type ReferenceListOptions struct { // ListMatchingRefs lists references in a repository that match a supplied ref. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/en/rest/git/refs#list-matching-references func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, opts *ReferenceListOptions) ([]*Reference, *Response, error) { var ref string if opts != nil { @@ -116,7 +116,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#create-a-reference func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ @@ -139,7 +139,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) @@ -162,7 +162,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/en/rest/git/refs#delete-a-reference func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) diff --git a/github/git_tags.go b/github/git_tags.go index f44a0e58d3d..30d7b2c2d23 100644 --- a/github/git_tags.go +++ b/github/git_tags.go @@ -35,7 +35,7 @@ type createTagRequest struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/en/rest/git/tags#get-a-tag func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +54,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/en/rest/git/tags#create-a-tag-object func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) diff --git a/github/git_trees.go b/github/git_trees.go index 21d6e1f5a8a..db28976e032 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -93,7 +93,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/en/rest/git/trees#get-a-tree func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { @@ -124,7 +124,7 @@ type createTree struct { // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // -// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/en/rest/git/trees#create-a-tree func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) diff --git a/github/gitignore.go b/github/gitignore.go index b0cc5ca684b..a20a868b44a 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -28,7 +28,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +// GitHub API docs: https://docs.github.com/en/rest/gitignore/#listing-available-templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -46,7 +46,7 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/en/rest/gitignore#get-a-gitignore-template func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index 85af9328fa0..5c7663f583d 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#get-interaction-restrictions-for-an-organization func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#set-interaction-restrictions-for-an-organization func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/interactions_repos.go b/github/interactions_repos.go index ea7e177deed..41e6c5319d0 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -12,7 +12,7 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#get-interaction-restrictions-for-a-repository func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +39,7 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#set-interaction-restrictions-for-a-repository func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) @@ -65,7 +65,7 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#remove-interaction-restrictions-for-a-repository func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issue_import.go b/github/issue_import.go index c56dffaa4ed..04899772bd1 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -70,7 +70,7 @@ type IssueImportError struct { // Create a new imported issue on the specified repository. // -// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -99,7 +99,7 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss // CheckStatus checks the status of an imported issue. // -// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) req, err := s.client.NewRequest("GET", u, nil) @@ -121,7 +121,7 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // -// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/issues.go b/github/issues.go index 6854a0ecf26..42e58a17a8a 100644 --- a/github/issues.go +++ b/github/issues.go @@ -132,8 +132,8 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -147,7 +147,7 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -218,7 +218,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-repository-issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -245,7 +245,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#get-an-issue func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -267,7 +267,7 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#create-an-issue func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -286,7 +286,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) @@ -307,7 +307,7 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) req, err := s.client.NewRequest("PATCH", u, &struct { @@ -337,7 +337,7 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#lock-an-issue func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) @@ -350,7 +350,7 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/issues#unlock-an-issue func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_assignees.go b/github/issues_assignees.go index 04074e803e1..b7f2e802437 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -13,7 +13,7 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#list-assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees", owner, repo) u, err := addOptions(u, opts) @@ -37,7 +37,7 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#check-if-a-user-can-be-assigned func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -52,7 +52,7 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` @@ -74,7 +74,7 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#remove-assignees-from-an-issue func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 3feda3f50d3..17881c093dc 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -50,8 +50,8 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments -// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { @@ -83,7 +83,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) @@ -106,7 +106,7 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#create-an-issue-comment func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -125,7 +125,7 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#update-an-issue-comment func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -143,7 +143,7 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/issues/comments#delete-an-issue-comment func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_events.go b/github/issues_events.go index 808a5ba97d0..ed076591701 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -99,7 +99,7 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number) u, err := addOptions(u, opts) @@ -125,7 +125,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -149,7 +149,7 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/en/rest/issues/events#get-an-issue-event func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) diff --git a/github/issues_labels.go b/github/issues_labels.go index d89429f7f60..d0f865c03f1 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -27,7 +27,7 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#get-a-label func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) @@ -70,7 +70,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#create-a-label func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) @@ -89,7 +89,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#update-a-label func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) @@ -108,7 +108,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#delete-a-label func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) @@ -120,7 +120,7 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) @@ -163,7 +163,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-a-label-from-an-issue func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +176,7 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#set-labels-for-an-issue func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) @@ -195,7 +195,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-all-labels-from-an-issue func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) @@ -208,7 +208,7 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-issues-in-a-milestone func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/issues_milestones.go b/github/issues_milestones.go index b40ade99afb..897c7c0b6da 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -54,7 +54,7 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#list-milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) @@ -78,7 +78,7 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#get-a-milestone func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -97,7 +97,7 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#create-a-milestone func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) @@ -116,7 +116,7 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#update-a-milestone func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) @@ -135,7 +135,7 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#delete-a-milestone func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 5a205e3ec3b..9c73e6176d1 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -164,7 +164,7 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/timeline", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/licenses.go b/github/licenses.go index fdaae5cfaa9..0877b6d1831 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -60,7 +60,7 @@ func (l License) String() string { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +// GitHub API docs: https://docs.github.com/en/rest/licenses/#list-all-licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -78,7 +78,7 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license +// GitHub API docs: https://docs.github.com/en/rest/licenses#get-a-license func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/migrations.go b/github/migrations.go index 6a47d0e0f2c..67989c0789f 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -74,7 +74,7 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#start-an-organization-migration func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +103,7 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#list-organization-migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +131,7 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#get-an-organization-migration-status func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +155,7 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#download-an-organization-migration-archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +192,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#delete-an-organization-migration-archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +212,7 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#unlock-an-organization-repository func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index b20abf0ec98..74a04b22a4e 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -146,7 +146,7 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#start-an-import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +165,7 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-an-import-status func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +184,7 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-an-import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +213,7 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-commit-authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +234,7 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#map-a-commit-author func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +255,7 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-git-lfs-preference func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +274,7 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-large-files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +293,7 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#cancel-an-import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/migrations_user.go b/github/migrations_user.go index 28c9258d927..6586fdb2d3f 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -67,7 +67,7 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#start-a-user-migration func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { u := "user/migrations" @@ -96,7 +96,7 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { u := "user/migrations" u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#get-a-user-migration-status func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) @@ -148,7 +148,7 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#download-a-user-migration-archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -182,7 +182,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#delete-a-user-migration-archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -202,7 +202,7 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/en/rest/migrations/users#unlock-a-user-repository func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) diff --git a/github/misc.go b/github/misc.go index 4910383d858..89615241570 100644 --- a/github/misc.go +++ b/github/misc.go @@ -39,7 +39,7 @@ type markdownRequest struct { // Markdown renders an arbitrary Markdown document. // -// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +// GitHub API docs: https://docs.github.com/en/rest/markdown/ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRequest{Text: String(text)} if opts != nil { @@ -67,7 +67,7 @@ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOption // ListEmojis returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +// GitHub API docs: https://docs.github.com/en/rest/emojis/ func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { req, err := c.NewRequest("GET", "emojis", nil) if err != nil { @@ -97,7 +97,7 @@ func (c *CodeOfConduct) String() string { // ListCodesOfConduct returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := c.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -119,8 +119,6 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // GetCodeOfConduct returns an individual code of conduct. // // https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct -// -// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := c.NewRequest("GET", u, nil) @@ -192,7 +190,7 @@ type APIMeta struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { req, err := c.NewRequest("GET", "meta", nil) if err != nil { @@ -210,8 +208,6 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used. -// -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { @@ -235,8 +231,6 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // Zen returns a random line from The Zen of GitHub. // // see also: http://warpspire.com/posts/taste/ -// -// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github func (c *Client) Zen(ctx context.Context) (string, *Response, error) { req, err := c.NewRequest("GET", "zen", nil) if err != nil { @@ -266,6 +260,8 @@ func (s *ServiceHook) String() string { } // ListServiceHooks lists all of the available service hooks. +// +// GitHub API docs: https://developer.github.com/webhooks/#services func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error) { u := "hooks" req, err := c.NewRequest("GET", u, nil) diff --git a/github/orgs.go b/github/orgs.go index 0e55d4c2491..0c7e361b3fc 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -148,7 +148,7 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { u, err := addOptions("organizations", opts) if err != nil { @@ -171,8 +171,8 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-a-user func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -201,7 +201,7 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-an-organization func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("GET", u, nil) @@ -242,7 +242,7 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#update-an-organization func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) @@ -264,7 +264,7 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#delete-an-organization func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +277,7 @@ func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Respons // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { u := fmt.Sprintf("orgs/%v/installations", org) diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index d21be00204c..e3b35b1df1f 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -25,7 +25,7 @@ func (a ActionsAllowed) String() string { // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index 6701ba8f3a0..6d1db2ee0a3 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -25,7 +25,7 @@ func (a ActionsPermissions) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) @@ -45,7 +45,7 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) req, err := s.client.NewRequest("PUT", u, actionsPermissions) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 8cf39cd16d4..4c34445fa1b 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -133,7 +133,7 @@ type AuditEntryData struct { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go index 451369e0d49..6d56fe8f79a 100644 --- a/github/orgs_credential_authorizations.go +++ b/github/orgs_credential_authorizations.go @@ -58,7 +58,7 @@ type CredentialAuthorization struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) @@ -83,7 +83,7 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) req, err := s.client.NewRequest(http.MethodDelete, u, nil) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index c697adfc1c9..7c1b2d6292d 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -30,7 +30,7 @@ type CustomRepoRoles struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -59,7 +59,7 @@ type CreateOrUpdateCustomRoleOptions struct { // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-repository-role func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -80,7 +80,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-repository-role func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) @@ -101,7 +101,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-repository-role func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go index 6507d52938d..c0dd51e24e3 100644 --- a/github/orgs_hooks.go +++ b/github/orgs_hooks.go @@ -12,7 +12,7 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-organization-webhooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-an-organization-webhook func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -59,7 +59,7 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#create-an-organization-webhook func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) @@ -86,7 +86,7 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#update-an-organization-webhook func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -105,7 +105,7 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#ping-an-organization-webhook func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d/pings", org, id) req, err := s.client.NewRequest("POST", u, nil) @@ -118,7 +118,7 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#delete-an-organization-webhook func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_hooks_configuration.go b/github/orgs_hooks_configuration.go index fda237b31d8..953a2329c36 100644 --- a/github/orgs_hooks_configuration.go +++ b/github/orgs_hooks_configuration.go @@ -12,7 +12,7 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/orgs_hooks_deliveries.go b/github/orgs_hooks_deliveries.go index e78cecc3968..1bfad409ea5 100644 --- a/github/orgs_hooks_deliveries.go +++ b/github/orgs_hooks_deliveries.go @@ -12,7 +12,7 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_members.go b/github/orgs_members.go index bfbd4d8ab07..79f8a653333 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -71,8 +71,8 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-public-organization-members func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -101,7 +101,7 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-organization-membership-for-a-user func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +116,7 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-public-organization-membership-for-a-user func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +131,7 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-an-organization-member func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -145,7 +145,7 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -158,7 +158,7 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-memberships-for-the-authenticated-user func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { u := "user/memberships/orgs" u, err := addOptions(u, opts) @@ -207,8 +207,8 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-organization-membership-for-a-user func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -235,8 +235,8 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user -// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-organization-membership-for-a-user func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) { var u, method string if user != "" { @@ -264,7 +264,7 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-organization-membership-for-a-user func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +277,7 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-pending-organization-invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) u, err := addOptions(u, opts) @@ -323,7 +323,7 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#create-an-organization-invitation func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) @@ -344,7 +344,7 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-invitation-teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v/teams", org, invitationID) u, err := addOptions(u, opts) @@ -368,7 +368,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed inviatations. // -// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-failed-organization-invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/failed_invitations", org) u, err := addOptions(u, opts) diff --git a/github/orgs_outside_collaborators.go b/github/orgs_outside_collaborators.go index 4995749b386..506a4946034 100644 --- a/github/orgs_outside_collaborators.go +++ b/github/orgs_outside_collaborators.go @@ -27,7 +27,7 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators", org) u, err := addOptions(u, opts) @@ -52,7 +52,7 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,7 +69,7 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0dfe7841695..0ae68aaa369 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,7 @@ import ( // List the packages for an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // Get a package by name from an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // Delete a package from an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // Restore a package to an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) @@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization 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, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // Get a specific version of a package in an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // Delete a package version from an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization 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) req, err := s.client.NewRequest("DELETE", u, nil) @@ -137,7 +137,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // Restore a package version to an organization. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index f73d48c691e..c30ff2843ee 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -21,7 +21,7 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) diff --git a/github/orgs_projects.go b/github/orgs_projects.go index 01087fb97a1..d49eae54dce 100644 --- a/github/orgs_projects.go +++ b/github/orgs_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for an organization. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-organization-projects func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt // CreateProject creates a GitHub Project for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-an-organization-project func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/orgs_rules.go b/github/orgs_rules.go index 75cfd853620..a3905af8fb3 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -12,7 +12,7 @@ import ( // GetAllOrganizationRulesets gets all the rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-all-organization-repository-rulesets func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -32,7 +32,7 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o // CreateOrganizationRuleset creates a ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#create-an-organization-repository-ruleset func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -52,7 +52,7 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or // GetOrganizationRuleset gets a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-an-organization-repository-ruleset func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) @@ -72,7 +72,7 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s // UpdateOrganizationRuleset updates a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#update-an-organization-repository-ruleset 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) @@ -92,7 +92,7 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or // DeleteOrganizationRuleset deletes a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#delete-an-organization-repository-ruleset func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go index a495f63243c..a3f002e0e1c 100644 --- a/github/orgs_security_managers.go +++ b/github/orgs_security_managers.go @@ -12,7 +12,7 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/security-managers", org) @@ -32,7 +32,7 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("PUT", u, nil) @@ -45,7 +45,7 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_users_blocking.go b/github/orgs_users_blocking.go index fd534f4a58c..9c6cf60269e 100644 --- a/github/orgs_users_blocking.go +++ b/github/orgs_users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#list-users-blocked-by-an-organization func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks", org) u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -58,7 +58,7 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#block-a-user-from-an-organization func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -75,7 +75,7 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#unblock-a-user-from-an-organization func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) diff --git a/github/projects.go b/github/projects.go index c968dc58b56..df7ad6cd97e 100644 --- a/github/projects.go +++ b/github/projects.go @@ -43,7 +43,7 @@ func (p Project) String() string { // GetProject gets a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#get-a-project func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -90,7 +90,7 @@ type ProjectOptions struct { // UpdateProject updates a repository project. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#update-a-project func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("PATCH", u, opts) @@ -112,7 +112,7 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *Pro // DeleteProject deletes a GitHub Project from a repository. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#delete-a-project func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -142,7 +142,7 @@ type ProjectColumn struct { // ListProjectColumns lists the columns of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#list-project-columns func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) u, err := addOptions(u, opts) @@ -169,7 +169,7 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 // GetProjectColumn gets a column of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#get-a-project-column func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -199,7 +199,7 @@ type ProjectColumnOptions struct { // CreateProjectColumn creates a column for the specified (by number) project. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#create-a-project-column func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) req, err := s.client.NewRequest("POST", u, opts) @@ -221,7 +221,7 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int // UpdateProjectColumn updates a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#update-an-existing-project-column func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -243,7 +243,7 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 // DeleteProjectColumn deletes a column from a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#delete-a-project-column func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -267,7 +267,7 @@ type ProjectColumnMoveOptions struct { // MoveProjectColumn moves a column within a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column +// GitHub API docs: https://docs.github.com/en/rest/projects/columns#move-a-project-column func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/%v/moves", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -318,7 +318,7 @@ type ProjectCardListOptions struct { // ListProjectCards lists the cards in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#list-project-cards func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) u, err := addOptions(u, opts) @@ -345,7 +345,7 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, // GetProjectCard gets a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#get-a-project-card func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("GET", u, nil) @@ -383,7 +383,7 @@ type ProjectCardOptions struct { // CreateProjectCard creates a card in the specified column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#create-a-project-card func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -405,7 +405,7 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, // UpdateProjectCard updates a card of a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#update-an-existing-project-card func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -427,7 +427,7 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o // DeleteProjectCard deletes a card from a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#delete-a-project-card func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -455,7 +455,7 @@ type ProjectCardMoveOptions struct { // MoveProjectCard moves a card within a GitHub Project. // -// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card +// GitHub API docs: https://docs.github.com/en/rest/projects/cards#move-a-project-card func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) req, err := s.client.NewRequest("POST", u, opts) @@ -485,7 +485,7 @@ type ProjectCollaboratorOptions struct { // AddProjectCollaborator adds a collaborator to an organization project and sets // their permission level. You must be an organization owner or a project admin to add a collaborator. // -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#add-project-collaborator func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("PUT", u, opts) @@ -502,7 +502,7 @@ func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, // RemoveProjectCollaborator removes a collaborator from an organization project. // You must be an organization owner or a project admin to remove a collaborator. // -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#remove-user-as-a-collaborator func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("DELETE", u, nil) @@ -538,7 +538,7 @@ type ListCollaboratorOptions struct { // with access through default organization permissions, and organization owners. You must be an // organization owner or a project admin to list collaborators. // -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#list-project-collaborators func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators", id) u, err := addOptions(u, opts) @@ -576,7 +576,7 @@ type ProjectPermissionLevel struct { // project. Possible values for the permission key: "admin", "write", "read", "none". // You must be an organization owner or a project admin to review a user's permission level. // -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#get-project-permission-for-a-user func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/pulls.go b/github/pulls.go index 6ee50a1f1c8..29549e24b86 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -142,7 +142,7 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +169,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // The results may include open and closed pull requests. // By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) @@ -195,7 +195,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -214,7 +214,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -254,7 +254,7 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) @@ -293,7 +293,7 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/update-branch", owner, repo, number) @@ -328,7 +328,7 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, fmt.Errorf("pull must be provided") @@ -365,7 +365,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-commits-on-a-pull-request func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) @@ -389,7 +389,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) @@ -413,7 +413,7 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#check-if-a-pull-request-has-been-merged func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -455,7 +455,7 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 82346410060..ea1cf45d1e8 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -68,8 +68,8 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository -// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-on-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string if number == 0 { @@ -102,7 +102,7 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#get-a-review-comment-for-a-pull-request func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -125,7 +125,7 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -147,7 +147,7 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` @@ -174,7 +174,7 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#update-a-review-comment-for-a-pull-request func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -193,7 +193,7 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#delete-a-review-comment-for-a-pull-request func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 4489bb55c84..1c336540b81 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -25,7 +25,7 @@ type Reviewers struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("POST", u, &reviewers) @@ -44,7 +44,7 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#list-requested-reviewers-for-a-pull-request func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) @@ -68,7 +68,7 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, &reviewers) diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index c80924ba8a7..addcce46834 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -100,7 +100,7 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) u, err := addOptions(u, opts) @@ -124,7 +124,7 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -144,7 +144,7 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -164,7 +164,7 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-comments-for-a-pull-request-review func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) u, err := addOptions(u, opts) @@ -188,6 +188,8 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request +// // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: // @@ -221,8 +223,6 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // Use this instead. // It is waaaaaay better. // ``` -// -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) @@ -251,7 +251,7 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { opts := &struct { Body string `json:"body"` @@ -274,7 +274,7 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#submit-a-review-for-a-pull-request func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -294,7 +294,7 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/github/reactions.go b/github/reactions.go index c246356fd9b..14d193ae887 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -60,7 +60,7 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-commit-comment func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-commit-comment func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -114,7 +114,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -123,7 +123,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -132,7 +132,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -162,7 +162,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -186,7 +186,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -195,7 +195,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue-comment func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -234,7 +234,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue-comment func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -258,7 +258,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -267,7 +267,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -276,7 +276,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-pull-request-review-comment func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -306,7 +306,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-pull-request-review-comment func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -330,7 +330,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -339,7 +339,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -348,7 +348,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-legacy func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -375,7 +375,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-legacy func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -398,7 +398,7 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-reaction func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -407,7 +407,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -416,7 +416,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-comment-legacy func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -442,7 +442,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment-legacy func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -465,7 +465,7 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-comment-reaction func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -474,7 +474,7 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -498,7 +498,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-release func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 5886bb282f8..83fc3f8e734 100644 --- a/github/repos.go +++ b/github/repos.go @@ -264,8 +264,8 @@ func (d DependabotSecurityUpdates) String() string { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-a-user func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -316,7 +316,7 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-organization-repositories func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/repos", org) u, err := addOptions(u, opts) @@ -351,7 +351,7 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-public-repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -423,8 +423,8 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -491,7 +491,7 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-using-a-template func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -512,7 +512,7 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-a-repository func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -543,7 +543,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep // Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -584,7 +584,7 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -605,7 +605,7 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#delete-a-repository func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -652,7 +652,7 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -671,7 +671,7 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -688,7 +688,7 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -705,7 +705,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -724,7 +724,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -738,7 +738,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -752,7 +752,7 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) @@ -783,7 +783,7 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -802,7 +802,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) @@ -834,7 +834,7 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-tags func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) @@ -1249,7 +1249,7 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -1273,7 +1273,7 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) @@ -1302,7 +1302,7 @@ type renameBranchRequest struct { // To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. // To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) r := &renameBranchRequest{NewName: newName} @@ -1322,7 +1322,7 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // GetBranchProtection gets the protection of a given branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1347,7 +1347,7 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // GetRequiredStatusChecks gets the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1369,7 +1369,7 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // ListRequiredStatusChecksContexts lists the required status checks contexts for a given protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1390,7 +1390,7 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // UpdateBranchProtection updates the protection of a given branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, preq) @@ -1412,7 +1412,7 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // RemoveBranchProtection removes the protection of a given branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1425,7 +1425,7 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // GetSignaturesProtectedBranch gets required signatures of protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1448,7 +1448,7 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1470,7 +1470,7 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1486,7 +1486,7 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // UpdateRequiredStatusChecks updates the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, sreq) @@ -1505,7 +1505,7 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // RemoveRequiredStatusChecks removes the required status checks for a given protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1518,7 +1518,7 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/licenses#get-the-license-for-a-repository func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1537,7 +1537,7 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // GetPullRequestReviewEnforcement gets pull request review enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1560,7 +1560,7 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // UpdatePullRequestReviewEnforcement patches pull request review enforcement of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("PATCH", u, patch) @@ -1583,7 +1583,7 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // DisableDismissalRestrictions disables dismissal restrictions of a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) @@ -1610,7 +1610,7 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // RemovePullRequestReviewEnforcement removes pull request enforcement of a protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1623,7 +1623,7 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // GetAdminEnforcement gets admin enforcement information of a protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1643,7 +1643,7 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // AddAdminEnforcement adds admin enforcement to a protected branch. // It requires admin access and branch protection to be enabled. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("POST", u, nil) @@ -1662,7 +1662,7 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // RemoveAdminEnforcement removes admin enforcement from a protected branch. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1680,7 +1680,7 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-all-repository-topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1702,7 +1702,7 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ @@ -1731,9 +1731,9 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // ListApps lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// Deprecated: Please use ListAppRestrictions instead. +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// Deprecated: Please use ListAppRestrictions instead. func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1753,9 +1753,9 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // ListAppRestrictions lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { return s.ListApps(ctx, owner, repo, branch) } @@ -1766,7 +1766,7 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, apps) @@ -1788,7 +1788,7 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("POST", u, apps) @@ -1810,7 +1810,7 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, apps) @@ -1830,7 +1830,7 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // ListTeamRestrictions lists the GitHub teams that have push access to a given protected branch. // It requires the GitHub teams to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1853,7 +1853,7 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, teams) @@ -1875,7 +1875,7 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("POST", u, teams) @@ -1897,7 +1897,7 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, teams) @@ -1917,7 +1917,7 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // ListUserRestrictions lists the GitHub users that have push access to a given protected branch. // It requires the GitHub users to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("GET", u, nil) @@ -1940,7 +1940,7 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, users) @@ -1962,7 +1962,7 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("POST", u, users) @@ -1984,7 +1984,7 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, users) @@ -2016,7 +2016,7 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#transfer-a-repository func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) @@ -2045,7 +2045,7 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) @@ -2073,7 +2073,7 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) @@ -2093,7 +2093,7 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) diff --git a/github/repos_actions_access.go b/github/repos_actions_access.go index 9919daacca2..55761eeb7ee 100644 --- a/github/repos_actions_access.go +++ b/github/repos_actions_access.go @@ -23,7 +23,7 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +43,7 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) diff --git a/github/repos_actions_allowed.go b/github/repos_actions_allowed.go index f7bc2184dcb..25a46905839 100644 --- a/github/repos_actions_allowed.go +++ b/github/repos_actions_allowed.go @@ -12,7 +12,7 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,7 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index 9e0b956d6e8..45f844cec02 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -25,7 +25,7 @@ func (a ActionsPermissionsRepository) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-a-repository func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -44,7 +44,7 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // EditActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-a-repository func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index ab821076e3d..0d2cec618f0 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -28,7 +28,7 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#list-all-autolinks-of-a-repository func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) u, err := addOptions(u, opts) @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -72,7 +72,7 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#get-an-autolink-reference-of-a-repository func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) @@ -93,7 +93,7 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go index 0771ce6d5e2..835d56e164c 100644 --- a/github/repos_codeowners.go +++ b/github/repos_codeowners.go @@ -28,7 +28,7 @@ type CodeownersError struct { // GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-codeowners-errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string) (*CodeownersErrors, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index 8f985b8edae..c2396872f2e 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -48,7 +48,7 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#list-repository-collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators", owner, repo) u, err := addOptions(u, opts) @@ -75,7 +75,7 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -99,7 +99,7 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -134,7 +134,7 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -154,7 +154,7 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#remove-a-repository-collaborator func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_comments.go b/github/repos_comments.go index 068e257cf28..e282374e9e5 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -35,7 +35,7 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments-for-a-repository func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments", owner, repo) u, err := addOptions(u, opts) @@ -62,7 +62,7 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#create-a-commit-comment func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) req, err := s.client.NewRequest("POST", u, comment) @@ -109,7 +109,7 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#get-a-commit-comment func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +131,7 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#update-a-commit-comment func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, comment) @@ -150,7 +150,7 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/en/rest/commits/comments#delete-a-commit-comment func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_commits.go b/github/repos_commits.go index 0536793fd5d..d1fb577c61c 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -124,7 +124,7 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -148,7 +148,8 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-single-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) u, err := addOptions(u, opts) @@ -172,7 +173,7 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -201,7 +202,7 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) @@ -226,7 +227,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -257,7 +258,7 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo st // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -290,7 +291,7 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-branches-for-head-commit func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 5a59941c008..750ee158270 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -43,7 +43,7 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/en/rest/metrics/community#get-community-profile-metrics func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_contents.go b/github/repos_contents.go index ba15f240f65..de7a0d5b82b 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -98,7 +98,7 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-a-repository-readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/readme", owner, repo) u, err := addOptions(u, opts) @@ -128,8 +128,6 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. -// -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -164,8 +162,6 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. -// -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -202,7 +198,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed // to appear anywhere in the "path" or this method will return an error. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { return nil, nil, nil, ErrPathForbidden @@ -242,7 +238,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -262,7 +258,7 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -282,7 +278,7 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/en/rest/repos/contents#delete-a-file func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("DELETE", u, opts) @@ -314,8 +310,7 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar -// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip +// GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go index f88a29c10e7..8c4628b39bc 100644 --- a/github/repos_deployment_branch_policies.go +++ b/github/repos_deployment_branch_policies.go @@ -30,7 +30,7 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#list-deployment-branch-policies func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -50,7 +50,7 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#get-a-deployment-branch-policy func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -70,7 +70,7 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#create-a-deployment-branch-policy func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -90,7 +90,7 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#update-a-deployment-branch-policy func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -110,7 +110,7 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#delete-a-deployment-branch-policy func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) diff --git a/github/repos_deployments.go b/github/repos_deployments.go index f1471dc1b9d..36445f895e2 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -63,7 +63,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#list-deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opts) @@ -87,7 +87,7 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#get-a-deployment func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) @@ -107,7 +107,7 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#create-a-deployment func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) @@ -131,7 +131,7 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#delete-a-deployment func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -175,7 +175,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#list-deployment-statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opts) @@ -203,7 +203,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#get-a-deployment-status func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) @@ -227,7 +227,7 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) diff --git a/github/repos_environments.go b/github/repos_environments.go index cf7574722b6..2399a42c746 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -106,7 +106,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-all-environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) @@ -129,7 +129,7 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-an-environment func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -184,7 +184,7 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -230,7 +230,7 @@ func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u st // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#delete-an-environment func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) diff --git a/github/repos_forks.go b/github/repos_forks.go index 763f23b8dbc..f175dfe3b03 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -23,7 +23,7 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/en/rest/repos/forks#list-forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) @@ -66,7 +66,7 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index cbecae0a903..ba229e7bca8 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/en/rest/webhooks/repos#create-a-repository-webhook func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) @@ -106,7 +106,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/en/rest/webhooks/repos#list-repository-webhooks func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +130,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/en/rest/webhooks/repos#get-a-repository-webhook func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -148,7 +148,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/en/rest/webhooks/repos#update-a-repository-webhook func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -166,7 +166,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/en/rest/webhooks/repos#delete-a-repository-webhook func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -178,7 +178,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/en/rest/webhooks/repos#ping-a-repository-webhook func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -190,7 +190,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/en/rest/webhooks/repos#test-the-push-repository-webhook func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -202,7 +202,7 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, // Subscribe lets servers register to receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -214,7 +214,7 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index c5df6077dfb..5aadfb645e1 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/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +31,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/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 9ba80a374d8..5f2f8807e4b 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/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) u, err := addOptions(u, opts) @@ -87,7 +87,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/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -106,7 +106,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/en/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_invitations.go b/github/repos_invitations.go index fcbcc01baff..81956cd49c9 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -27,7 +27,7 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#delete-a-repository-invitation func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#update-a-repository-invitation func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { opts := &struct { Permissions string `json:"permissions"` diff --git a/github/repos_keys.go b/github/repos_keys.go index c6f0c8b371e..42c5de49709 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#list-deploy-keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +38,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#get-a-deploy-key func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +58,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#create-a-deploy-key func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -78,7 +78,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#delete-a-deploy-key func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_lfs.go b/github/repos_lfs.go index 5f92f557fa6..6ac2e5a8778 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -12,7 +12,7 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#enable-git-lfs-for-a-repository func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) @@ -31,7 +31,7 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#disable-git-lfs-for-a-repository func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) diff --git a/github/repos_merging.go b/github/repos_merging.go index 440bd30128e..66e88452e86 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -34,7 +34,7 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#merge-a-branch func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -54,7 +54,7 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) req, err := s.client.NewRequest("POST", u, request) diff --git a/github/repos_pages.go b/github/repos_pages.go index 188d2f9ae39..83075dbdd23 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -103,7 +103,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#create-a-github-pages-site func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -153,7 +153,7 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#update-information-about-a-github-pages-site func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -172,7 +172,7 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#delete-a-github-pages-site func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -188,7 +188,7 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-github-pages-site func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -207,7 +207,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/en/rest/pages#list-github-pages-builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -231,7 +231,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#get-latest-pages-build func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -250,7 +250,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#get-github-pages-build func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -269,7 +269,7 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/en/rest/pages#request-a-github-pages-build func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) @@ -288,7 +288,7 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index cd4c81431ec..1ce6478d33b 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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#list-pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#get-a-single-pre-receive-hook func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -73,7 +73,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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#update-pre-receive-hook-enforcement func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -95,7 +95,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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#remove-enforcement-overrides-for-a-pre-receive-hook func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_projects.go b/github/repos_projects.go index 39650c7da60..a3001dee988 100644 --- a/github/repos_projects.go +++ b/github/repos_projects.go @@ -21,7 +21,7 @@ type ProjectListOptions struct { // ListProjects lists the projects for a repo. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-repository-projects func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri // CreateProject creates a GitHub Project for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-repository-project func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/repos_releases.go b/github/repos_releases.go index 1e3ec316517..e2aa845af2f 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -87,7 +87,7 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#list-releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) u, err := addOptions(u, opts) @@ -110,7 +110,7 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) return s.getSingleRelease(ctx, u) @@ -118,7 +118,7 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-the-latest-release func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo) return s.getSingleRelease(ctx, u) @@ -126,7 +126,7 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/tags/%s", owner, repo, tag) return s.getSingleRelease(ctx, u) @@ -134,7 +134,7 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -188,7 +188,7 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#create-a-release func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) @@ -222,7 +222,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#update-a-release func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -252,7 +252,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/en/rest/releases/releases#delete-a-release func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -265,7 +265,7 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#list-release-assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) @@ -288,7 +288,7 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -317,7 +317,7 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // exist, but it's possible to pass any http.Client. If nil is passed the // redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -379,7 +379,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#update-a-release-asset func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -398,7 +398,7 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#delete-a-release-asset func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -412,7 +412,7 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/en/rest/releases/assets#upload-a-release-asset func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) diff --git a/github/repos_rules.go b/github/repos_rules.go index c107e98d521..7f964fe6655 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -349,7 +349,7 @@ type Ruleset struct { // GetRulesForBranch gets all the rules that apply to the specified branch. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-rules-for-a-branch func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) @@ -370,7 +370,7 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo // GetAllRulesets gets all the rules that apply to the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-all-repository-rulesets func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) @@ -390,7 +390,7 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // CreateRuleset creates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#create-a-repository-ruleset func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) @@ -411,7 +411,7 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str // GetRuleset gets a ruleset for the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-a-repository-ruleset func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) @@ -431,7 +431,7 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // UpdateRuleset updates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#update-a-repository-ruleset func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) @@ -451,7 +451,7 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str // DeleteRuleset deletes a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// GitHub API docs: https://docs.github.com/en/rest/repos/rules#delete-a-repository-ruleset func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) diff --git a/github/repos_stats.go b/github/repos_stats.go index 2578217b9a0..3df0a8f6deb 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -45,7 +45,7 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-all-contributor-commit-activity func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +84,7 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-last-year-of-commit-activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +111,7 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-activity func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +167,7 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-count func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +200,7 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_statuses.go b/github/repos_statuses.go index 0381e306ec1..ea3d166c753 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -45,7 +45,7 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#list-commit-statuses-for-a-reference func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -70,7 +70,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) @@ -109,7 +109,7 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) diff --git a/github/repos_tags.go b/github/repos_tags.go index a3487c74005..ff46d90c731 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -24,7 +24,7 @@ type tagProtectionRequest struct { // ListTagProtection lists tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) @@ -44,7 +44,7 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // CreateTagProtection creates the tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#create-a-tag-protection-state-for-a-repository func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) r := &tagProtectionRequest{Pattern: pattern} @@ -64,7 +64,7 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // DeleteTagProtection deletes a tag protection from the specified repository. // -// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#delete-a-tag-protection-state-for-a-repository func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_traffic.go b/github/repos_traffic.go index 39ebc42b87f..bf093c03ea7 100644 --- a/github/repos_traffic.go +++ b/github/repos_traffic.go @@ -54,7 +54,7 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-sources func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) @@ -74,7 +74,7 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) @@ -94,7 +94,7 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-page-views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/views", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +118,7 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-repository-clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/github/scim.go b/github/scim.go index 81f6a9745ff..7deee6be4b5 100644 --- a/github/scim.go +++ b/github/scim.go @@ -81,7 +81,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/en/rest/scim#provision-and-invite-a-scim-user func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -123,7 +123,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -142,7 +142,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/en/rest/scim#update-a-provisioned-organization-membership func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -193,7 +193,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/en/rest/scim#delete-a-scim-user-from-an-organization func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index 18e98c27de1..adb832d0d8f 100644 --- a/github/search.go +++ b/github/search.go @@ -72,7 +72,7 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories +// GitHub API docs: https://docs.github.com/en/rest/search#search-repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -107,7 +107,7 @@ type TopicResult struct { // Please see https://help.github.com/en/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-topics +// GitHub API docs: https://docs.github.com/en/rest/search#search-topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -142,7 +142,7 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-commits +// GitHub API docs: https://docs.github.com/en/rest/search#search-commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -162,7 +162,7 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/en/rest/search#search-issues-and-pull-requests func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -182,7 +182,7 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-users +// GitHub API docs: https://docs.github.com/en/rest/search#search-users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -235,7 +235,7 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-code +// GitHub API docs: https://docs.github.com/en/rest/search#search-code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -270,7 +270,7 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/rest/search/search#search-labels +// GitHub API docs: https://docs.github.com/en/rest/search#search-labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 0499af28d6e..b8295cbf791 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -92,7 +92,7 @@ type SecretScanningAlertUpdateOptions struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -119,7 +119,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -146,7 +146,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -173,7 +173,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -196,7 +196,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -219,7 +219,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/security_advisories.go b/github/security_advisories.go index ecd6ae566f3..a75fce54d95 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -15,7 +15,7 @@ type SecurityAdvisoriesService service // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) diff --git a/github/teams.go b/github/teams.go index a41cdbaa41d..0ee7c200792 100644 --- a/github/teams.go +++ b/github/teams.go @@ -81,7 +81,7 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -174,7 +174,7 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#create-a-team func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) req, err := s.client.NewRequest("POST", u, team) @@ -220,7 +220,7 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) @@ -247,7 +247,7 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) @@ -274,7 +274,7 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -287,7 +287,7 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("DELETE", u, nil) @@ -300,7 +300,7 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID) u, err := addOptions(u, opts) @@ -324,7 +324,7 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/teams", org, slug) u, err := addOptions(u, opts) @@ -348,7 +348,7 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID) u, err := addOptions(u, opts) @@ -376,7 +376,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos", org, slug) u, err := addOptions(u, opts) @@ -406,7 +406,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -430,7 +430,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -469,7 +469,7 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -484,7 +484,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -499,7 +499,7 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -514,7 +514,7 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -526,8 +526,7 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne } // ListUserTeams lists a user's teams -// -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { u := "user/teams" u, err := addOptions(u, opts) @@ -551,7 +550,7 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) @@ -575,7 +574,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // ListTeamProjectsBySlug lists the organization projects for a team given the team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) @@ -600,7 +599,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -624,7 +623,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -661,7 +660,7 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -680,7 +679,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -702,7 +701,7 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -724,7 +723,7 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -753,7 +752,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-an-organization func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -778,7 +777,7 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -799,7 +798,7 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -820,7 +819,7 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -841,7 +840,7 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -889,7 +888,7 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -916,7 +915,7 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/external-groups", org) u, err := addOptions(u, opts) @@ -940,7 +939,7 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -960,7 +959,7 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -980,7 +979,7 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index ad4584c9eaf..f3a1cc4dc00 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -43,7 +43,7 @@ type DiscussionCommentListOptions struct { // ListCommentsByID lists all comments on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) u, err := addOptions(u, options) @@ -68,7 +68,7 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 // ListCommentsBySlug lists all comments on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) u, err := addOptions(u, options) @@ -93,7 +93,7 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, // GetCommentByID gets a specific comment on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -113,7 +113,7 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, // GetCommentBySlug gets a specific comment on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) @@ -134,7 +134,7 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // CreateCommentByID creates a new comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -154,7 +154,7 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // CreateCommentBySlug creates a new comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -175,7 +175,7 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -196,7 +196,7 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -216,7 +216,7 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, // DeleteCommentByID deletes a comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -230,7 +230,7 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 // DeleteCommentBySlug deletes a comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_discussions.go b/github/teams_discussions.go index 246f919ee2d..69a3ebd51ff 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -49,7 +49,7 @@ type DiscussionListOptions struct { // ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) u, err := addOptions(u, opts) @@ -74,7 +74,7 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in // ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) u, err := addOptions(u, opts) @@ -99,7 +99,7 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri // GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +119,7 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 // GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -139,7 +139,7 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string // CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) req, err := s.client.NewRequest("POST", u, discussion) @@ -159,7 +159,7 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i // CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) req, err := s.client.NewRequest("POST", u, discussion) @@ -180,7 +180,7 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -201,7 +201,7 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -221,7 +221,7 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin // DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -235,7 +235,7 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_members.go b/github/teams_members.go index 9a9bd57db54..58cb79744e1 100644 --- a/github/teams_members.go +++ b/github/teams_members.go @@ -23,7 +23,7 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) u, err := addOptions(u, opts) @@ -48,7 +48,7 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) u, err := addOptions(u, opts) @@ -73,7 +73,7 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("GET", u, nil) @@ -93,7 +93,7 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#get-team-membership-for-a-user func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("GET", u, nil) @@ -127,7 +127,7 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -147,7 +147,7 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -167,7 +167,7 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +181,7 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -195,7 +195,7 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) u, err := addOptions(u, opts) @@ -220,7 +220,7 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) u, err := addOptions(u, opts) diff --git a/github/users.go b/github/users.go index 47691f65a01..1b0670103b3 100644 --- a/github/users.go +++ b/github/users.go @@ -79,8 +79,8 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user -// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-a-user func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { @@ -123,7 +123,7 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#update-the-authenticated-user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" req, err := s.client.NewRequest("PATCH", u, user) @@ -165,7 +165,7 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { u := fmt.Sprintf("users/%v/hovercard", user) u, err := addOptions(u, opts) @@ -203,7 +203,7 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/en/rest/users/users#list-users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { u, err := addOptions("users", opts) if err != nil { @@ -227,7 +227,7 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u, err := addOptions("user/repository_invitations", opts) if err != nil { @@ -251,7 +251,7 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#accept-a-repository-invitation func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("PATCH", u, nil) @@ -265,7 +265,7 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#decline-a-repository-invitation func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index f9299c7e653..aef947ec451 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://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +26,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://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -45,7 +45,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://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -59,7 +59,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://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/github/users_blocking.go b/github/users_blocking.go index 22eba4577f2..3d38d947898 100644 --- a/github/users_blocking.go +++ b/github/users_blocking.go @@ -12,7 +12,7 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#list-users-blocked-by-the-authenticated-user func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { u := "user/blocks" u, err := addOptions(u, opts) @@ -39,7 +39,7 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -58,7 +58,7 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#block-a-user func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -75,7 +75,7 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/blocking#unblock-a-user func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) diff --git a/github/users_emails.go b/github/users_emails.go index fdb8aafeaed..67bd210e8d5 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -17,7 +17,7 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { u := "user/emails" u, err := addOptions(u, opts) @@ -41,7 +41,7 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#add-an-email-address-for-the-authenticated-user func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" req, err := s.client.NewRequest("POST", u, emails) @@ -60,7 +60,7 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#delete-an-email-address-for-the-authenticated-user func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" req, err := s.client.NewRequest("DELETE", u, emails) @@ -74,7 +74,7 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" diff --git a/github/users_followers.go b/github/users_followers.go index f855af5d27a..1266e0e9ee3 100644 --- a/github/users_followers.go +++ b/github/users_followers.go @@ -13,8 +13,8 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user -// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-a-user func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows -// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-the-authenticated-user-follows +// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-a-user-follows func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -75,8 +75,8 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-user-follows-another-user func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string if user != "" { @@ -97,7 +97,7 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#follow-a-user func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("PUT", u, nil) @@ -110,7 +110,7 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/en/rest/users/followers#unfollow-a-user func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 2e3a43da3eb..54189b83077 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -44,8 +44,8 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-a-user func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { @@ -75,7 +75,7 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -95,7 +95,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#create-a-gpg-key func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` @@ -117,7 +117,7 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_keys.go b/github/users_keys.go index 6897657978c..b49b8e4b4ef 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -30,8 +30,8 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user -// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-keys-for-a-user func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { @@ -60,7 +60,7 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) @@ -80,7 +80,7 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" @@ -100,7 +100,7 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) diff --git a/github/users_packages.go b/github/users_packages.go index b77eb2f37ee..da04919eccd 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,8 @@ import ( // List the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace +// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-a-user func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // Get a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-a-user func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -71,8 +71,8 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // Delete a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-a-user func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -92,8 +92,8 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // Restore a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-a-user func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -113,8 +113,8 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // Get all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-a-user func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -144,8 +144,8 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // Get a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-a-user func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -171,8 +171,8 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // Delete a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-a-user func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -192,8 +192,8 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // Restore a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-a-user func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { diff --git a/github/users_projects.go b/github/users_projects.go index 674ce01501e..0cbd61f923c 100644 --- a/github/users_projects.go +++ b/github/users_projects.go @@ -12,7 +12,7 @@ import ( // ListProjects lists the projects for the specified user. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-user-projects func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("users/%v/projects", user) u, err := addOptions(u, opts) @@ -47,7 +47,7 @@ type CreateUserProjectOptions struct { // CreateProject creates a GitHub Project for the current user. // -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project +// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-user-project func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go index 9378ae73370..567623f8875 100644 --- a/github/users_ssh_signing_keys.go +++ b/github/users_ssh_signing_keys.go @@ -25,8 +25,8 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) { var u string if user != "" { @@ -55,7 +55,7 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) @@ -75,7 +75,7 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { u := "user/ssh_signing_keys" @@ -95,7 +95,7 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) From ae5fd841b8bcdb2bfefdfcfb292d110e4009aa0c Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 10:33:22 -0500 Subject: [PATCH 14/34] update regex --- tools/internal/metadata.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 193e71a508b..895f1e8540c 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -308,7 +308,7 @@ func updateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { } var ( - docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s+(https?://\S+)`) + docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s*(https?://\S+)`) emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) ) From 000231cec5ff358033382429cf4eaad2a1270bf9 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 10:36:06 -0500 Subject: [PATCH 15/34] update-urls --- github/actions_required_workflows.go | 20 +++++------ github/actions_variables.go | 2 +- github/actions_workflow_runs.go | 4 +-- github/activity.go | 2 ++ github/activity_notifications.go | 2 +- github/admin.go | 2 +- github/admin_orgs.go | 6 ++-- github/admin_stats.go | 2 +- github/admin_users.go | 8 ++--- github/apps.go | 2 +- github/apps_hooks.go | 4 +-- github/apps_marketplace.go | 9 +++-- github/authorizations.go | 4 +-- github/billing.go | 14 ++++---- github/code-scanning.go | 2 +- github/codespaces_secrets.go | 2 +- github/dependency_graph.go | 2 +- github/git_commits.go | 2 +- github/gitignore.go | 4 +-- github/issue_import.go | 6 ++-- github/licenses.go | 4 +-- github/misc.go | 16 +++++---- github/orgs_packages.go | 16 ++++----- github/pulls_reviewers.go | 2 +- github/reactions.go | 50 ++++++++++++++-------------- github/repos.go | 10 +++--- github/repos_commits.go | 1 - github/repos_contents.go | 7 +++- github/repos_environments.go | 2 +- github/repos_hooks.go | 4 +-- github/repos_keys.go | 8 ++--- github/repos_pages.go | 18 +++++----- github/repos_prereceive_hooks.go | 8 ++--- github/scim.go | 12 +++---- github/search.go | 14 ++++---- github/secret_scanning.go | 12 +++---- github/users_administration.go | 8 ++--- github/users_gpg_keys.go | 2 +- github/users_packages.go | 32 +++++++++--------- 39 files changed, 168 insertions(+), 157 deletions(-) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 3566eb9d207..18c29869be8 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -67,7 +67,7 @@ type RepoRequiredWorkflows struct { // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -91,7 +91,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // CreateRequiredWorkflow creates the required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -110,7 +110,7 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -130,7 +130,7 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri // UpdateRequiredWorkflow updates a required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -149,7 +149,7 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, // DeleteRequiredWorkflow deletes a required workflow in an org. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#update-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -161,7 +161,7 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-selected-repositories-for-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -184,7 +184,7 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#sets-repositories-for-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -200,7 +200,7 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o // AddRepoToRequiredWorkflow adds the Repository to a required workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -212,7 +212,7 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. // -// GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#add-a-repository-to-a-required-workflow +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -224,7 +224,7 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. // -// Github API docs:https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#list-repository-required-workflows +// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/actions_variables.go b/github/actions_variables.go index 29445edd042..5cab118804e 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -170,7 +170,7 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) return s.patchVariable(ctx, url, variable) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index 00221086116..4d3083f7484 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -126,7 +126,7 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -134,7 +134,7 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) diff --git a/github/activity.go b/github/activity.go index 9cd9f9b71d7..f92c8e41a31 100644 --- a/github/activity.go +++ b/github/activity.go @@ -57,6 +57,8 @@ type FeedLinks struct { // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. +// +// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { req, err := s.client.NewRequest("GET", "feeds", nil) if err != nil { diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 03476c2e2c3..5c8fe95a2c5 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -102,7 +102,7 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity#mark-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, diff --git a/github/admin.go b/github/admin.go index 1b28ef64c7d..2db7178bd74 100644 --- a/github/admin.go +++ b/github/admin.go @@ -101,7 +101,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/en/rest/enterprise/ldap/#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 448e51f631e..4ea796b8e07 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/orgs#create-an-organization func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +59,14 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, newName) } // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 17e568f62b2..8583f1a9549 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/en/rest/enterprise-admin/admin_stats/ +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/admin-stats#get-all-statistics func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index d756a77e20d..0b9b7e7a6ad 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 Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-a-new-user +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#create-a-user func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +44,7 @@ func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*Us // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#delete-a-user func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -115,7 +115,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/apps.go b/github/apps.go index ab83d59ab2f..f82bd01f0b8 100644 --- a/github/apps.go +++ b/github/apps.go @@ -294,7 +294,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// TODO: Find GitHub API docs. +// GitHub API docs: https://docs.github.com/rest/reference/apps#create-a-content-attachment func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} diff --git a/github/apps_hooks.go b/github/apps_hooks.go index e3bd2afc032..a11f688b2a5 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,7 @@ import ( // GetHookConfig returns the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -31,7 +31,7 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // UpdateHookConfig updates the webhook configuration for a GitHub App. // The underlying transport must be authenticated as an app. // -// GitHub API docs: https://docs.github.com/en/rest/apps#update-a-webhook-configuration-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 32889abd240..c1f60977319 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -89,7 +89,8 @@ type MarketplacePurchaseAccount struct { // ListPlans lists all plans for your Marketplace listing. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -113,7 +114,8 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan. // -// GitHub API docs: https://docs.github.com/en/rest/apps#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -137,7 +139,8 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // GetPlanAccountForAccount get GitHub account (user or organization) associated with an account. // -// GitHub API docs: https://docs.github.com/en/rest/apps#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) diff --git a/github/authorizations.go b/github/authorizations.go index ea0897e3627..752882f91d2 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -249,7 +249,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://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -269,7 +269,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/billing.go b/github/billing.go index 7a76bf86fda..765249217f5 100644 --- a/github/billing.go +++ b/github/billing.go @@ -62,7 +62,7 @@ type AdvancedSecurityCommittersBreakdown struct { // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -81,7 +81,7 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -101,7 +101,7 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // GetStorageBillingOrg returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for an Org. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -120,7 +120,7 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/billing?apiVersion=2022-11-28#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) @@ -144,7 +144,7 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-actions-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -163,7 +163,7 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-github-packages-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -183,7 +183,7 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // GetStorageBillingUser returns the estimated paid and estimated total storage used for GitHub Actions // and GitHub Packages in gigabytes for a user. // -// GitHub API docs: https://docs.github.com/en/rest/billing#get-shared-storage-billing-for-a-user +// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/code-scanning.go b/github/code-scanning.go index 0ae269be676..5fd2d60b786 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -317,7 +317,7 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#update-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) diff --git a/github/codespaces_secrets.go b/github/codespaces_secrets.go index e11c679c668..7bed741858b 100644 --- a/github/codespaces_secrets.go +++ b/github/codespaces_secrets.go @@ -312,7 +312,7 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) return s.setSelectedRepoForSecret(ctx, u, ids) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index e578965cc12..ba95bd3d5e3 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -61,7 +61,7 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) diff --git a/github/git_commits.go b/github/git_commits.go index 862837c0d59..946ced82205 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -69,7 +69,7 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/gitignore.go b/github/gitignore.go index a20a868b44a..b0cc5ca684b 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -28,7 +28,7 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore/#listing-available-templates +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -46,7 +46,7 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore#get-a-gitignore-template +// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/issue_import.go b/github/issue_import.go index 04899772bd1..c56dffaa4ed 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -70,7 +70,7 @@ type IssueImportError struct { // Create a new imported issue on the specified repository. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -99,7 +99,7 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss // CheckStatus checks the status of an imported issue. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) req, err := s.client.NewRequest("GET", u, nil) @@ -121,7 +121,7 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // -// https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/licenses.go b/github/licenses.go index 0877b6d1831..fdaae5cfaa9 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -60,7 +60,7 @@ func (l License) String() string { // List popular open source licenses. // -// GitHub API docs: https://docs.github.com/en/rest/licenses/#list-all-licenses +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -78,7 +78,7 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-a-license +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/misc.go b/github/misc.go index 89615241570..1617c852052 100644 --- a/github/misc.go +++ b/github/misc.go @@ -39,7 +39,7 @@ type markdownRequest struct { // Markdown renders an arbitrary Markdown document. // -// GitHub API docs: https://docs.github.com/en/rest/markdown/ +// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRequest{Text: String(text)} if opts != nil { @@ -67,7 +67,7 @@ func (c *Client) Markdown(ctx context.Context, text string, opts *MarkdownOption // ListEmojis returns the emojis available to use on GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/emojis/ +// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { req, err := c.NewRequest("GET", "emojis", nil) if err != nil { @@ -97,7 +97,7 @@ func (c *CodeOfConduct) String() string { // ListCodesOfConduct returns all codes of conduct. // -// GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := c.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -118,7 +118,7 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // GetCodeOfConduct returns an individual code of conduct. // -// https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct +// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := c.NewRequest("GET", u, nil) @@ -190,7 +190,7 @@ type APIMeta struct { // this endpoint on your organization’s GitHub Enterprise installation, this // endpoint provides information about that installation. // -// GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { req, err := c.NewRequest("GET", "meta", nil) if err != nil { @@ -208,6 +208,8 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used. +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { @@ -231,6 +233,8 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // Zen returns a random line from The Zen of GitHub. // // see also: http://warpspire.com/posts/taste/ +// +// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github func (c *Client) Zen(ctx context.Context) (string, *Response, error) { req, err := c.NewRequest("GET", "zen", nil) if err != nil { @@ -260,8 +264,6 @@ func (s *ServiceHook) String() string { } // ListServiceHooks lists all of the available service hooks. -// -// GitHub API docs: https://developer.github.com/webhooks/#services func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error) { u := "hooks" req, err := c.NewRequest("GET", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0ae68aaa369..0dfe7841695 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,7 @@ import ( // List the packages for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -36,7 +36,7 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // Get a package by name from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +55,7 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // Delete a package from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) { u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +68,7 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // Restore a package to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) @@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization 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, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // Get a specific version of a package in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization 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) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +124,7 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // Delete a package version from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization 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) req, err := s.client.NewRequest("DELETE", u, nil) @@ -137,7 +137,7 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // Restore a package version to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-an-organization +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization 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) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 1c336540b81..96b49651b96 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -44,7 +44,7 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#list-requested-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/reactions.go b/github/reactions.go index 14d193ae887..c246356fd9b 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -60,7 +60,7 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -90,7 +90,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -114,7 +114,7 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -123,7 +123,7 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -132,7 +132,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -162,7 +162,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -186,7 +186,7 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -195,7 +195,7 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -204,7 +204,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -234,7 +234,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -258,7 +258,7 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -267,7 +267,7 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -276,7 +276,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -306,7 +306,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // previously created reaction will be returned with Status: 200 OK. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-pull-request-review-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -330,7 +330,7 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -339,7 +339,7 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -348,7 +348,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -375,7 +375,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // CreateTeamDiscussionReaction creates a reaction for a team discussion. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -398,7 +398,7 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -407,7 +407,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -416,7 +416,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#list-reactions-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -442,7 +442,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment-legacy +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -465,7 +465,7 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#delete-team-discussion-comment-reaction +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -474,7 +474,7 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-team-discussion-comment +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -498,7 +498,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // added the reaction type to this release. // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // -// GitHub API docs: https://docs.github.com/en/rest/reactions#create-reaction-for-a-release +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 83fc3f8e734..235f7780f14 100644 --- a/github/repos.go +++ b/github/repos.go @@ -543,7 +543,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep // Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1518,7 +1518,7 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // -// GitHub API docs: https://docs.github.com/en/rest/licenses#get-the-license-for-a-repository +// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1940,7 +1940,7 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("PUT", u, users) @@ -1962,7 +1962,7 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("POST", u, users) @@ -1984,7 +1984,7 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // // Note: The list of users, apps, and teams in total is limited to 100 items. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, branch) req, err := s.client.NewRequest("DELETE", u, users) diff --git a/github/repos_commits.go b/github/repos_commits.go index d1fb577c61c..90dd6df088d 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -148,7 +148,6 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-single-commit // GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) diff --git a/github/repos_contents.go b/github/repos_contents.go index de7a0d5b82b..cebd71583f4 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -128,6 +128,8 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -162,6 +164,8 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // It is possible for the download to result in a failed response when the // returned error is nil. Callers should check the returned Response status // code to verify the content is from a successful response. +// +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -310,7 +314,8 @@ const ( // repository. The archiveFormat can be specified by either the github.Tarball // or github.Zipball constant. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents/#get-archive-link +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar +// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_environments.go b/github/repos_environments.go index 2399a42c746..e75c8f22af8 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -106,7 +106,7 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-all-environments +// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index ba229e7bca8..2b379ddf395 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -202,7 +202,7 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, // Subscribe lets servers register to receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -214,7 +214,7 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks#pubsubhubbub +// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/github/repos_keys.go b/github/repos_keys.go index 42c5de49709..c6f0c8b371e 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,7 @@ import ( // ListKeys lists the deploy keys for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#list-deploy-keys +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -38,7 +38,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#get-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -58,7 +58,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#create-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -78,7 +78,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // -// GitHub API docs: https://docs.github.com/en/rest/deploy-keys#delete-a-deploy-key +// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_pages.go b/github/repos_pages.go index 83075dbdd23..188d2f9ae39 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -103,7 +103,7 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#create-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -153,7 +153,7 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#update-information-about-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -172,7 +172,7 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // -// GitHub API docs: https://docs.github.com/en/rest/pages#delete-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -188,7 +188,7 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-github-pages-site +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -207,7 +207,7 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#list-github-pages-builds +// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -231,7 +231,7 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-latest-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -250,7 +250,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -269,7 +269,7 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // -// GitHub API docs: https://docs.github.com/en/rest/pages#request-a-github-pages-build +// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) @@ -288,7 +288,7 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/en/rest/pages#get-a-dns-health-check-for-github-pages +// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index 1ce6478d33b..b5873cef705 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://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#list-pre-receive-hooks +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#get-a-single-pre-receive-hook +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -73,7 +73,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#update-pre-receive-hook-enforcement +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -95,7 +95,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/#remove-enforcement-overrides-for-a-pre-receive-hook +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/scim.go b/github/scim.go index 7deee6be4b5..89bd9621a27 100644 --- a/github/scim.go +++ b/github/scim.go @@ -81,7 +81,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/rest/scim/scim#list-scim-provisioned-identities func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/en/rest/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/rest/scim/scim#provision-and-invite-a-scim-user func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -123,7 +123,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/rest/scim/scim#get-scim-provisioning-information-for-a-user func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -142,7 +142,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/rest/scim/scim#update-a-provisioned-organization-membership func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/rest/scim/scim#update-an-attribute-for-a-scim-user func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -193,7 +193,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/scim/scim#delete-a-scim-user-from-an-organization func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index adb832d0d8f..18e98c27de1 100644 --- a/github/search.go +++ b/github/search.go @@ -72,7 +72,7 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-repositories +// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -107,7 +107,7 @@ type TopicResult struct { // Please see https://help.github.com/en/articles/searching-topics for more // information about search qualifiers. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-topics +// GitHub API docs: https://docs.github.com/rest/search/search#search-topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -142,7 +142,7 @@ type CommitResult struct { // Commits searches commits via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-commits +// GitHub API docs: https://docs.github.com/rest/search/search#search-commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -162,7 +162,7 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-issues-and-pull-requests +// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -182,7 +182,7 @@ type UsersSearchResult struct { // Users searches users via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-users +// GitHub API docs: https://docs.github.com/rest/search/search#search-users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -235,7 +235,7 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-code +// GitHub API docs: https://docs.github.com/rest/search/search#search-code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -270,7 +270,7 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // -// GitHub API docs: https://docs.github.com/en/rest/search#search-labels +// GitHub API docs: https://docs.github.com/rest/search/search#search-labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) diff --git a/github/secret_scanning.go b/github/secret_scanning.go index b8295cbf791..0499af28d6e 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -92,7 +92,7 @@ type SecretScanningAlertUpdateOptions struct { // To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -119,7 +119,7 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -146,7 +146,7 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -173,7 +173,7 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -196,7 +196,7 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -219,7 +219,7 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with // the repo scope or security_events scope. // -// GitHub API docs: https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert +// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/users_administration.go b/github/users_administration.go index aef947ec451..31710fb38ca 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://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +26,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://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#demote-a-site-administrator func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -45,7 +45,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#suspend-a-user func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -59,7 +59,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#unsuspend-a-user func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 54189b83077..8b401b83f29 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -95,7 +95,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth // or OAuth with at least write:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#create-a-gpg-key +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` diff --git a/github/users_packages.go b/github/users_packages.go index da04919eccd..b77eb2f37ee 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,8 @@ import ( // List the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-the-authenticated-users-namespace -// GitHub API docs: https://docs.github.com/en/rest/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -44,8 +44,8 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // Get a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -71,8 +71,8 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // Delete a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -92,8 +92,8 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // Restore a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -113,8 +113,8 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // Get all versions of a package for a user. Passing the empty string for "user" will // get versions for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -144,8 +144,8 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // Get a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -171,8 +171,8 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // Delete a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#delete-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -192,8 +192,8 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // Restore a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-a-package-version-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/packages#restore-package-version-for-a-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { From e21c51b8b9c5b64fa7e5ab718cbd590681389685 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 10:54:14 -0500 Subject: [PATCH 16/34] include enterprise-server version in doc links --- github/admin.go | 4 ++-- github/admin_orgs.go | 6 +++--- github/admin_stats.go | 2 +- github/admin_users.go | 8 ++++---- github/apps.go | 2 +- github/authorizations.go | 4 ++-- github/repos_prereceive_hooks.go | 8 ++++---- github/users_administration.go | 8 ++++---- tools/internal/metadata.go | 3 +++ 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/github/admin.go b/github/admin.go index 2db7178bd74..f9d85d2b75e 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/en/enterprise-server/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -101,7 +101,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/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 4ea796b8e07..4a22deb8c98 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/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +59,14 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, newName) } // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 8583f1a9549..9e0bbf77f6f 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/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index 0b9b7e7a6ad..5a7c0e8a099 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/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +44,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/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -115,7 +115,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/apps.go b/github/apps.go index f82bd01f0b8..f769e878f94 100644 --- a/github/apps.go +++ b/github/apps.go @@ -294,7 +294,7 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // -// GitHub API docs: https://docs.github.com/rest/reference/apps#create-a-content-attachment +// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} diff --git a/github/authorizations.go b/github/authorizations.go index 752882f91d2..9c821827958 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -249,7 +249,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/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -269,7 +269,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/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index b5873cef705..cd4c81431ec 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/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-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 func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +51,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/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.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -73,7 +73,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/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.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -95,7 +95,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/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.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index 31710fb38ca..f9299c7e653 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/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -26,7 +26,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/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -45,7 +45,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -59,7 +59,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/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 895f1e8540c..6edee34cd64 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -394,6 +394,9 @@ func normalizeDocURLPath(u string) string { if pre == "" { return u } + if strings.Contains(u, "docs.github.com/enterprise-server") { + return u + } return docURLPrefix + strings.TrimPrefix(u, pre) } From 1bf8fd62c6a20711917a3d898de36883b03add9f Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 10 Sep 2023 11:00:48 -0500 Subject: [PATCH 17/34] add copyright notice --- tools/cmd/metadata/metadata.go | 5 +++++ tools/internal/internal.go | 5 +++++ tools/internal/metadata.go | 5 +++++ tools/internal/openapi.go | 5 +++++ tools/internal/openapi_test.go | 5 +++++ tools/internal/validate.go | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/tools/cmd/metadata/metadata.go b/tools/cmd/metadata/metadata.go index ed29f0a9479..7563218b05f 100644 --- a/tools/cmd/metadata/metadata.go +++ b/tools/cmd/metadata/metadata.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 main import ( diff --git a/tools/internal/internal.go b/tools/internal/internal.go index 06800481fa9..8833d790db2 100644 --- a/tools/internal/internal.go +++ b/tools/internal/internal.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 internal import ( diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 6edee34cd64..4ae2f3f35a9 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.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 internal import ( diff --git a/tools/internal/openapi.go b/tools/internal/openapi.go index 9b1d2c3b9b4..905c965746c 100644 --- a/tools/internal/openapi.go +++ b/tools/internal/openapi.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 internal import ( diff --git a/tools/internal/openapi_test.go b/tools/internal/openapi_test.go index 59f4f7b11e0..905c58be56e 100644 --- a/tools/internal/openapi_test.go +++ b/tools/internal/openapi_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 internal import ( diff --git a/tools/internal/validate.go b/tools/internal/validate.go index 42cf02a0c28..ab22316deca 100644 --- a/tools/internal/validate.go +++ b/tools/internal/validate.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 internal import ( From 0137f71d899dc633d414df02fe37a09182575bca Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 15 Sep 2023 15:31:00 -0500 Subject: [PATCH 18/34] use ast in update-urls --- tools/internal/metadata.go | 92 +++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 4ae2f3f35a9..06627fbd567 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -9,7 +9,11 @@ import ( "bytes" "context" "encoding/json" - "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" "io/fs" "net/url" "os" @@ -19,8 +23,6 @@ import ( "strings" "sync" - "github.com/dave/dst" - "github.com/dave/dst/decorator" "golang.org/x/exp/maps" "golang.org/x/exp/slices" "gopkg.in/yaml.v3" @@ -290,26 +292,27 @@ func UpdateDocLinks(meta *Metadata, dir string) error { // updateDocsLinksInFile updates in the code comments in content with doc urls from metadata. func updateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { - df, err := decorator.Parse(content) + fset := token.NewFileSet() + node, err := parser.ParseFile(fset, "", content, parser.ParseComments) if err != nil { return nil, err } // ignore files where package is not github - if df.Name.Name != "github" { + if node.Name.Name != "github" { return content, nil } - dst.Inspect(df, func(n dst.Node) bool { + ast.Inspect(node, func(n ast.Node) bool { return updateDocsLinksForNode(metadata, n) }) var buf bytes.Buffer - err = decorator.Fprint(&buf, df) + err = printer.Fprint(&buf, fset, node) if err != nil { return nil, err } - return buf.Bytes(), nil + return format.Source(buf.Bytes()) } var ( @@ -317,23 +320,26 @@ var ( emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) ) -func updateDocsLinksForNode(metadata *Metadata, n dst.Node) bool { - d, ok := n.(*dst.FuncDecl) - if !ok || - !d.Name.IsExported() || - d.Recv == nil { +func updateDocsLinksForNode(metadata *Metadata, n ast.Node) bool { + fn, ok := n.(*ast.FuncDecl) + if !ok || !fn.Name.IsExported() { return true } + methodName := fn.Name.Name // Get the method's receiver. It can be either an identifier or a pointer to an identifier. // This assumes all receivers are named and we don't have something like: `func (Client) Foo()`. - methodName := d.Name.Name receiverType := "" - switch x := d.Recv.List[0].Type.(type) { - case *dst.Ident: - receiverType = x.Name - case *dst.StarExpr: - receiverType = x.X.(*dst.Ident).Name + if fn.Recv != nil { + switch x := fn.Recv.List[0].Type.(type) { + case *ast.Ident: + receiverType = x.Name + case *ast.StarExpr: + receiverType = x.X.(*ast.Ident).Name + } + } + if !ast.IsExported(receiverType) { + return true } linksMap := map[string]struct{}{} @@ -342,51 +348,57 @@ func updateDocsLinksForNode(metadata *Metadata, n dst.Node) bool { linksMap[op.DocumentationURL()] = struct{}{} } - // create copy of comments with non-matching doc links removed - var commentLines []string - for _, line := range d.Decs.Start.All() { - match := docLineRE.FindStringSubmatch(line) + // create copy of comment group with non-matching doc links removed + if fn.Doc == nil { + fn.Doc = &ast.CommentGroup{} + } + fnComments := make([]*ast.Comment, 0, len(fn.Doc.List)) + for _, comment := range fn.Doc.List { + match := docLineRE.FindStringSubmatch(comment.Text) if match == nil { - commentLines = append(commentLines, line) + fnComments = append(fnComments, comment) continue } matchesLink := false for link := range linksMap { if sameDocLink(match[2], link) { - //fmt.Println("match", match[2], link) matchesLink = true delete(linksMap, link) break } } if matchesLink { - commentLines = append(commentLines, line) + fnComments = append(fnComments, comment) } } - docLinks := maps.Keys(linksMap) - sort.Strings(docLinks) - // remove trailing empty lines - for len(commentLines) > 0 { - if !emptyLineRE.MatchString(commentLines[len(commentLines)-1]) { + for len(fnComments) > 0 { + if !emptyLineRE.MatchString(fnComments[len(fnComments)-1].Text) { break } - commentLines = commentLines[:len(commentLines)-1] + fnComments = fnComments[:len(fnComments)-1] } // add an empty line before adding doc links - if len(docLinks) > 0 && - len(commentLines) > 0 && - !emptyLineRE.MatchString(commentLines[len(commentLines)-1]) { - commentLines = append(commentLines, "//") + if len(linksMap) > 0 && + len(fnComments) > 0 && + !emptyLineRE.MatchString(fnComments[len(fnComments)-1].Text) { + fnComments = append(fnComments, &ast.Comment{Text: "//"}) } + docLinks := maps.Keys(linksMap) + sort.Strings(docLinks) + for _, dl := range docLinks { - dl = normalizeDocURLPath(dl) - commentLines = append(commentLines, fmt.Sprintf("// GitHub API docs: %s", dl)) - } - d.Decs.Start.Replace(commentLines...) + fnComments = append( + fnComments, + &ast.Comment{ + Text: "// GitHub API docs: " + normalizeDocURLPath(dl), + }, + ) + } + fn.Doc.List = fnComments return true } From 0f657ae72f65a3d563bd4db31b48668ab3d47dfe Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 15 Sep 2023 15:49:03 -0500 Subject: [PATCH 19/34] use ast in getServiceMethodsFromFile --- tools/go.mod | 2 -- tools/go.sum | 6 ------ tools/internal/internal.go | 24 ++++++++++++++---------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index f14a10b195b..ea4bd46a989 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( github.com/alecthomas/kong v0.8.0 - github.com/dave/dst v0.27.2 github.com/getkin/kin-openapi v0.119.0 github.com/google/go-github/v55 v55.0.0 github.com/stretchr/testify v1.8.4 @@ -29,5 +28,4 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.12.0 // indirect golang.org/x/sys v0.12.0 // indirect - golang.org/x/tools v0.13.0 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 224a611f2a1..4b0b4f21b92 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -9,9 +9,6 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc= -github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc= -github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -48,7 +45,6 @@ github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55F github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -76,8 +72,6 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/tools/internal/internal.go b/tools/internal/internal.go index 8833d790db2..be1e54d6854 100644 --- a/tools/internal/internal.go +++ b/tools/internal/internal.go @@ -7,13 +7,14 @@ package internal import ( "fmt" + "go/ast" + "go/parser" + "go/token" "os" "path/filepath" "sort" "strings" - "github.com/dave/dst" - "github.com/dave/dst/decorator" "golang.org/x/mod/modfile" "golang.org/x/mod/module" ) @@ -99,35 +100,38 @@ func getServiceMethods(dir string) ([]*serviceMethod, error) { return serviceMethods, nil } +// getServiceMethodsFromFile is like getServiceMethodsFromFileDST, but uses +// the AST package instead of the DST package. func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { if !strings.HasSuffix(filename, ".go") || strings.HasSuffix(filename, "_test.go") { return nil, nil } - df, err := decorator.ParseFile(nil, filename, nil, 0) + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) if err != nil { return nil, err } // Only look at the github package - if df.Name.Name != "github" { + if f.Name.Name != "github" { return nil, nil } var serviceMethods []*serviceMethod - dst.Inspect(df, func(n dst.Node) bool { - decl, ok := n.(*dst.FuncDecl) + ast.Inspect(f, func(n ast.Node) bool { + decl, ok := n.(*ast.FuncDecl) if !ok { return true } if decl.Recv == nil || len(decl.Recv.List) != 1 { return true } - se, ok := decl.Recv.List[0].Type.(*dst.StarExpr) + se, ok := decl.Recv.List[0].Type.(*ast.StarExpr) if !ok { return true } - id, ok := se.X.(*dst.Ident) + id, ok := se.X.(*ast.Ident) if !ok { return true } @@ -138,7 +142,7 @@ func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { // The receiver must either end with Service or be named Client. // The exception is github.go, which contains Client methods we want to skip. - if !dst.IsExported(methodName) || !dst.IsExported(receiverName) { + if !ast.IsExported(methodName) || !ast.IsExported(receiverName) { return true } if receiverName != "Client" && !strings.HasSuffix(receiverName, "Service") { @@ -155,4 +159,4 @@ func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { return true }) return serviceMethods, nil -} +} \ No newline at end of file From dfb3c8c2c1d5c937364b0a3b28324b75fe69708f Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 15 Sep 2023 15:52:53 -0500 Subject: [PATCH 20/34] go fmt --- tools/internal/internal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/internal/internal.go b/tools/internal/internal.go index be1e54d6854..d9a506195aa 100644 --- a/tools/internal/internal.go +++ b/tools/internal/internal.go @@ -159,4 +159,4 @@ func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { return true }) return serviceMethods, nil -} \ No newline at end of file +} From 9a85b6993da4e7fbf8e7a3132966bdfcd9c091d6 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 15 Sep 2023 16:58:49 -0500 Subject: [PATCH 21/34] Use enterprise-cloud links --- github/actions_cache.go | 2 +- github/actions_runner_groups.go | 26 +++++++++---------- github/billing.go | 2 +- github/enterprise_actions_runners.go | 8 +++--- github/enterprise_audit_log.go | 2 +- .../enterprise_code_security_and_analysis.go | 4 +-- github/orgs_audit_log.go | 2 +- github/orgs_custom_roles.go | 8 +++--- github/repos_lfs.go | 4 +-- github/scim.go | 12 ++++----- github/teams.go | 10 +++---- tools/internal/metadata.go | 10 +++++++ 12 files changed, 50 insertions(+), 40 deletions(-) diff --git a/github/actions_cache.go b/github/actions_cache.go index 9592d9ab62f..5b047edcf3e 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -217,7 +217,7 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 00b9b6ce091..483ba6c4726 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -104,7 +104,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +123,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -137,7 +137,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -156,7 +156,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -175,7 +175,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -200,7 +200,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -215,7 +215,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -230,7 +230,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -244,7 +244,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -269,7 +269,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -283,7 +283,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -298,7 +298,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/billing.go b/github/billing.go index 765249217f5..748295ff5fd 100644 --- a/github/billing.go +++ b/github/billing.go @@ -120,7 +120,7 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // -// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index 6fc30d50258..bdb91fb2b9d 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,7 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) req, err := s.client.NewRequest("GET", u, nil) @@ -51,7 +51,7 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -71,7 +71,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -95,7 +95,7 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index 40648673385..ae3a62b5acd 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,7 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index 3980a86aa4b..aa918400703 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -20,7 +20,7 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#get-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) @@ -40,7 +40,7 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#update-code-security-and-analysis-features-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) req, err := s.client.NewRequest("PATCH", u, settings) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 4c34445fa1b..6c056ead829 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -133,7 +133,7 @@ type AuditEntryData struct { // GetAuditLog gets the audit-log entries for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 7c1b2d6292d..7c5b0617e74 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -30,7 +30,7 @@ type CustomRepoRoles struct { // ListCustomRepoRoles lists the custom repository roles available in this organization. // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -59,7 +59,7 @@ type CreateOrUpdateCustomRoleOptions struct { // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -80,7 +80,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // UpdateCustomRepoRole updates a custom repository role in this organization. // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) @@ -101,7 +101,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // DeleteCustomRepoRole deletes an existing custom repository role in this organization. // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) diff --git a/github/repos_lfs.go b/github/repos_lfs.go index 6ac2e5a8778..fa9af0f1fe8 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -12,7 +12,7 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // -// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#enable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) @@ -31,7 +31,7 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // -// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#disable-git-lfs-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) diff --git a/github/scim.go b/github/scim.go index 89bd9621a27..9e073428cfa 100644 --- a/github/scim.go +++ b/github/scim.go @@ -81,7 +81,7 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#list-scim-provisioned-identities +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -105,7 +105,7 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#provision-and-invite-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -123,7 +123,7 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#get-scim-provisioning-information-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -142,7 +142,7 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#update-a-provisioned-organization-membership +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -175,7 +175,7 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#update-an-attribute-for-a-scim-user +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -193,7 +193,7 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // -// GitHub API docs: https://docs.github.com/rest/scim/scim#delete-a-scim-user-from-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams.go b/github/teams.go index 0ee7c200792..b6ab42771a7 100644 --- a/github/teams.go +++ b/github/teams.go @@ -752,7 +752,7 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -777,7 +777,7 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -798,7 +798,7 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub // given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#list-idp-groups-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -819,7 +819,7 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -840,7 +840,7 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection // between a team and an IDP group given organization name and team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/team-sync#create-or-update-idp-group-connections +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go index 06627fbd567..2b9abdf7c5e 100644 --- a/tools/internal/metadata.go +++ b/tools/internal/metadata.go @@ -407,10 +407,20 @@ const docURLPrefix = "https://docs.github.com/rest/" var docURLPrefixRE = regexp.MustCompile(`^https://docs\.github\.com.*/rest/`) func normalizeDocURLPath(u string) string { + u = strings.Replace(u, "/en/", "/", 1) pre := docURLPrefixRE.FindString(u) if pre == "" { return u } + if strings.Contains(u, "docs.github.com/enterprise-cloud@latest/") { + // remove unsightly double slash + // https://docs.github.com/enterprise-cloud@latest/ + return strings.ReplaceAll( + u, + "docs.github.com/enterprise-cloud@latest//", + "docs.github.com/enterprise-cloud@latest/", + ) + } if strings.Contains(u, "docs.github.com/enterprise-server") { return u } From b0ad415611c26d0f528e90982b2f05d2bbc77426 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sat, 14 Oct 2023 13:40:52 -0500 Subject: [PATCH 22/34] refactor --- .codecov.yml | 4 +- .github/workflows/linter.yml | 18 +- github/apps.go | 2 +- github/github.go | 2 +- github/orgs.go | 2 +- github/repos.go | 2 +- github/security_advisories.go | 2 +- github/users.go | 2 +- metadata.yaml | 12446 +++++++--------- script/lint.sh | 12 +- script/metadata.sh | 14 + tools/go.mod | 21 +- tools/go.sum | 45 +- tools/internal/internal.go | 162 - tools/internal/metadata.go | 452 - tools/internal/openapi_test.go | 84 - tools/internal/validate.go | 103 - .../metadata/metadata.go => metadata/main.go} | 141 +- tools/metadata/main_test.go | 407 + tools/metadata/metadata.go | 573 + tools/{internal => metadata}/openapi.go | 34 +- .../metadata/testdata/canonize/metadata.yaml | 7 + tools/metadata/testdata/format/metadata.yaml | 33 + .../golden/TestCanonize/metadata.yaml | 7 + .../testdata/golden/TestFormat/metadata.yaml | 30 + .../golden/TestUpdateMetadata/metadata.yaml | 18 + .../golden/TestUpdateURLs/github/a.go | 32 + .../testdata/update-metadata/metadata.yaml | 8 + .../metadata/testdata/update-urls/github/a.go | 29 + .../testdata/update-urls/metadata.yaml | 30 + .../testdata/validate_invalid/github/a.go | 32 + .../testdata/validate_invalid/metadata.yaml | 30 + .../testdata/validate_valid/github/a.go | 29 + .../testdata/validate_valid/metadata.yaml | 28 + tools/metadata/validate.go | 201 + 35 files changed, 6739 insertions(+), 8303 deletions(-) create mode 100755 script/metadata.sh delete mode 100644 tools/internal/internal.go delete mode 100644 tools/internal/metadata.go delete mode 100644 tools/internal/openapi_test.go delete mode 100644 tools/internal/validate.go rename tools/{cmd/metadata/metadata.go => metadata/main.go} (52%) create mode 100644 tools/metadata/main_test.go create mode 100644 tools/metadata/metadata.go rename tools/{internal => metadata}/openapi.go (81%) create mode 100644 tools/metadata/testdata/canonize/metadata.yaml create mode 100644 tools/metadata/testdata/format/metadata.yaml create mode 100644 tools/metadata/testdata/golden/TestCanonize/metadata.yaml create mode 100644 tools/metadata/testdata/golden/TestFormat/metadata.yaml create mode 100644 tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml create mode 100644 tools/metadata/testdata/golden/TestUpdateURLs/github/a.go create mode 100644 tools/metadata/testdata/update-metadata/metadata.yaml create mode 100644 tools/metadata/testdata/update-urls/github/a.go create mode 100644 tools/metadata/testdata/update-urls/metadata.yaml create mode 100644 tools/metadata/testdata/validate_invalid/github/a.go create mode 100644 tools/metadata/testdata/validate_invalid/metadata.yaml create mode 100644 tools/metadata/testdata/validate_valid/github/a.go create mode 100644 tools/metadata/testdata/validate_valid/metadata.yaml create mode 100644 tools/metadata/validate.go diff --git a/.codecov.yml b/.codecov.yml index 2ef223a6e96..6488176ce17 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,5 +3,5 @@ ignore: - "github/github-accessors.go" # ignore experimental scrape package - "scrape" - # ignore update-urls - - "update-urls" + # ignore tools + - "tools" diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f0a2911c04d..f9d6d7e4639 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -6,20 +6,7 @@ permissions: jobs: lint: - strategy: - matrix: - platform: [ubuntu-latest] - - # golangci-lint will only process a single module, so we need to call it - # separately for each module in the repo. We dont lint example/newreposecretwithlibsodium - # since that needs libsodium to run. - working-directory: - - "" - - example - - scrape - - tools - runs-on: ${{ matrix.platform }} - + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 @@ -27,3 +14,6 @@ jobs: go-version: 1.x cache-dependency-path: "**/go.sum" - run: script/lint.sh + env: + CHECK_GITHUB_OPENAPI: 1 + GITHUB_TOKEN: ${{ github.token }} diff --git a/github/apps.go b/github/apps.go index 1e2db12fe39..dd9378116cd 100644 --- a/github/apps.go +++ b/github/apps.go @@ -363,7 +363,7 @@ func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, rep // FindRepositoryInstallationByID finds the repository's installation information. // -// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint /repositories/:id/installation. +// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation". func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repositories/%d/installation", id)) } diff --git a/github/github.go b/github/github.go index 94d0616e5c3..f07cc61b8b6 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate go run -C ../tools ./cmd/metadata update-urls +//go:generate ../script/metadata.sh update-urls package github diff --git a/github/orgs.go b/github/orgs.go index 0c7e361b3fc..33e8bf3c8c1 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -223,7 +223,7 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati // GetByID fetches an organization. // -// Note: GetByID uses the undocumented GitHub API endpoint /organizations/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /organizations/{organization_id}". func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) { u := fmt.Sprintf("organizations/%d", id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos.go b/github/repos.go index b0c9fdf31e1..9f5e1b3686b 100644 --- a/github/repos.go +++ b/github/repos.go @@ -566,7 +566,7 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo // GetByID fetches a repository. // -// Note: GetByID uses the undocumented GitHub API endpoint /repositories/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}". func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repository, *Response, error) { u := fmt.Sprintf("repositories/%d", id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/security_advisories.go b/github/security_advisories.go index 681d0cd4bd5..379d9ef70f8 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -97,7 +97,7 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c // ListRepositorySecurityAdvisories lists the security advisories in a repository. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories", owner, repo) url, err := addOptions(url, opt) diff --git a/github/users.go b/github/users.go index 1b0670103b3..e2f4d44ca51 100644 --- a/github/users.go +++ b/github/users.go @@ -104,7 +104,7 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// Note: GetByID uses the undocumented GitHub API endpoint /user/:id. +// Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%d", id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/metadata.yaml b/metadata.yaml index 35f698e5203..f3751e86064 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,11281 +1,8997 @@ -undocumented_methods: - - AppsService.FindRepositoryInstallationByID - - Client.ListServiceHooks - - OrganizationsService.GetByID - - RepositoriesService.GetByID - - UsersService.GetByID +methods: + - name: ActionsService.AddEnabledOrgInEnterprise + operations: + - PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} + - name: ActionsService.AddEnabledReposInOrg + operations: + - PUT /orgs/{org}/actions/permissions/repositories/{repository_id} + - name: ActionsService.AddRepoToRequiredWorkflow + operations: + - PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + - name: ActionsService.AddRepositoryAccessRunnerGroup + operations: + - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + - name: ActionsService.AddRunnerGroupRunners + operations: + - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + - name: ActionsService.AddSelectedRepoToOrgSecret + operations: + - PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + - name: ActionsService.AddSelectedRepoToOrgVariable + operations: + - PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + - name: ActionsService.CancelWorkflowRunByID + operations: + - POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel + - name: ActionsService.CreateEnvVariable + operations: + - POST /repositories/{repository_id}/environments/{environment_name}/variables + - name: ActionsService.CreateOrUpdateEnvSecret + operations: + - PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + - name: ActionsService.CreateOrUpdateOrgSecret + operations: + - PUT /orgs/{org}/actions/secrets/{secret_name} + - name: ActionsService.CreateOrUpdateRepoSecret + operations: + - PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} + - name: ActionsService.CreateOrgVariable + operations: + - POST /orgs/{org}/actions/variables + - name: ActionsService.CreateOrganizationRegistrationToken + operations: + - POST /orgs/{org}/actions/runners/registration-token + - name: ActionsService.CreateOrganizationRemoveToken + operations: + - POST /orgs/{org}/actions/runners/remove-token + - name: ActionsService.CreateOrganizationRunnerGroup + operations: + - POST /orgs/{org}/actions/runner-groups + - name: ActionsService.CreateRegistrationToken + operations: + - POST /repos/{owner}/{repo}/actions/runners/registration-token + - name: ActionsService.CreateRemoveToken + operations: + - POST /repos/{owner}/{repo}/actions/runners/remove-token + - name: ActionsService.CreateRepoVariable + operations: + - POST /repos/{owner}/{repo}/actions/variables + - name: ActionsService.CreateRequiredWorkflow + operations: + - POST /orgs/{org}/actions/required_workflows + - name: ActionsService.CreateWorkflowDispatchEventByFileName + operations: + - POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + - name: ActionsService.CreateWorkflowDispatchEventByID + operations: + - POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + - name: ActionsService.DeleteArtifact + operations: + - DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + - name: ActionsService.DeleteCachesByID + operations: + - DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} + - name: ActionsService.DeleteCachesByKey + operations: + - DELETE /repos/{owner}/{repo}/actions/caches + - name: ActionsService.DeleteEnvSecret + operations: + - DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + - name: ActionsService.DeleteEnvVariable + operations: + - DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} + - name: ActionsService.DeleteOrgSecret + operations: + - DELETE /orgs/{org}/actions/secrets/{secret_name} + - name: ActionsService.DeleteOrgVariable + operations: + - DELETE /orgs/{org}/actions/variables/{name} + - name: ActionsService.DeleteOrganizationRunnerGroup + operations: + - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} + - name: ActionsService.DeleteRepoSecret + operations: + - DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} + - name: ActionsService.DeleteRepoVariable + operations: + - DELETE /repos/{owner}/{repo}/actions/variables/{name} + - name: ActionsService.DeleteRequiredWorkflow + operations: + - DELETE /orgs/{org}/actions/required_workflows/{workflow_id} + - name: ActionsService.DeleteWorkflowRun + operations: + - DELETE /repos/{owner}/{repo}/actions/runs/{run_id} + - name: ActionsService.DeleteWorkflowRunLogs + operations: + - DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs + - name: ActionsService.DisableWorkflowByFileName + operations: + - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + - name: ActionsService.DisableWorkflowByID + operations: + - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + - name: ActionsService.DownloadArtifact + operations: + - GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + - name: ActionsService.EditActionsAllowed + operations: + - PUT /orgs/{org}/actions/permissions/selected-actions + - name: ActionsService.EditActionsAllowedInEnterprise + operations: + - PUT /enterprises/{enterprise}/actions/permissions/selected-actions + - name: ActionsService.EditActionsPermissions + operations: + - PUT /orgs/{org}/actions/permissions + - name: ActionsService.EditActionsPermissionsInEnterprise + operations: + - PUT /enterprises/{enterprise}/actions/permissions + - name: ActionsService.EnableWorkflowByFileName + operations: + - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + - name: ActionsService.EnableWorkflowByID + operations: + - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + - name: ActionsService.GenerateOrgJITConfig + operations: + - POST /orgs/{org}/actions/runners/generate-jitconfig + - name: ActionsService.GenerateRepoJITConfig + operations: + - POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig + - name: ActionsService.GetActionsAllowed + operations: + - GET /orgs/{org}/actions/permissions/selected-actions + - name: ActionsService.GetActionsAllowedInEnterprise + operations: + - GET /enterprises/{enterprise}/actions/permissions/selected-actions + - name: ActionsService.GetActionsPermissions + operations: + - GET /orgs/{org}/actions/permissions + - name: ActionsService.GetActionsPermissionsInEnterprise + operations: + - GET /enterprises/{enterprise}/actions/permissions + - name: ActionsService.GetArtifact + operations: + - GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} + - name: ActionsService.GetCacheUsageForRepo + operations: + - GET /repos/{owner}/{repo}/actions/cache/usage + - name: ActionsService.GetEnvPublicKey + operations: + - GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key + - name: ActionsService.GetEnvSecret + operations: + - GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} + - name: ActionsService.GetEnvVariable + operations: + - GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} + - name: ActionsService.GetOrgOIDCSubjectClaimCustomTemplate + operations: + - GET /orgs/{org}/actions/oidc/customization/sub + - name: ActionsService.GetOrgPublicKey + operations: + - GET /orgs/{org}/actions/secrets/public-key + - name: ActionsService.GetOrgSecret + operations: + - GET /orgs/{org}/actions/secrets/{secret_name} + - name: ActionsService.GetOrgVariable + operations: + - GET /orgs/{org}/actions/variables/{name} + - name: ActionsService.GetOrganizationRunner + operations: + - GET /orgs/{org}/actions/runners/{runner_id} + - name: ActionsService.GetOrganizationRunnerGroup + operations: + - GET /orgs/{org}/actions/runner-groups/{runner_group_id} + - name: ActionsService.GetRepoOIDCSubjectClaimCustomTemplate + operations: + - GET /repos/{owner}/{repo}/actions/oidc/customization/sub + - name: ActionsService.GetRepoPublicKey + operations: + - GET /repos/{owner}/{repo}/actions/secrets/public-key + - name: ActionsService.GetRepoSecret + operations: + - GET /repos/{owner}/{repo}/actions/secrets/{secret_name} + - name: ActionsService.GetRepoVariable + operations: + - GET /repos/{owner}/{repo}/actions/variables/{name} + - name: ActionsService.GetRequiredWorkflowByID + operations: + - GET /orgs/{org}/actions/required_workflows/{workflow_id} + - name: ActionsService.GetRunner + operations: + - GET /repos/{owner}/{repo}/actions/runners/{runner_id} + - name: ActionsService.GetTotalCacheUsageForEnterprise + operations: + - GET /enterprises/{enterprise}/actions/cache/usage + - name: ActionsService.GetTotalCacheUsageForOrg + operations: + - GET /orgs/{org}/actions/cache/usage + - name: ActionsService.GetWorkflowByFileName + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} + - name: ActionsService.GetWorkflowByID + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} + - name: ActionsService.GetWorkflowJobByID + operations: + - GET /repos/{owner}/{repo}/actions/jobs/{job_id} + - name: ActionsService.GetWorkflowJobLogs + operations: + - GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs + - name: ActionsService.GetWorkflowRunAttempt + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} + - name: ActionsService.GetWorkflowRunAttemptLogs + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs + - name: ActionsService.GetWorkflowRunByID + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id} + - name: ActionsService.GetWorkflowRunLogs + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs + - name: ActionsService.GetWorkflowRunUsageByID + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing + - name: ActionsService.GetWorkflowUsageByFileName + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + - name: ActionsService.GetWorkflowUsageByID + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + - name: ActionsService.ListArtifacts + operations: + - GET /repos/{owner}/{repo}/actions/artifacts + - name: ActionsService.ListCacheUsageByRepoForOrg + operations: + - GET /orgs/{org}/actions/cache/usage-by-repository + - name: ActionsService.ListCaches + operations: + - GET /repos/{owner}/{repo}/actions/caches + - name: ActionsService.ListEnabledOrgsInEnterprise + operations: + - GET /enterprises/{enterprise}/actions/permissions/organizations + - name: ActionsService.ListEnabledReposInOrg + operations: + - GET /orgs/{org}/actions/permissions/repositories + - name: ActionsService.ListEnvSecrets + operations: + - GET /repositories/{repository_id}/environments/{environment_name}/secrets + - name: ActionsService.ListEnvVariables + operations: + - GET /repositories/{repository_id}/environments/{environment_name}/variables + - name: ActionsService.ListOrgRequiredWorkflows + operations: + - GET /orgs/{org}/actions/required_workflows + - name: ActionsService.ListOrgSecrets + operations: + - GET /orgs/{org}/actions/secrets + - name: ActionsService.ListOrgVariables + operations: + - GET /orgs/{org}/actions/variables + - name: ActionsService.ListOrganizationRunnerApplicationDownloads + operations: + - GET /orgs/{org}/actions/runners/downloads + - name: ActionsService.ListOrganizationRunnerGroups + operations: + - GET /orgs/{org}/actions/runner-groups + - name: ActionsService.ListOrganizationRunners + operations: + - GET /orgs/{org}/actions/runners + - name: ActionsService.ListRepoRequiredWorkflows + operations: + - GET /repos/{owner}/{repo}/actions/required_workflows + - name: ActionsService.ListRepoSecrets + operations: + - GET /repos/{owner}/{repo}/actions/secrets + - name: ActionsService.ListRepoVariables + operations: + - GET /repos/{owner}/{repo}/actions/variables + - name: ActionsService.ListRepositoryAccessRunnerGroup + operations: + - GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + - name: ActionsService.ListRepositoryWorkflowRuns + operations: + - GET /repos/{owner}/{repo}/actions/runs + - name: ActionsService.ListRequiredWorkflowSelectedRepos + operations: + - GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + - name: ActionsService.ListRunnerApplicationDownloads + operations: + - GET /repos/{owner}/{repo}/actions/runners/downloads + - name: ActionsService.ListRunnerGroupRunners + operations: + - GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners + - name: ActionsService.ListRunners + operations: + - GET /repos/{owner}/{repo}/actions/runners + - name: ActionsService.ListSelectedReposForOrgSecret + operations: + - GET /orgs/{org}/actions/secrets/{secret_name}/repositories + - name: ActionsService.ListSelectedReposForOrgVariable + operations: + - GET /orgs/{org}/actions/variables/{name}/repositories + - name: ActionsService.ListWorkflowJobs + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs + - name: ActionsService.ListWorkflowRunArtifacts + operations: + - GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + - name: ActionsService.ListWorkflowRunsByFileName + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + - name: ActionsService.ListWorkflowRunsByID + operations: + - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + - name: ActionsService.ListWorkflows + operations: + - GET /repos/{owner}/{repo}/actions/workflows + - name: ActionsService.PendingDeployments + operations: + - POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments + - name: ActionsService.RemoveEnabledOrgInEnterprise + operations: + - DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} + - name: ActionsService.RemoveEnabledReposInOrg + operations: + - DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} + - name: ActionsService.RemoveOrganizationRunner + operations: + - DELETE /orgs/{org}/actions/runners/{runner_id} + - name: ActionsService.RemoveRepoFromRequiredWorkflow + operations: + - DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + - name: ActionsService.RemoveRepositoryAccessRunnerGroup + operations: + - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + - name: ActionsService.RemoveRunner + operations: + - DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} + - name: ActionsService.RemoveRunnerGroupRunners + operations: + - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + - name: ActionsService.RemoveSelectedRepoFromOrgSecret + operations: + - DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + - name: ActionsService.RemoveSelectedRepoFromOrgVariable + operations: + - DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} + - name: ActionsService.RerunFailedJobsByID + operations: + - POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs + - name: ActionsService.RerunJobByID + operations: + - POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun + - name: ActionsService.RerunWorkflowByID + operations: + - POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun + - name: ActionsService.SetEnabledOrgsInEnterprise + operations: + - PUT /enterprises/{enterprise}/actions/permissions/organizations + - name: ActionsService.SetEnabledReposInOrg + operations: + - PUT /orgs/{org}/actions/permissions/repositories + - name: ActionsService.SetOrgOIDCSubjectClaimCustomTemplate + operations: + - PUT /orgs/{org}/actions/oidc/customization/sub + - name: ActionsService.SetRepoOIDCSubjectClaimCustomTemplate + operations: + - PUT /repos/{owner}/{repo}/actions/oidc/customization/sub + - name: ActionsService.SetRepositoryAccessRunnerGroup + operations: + - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + - name: ActionsService.SetRequiredWorkflowSelectedRepos + operations: + - PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + - name: ActionsService.SetRunnerGroupRunners + operations: + - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners + - name: ActionsService.SetSelectedReposForOrgSecret + operations: + - PUT /orgs/{org}/actions/secrets/{secret_name}/repositories + - name: ActionsService.SetSelectedReposForOrgVariable + operations: + - PUT /orgs/{org}/actions/variables/{name}/repositories + - name: ActionsService.UpdateEnvVariable + operations: + - PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} + - name: ActionsService.UpdateOrgVariable + operations: + - PATCH /orgs/{org}/actions/variables/{name} + - name: ActionsService.UpdateOrganizationRunnerGroup + operations: + - PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} + - name: ActionsService.UpdateRepoVariable + operations: + - PATCH /repos/{owner}/{repo}/actions/variables/{name} + - name: ActionsService.UpdateRequiredWorkflow + operations: + - PATCH /orgs/{org}/actions/required_workflows/{workflow_id} + - name: ActivityService.DeleteRepositorySubscription + operations: + - DELETE /repos/{owner}/{repo}/subscription + - name: ActivityService.DeleteThreadSubscription + operations: + - DELETE /notifications/threads/{thread_id}/subscription + - name: ActivityService.GetRepositorySubscription + operations: + - GET /repos/{owner}/{repo}/subscription + - name: ActivityService.GetThread + operations: + - GET /notifications/threads/{thread_id} + - name: ActivityService.GetThreadSubscription + operations: + - GET /notifications/threads/{thread_id}/subscription + - name: ActivityService.IsStarred + operations: + - GET /user/starred/{owner}/{repo} + - name: ActivityService.ListEvents + operations: + - GET /events + - name: ActivityService.ListEventsForOrganization + operations: + - GET /orgs/{org}/events + - name: ActivityService.ListEventsForRepoNetwork + operations: + - GET /networks/{owner}/{repo}/events + - name: ActivityService.ListEventsPerformedByUser + operations: + - GET /users/{username}/events + - GET /users/{username}/events/public + - name: ActivityService.ListEventsReceivedByUser + operations: + - GET /users/{username}/received_events + - GET /users/{username}/received_events/public + - name: ActivityService.ListFeeds + operations: + - GET /feeds + - name: ActivityService.ListIssueEventsForRepository + operations: + - GET /repos/{owner}/{repo}/issues/events + - name: ActivityService.ListNotifications + operations: + - GET /notifications + - name: ActivityService.ListRepositoryEvents + operations: + - GET /repos/{owner}/{repo}/events + - name: ActivityService.ListRepositoryNotifications + operations: + - GET /repos/{owner}/{repo}/notifications + - name: ActivityService.ListStargazers + operations: + - GET /repos/{owner}/{repo}/stargazers + - name: ActivityService.ListStarred + operations: + - GET /user/starred + - GET /users/{username}/starred + - name: ActivityService.ListUserEventsForOrganization + operations: + - GET /users/{username}/events/orgs/{org} + - name: ActivityService.ListWatched + operations: + - GET /user/subscriptions + - GET /users/{username}/subscriptions + - name: ActivityService.ListWatchers + operations: + - GET /repos/{owner}/{repo}/subscribers + - name: ActivityService.MarkNotificationsRead + operations: + - PUT /notifications + - name: ActivityService.MarkRepositoryNotificationsRead + operations: + - PUT /repos/{owner}/{repo}/notifications + - name: ActivityService.MarkThreadRead + operations: + - PATCH /notifications/threads/{thread_id} + - name: ActivityService.SetRepositorySubscription + operations: + - PUT /repos/{owner}/{repo}/subscription + - name: ActivityService.SetThreadSubscription + operations: + - PUT /notifications/threads/{thread_id}/subscription + - name: ActivityService.Star + operations: + - PUT /user/starred/{owner}/{repo} + - name: ActivityService.Unstar + operations: + - DELETE /user/starred/{owner}/{repo} + - name: AdminService.CreateOrg + operations: + - POST /admin/organizations + - name: AdminService.CreateUser + operations: + - POST /admin/users + - name: AdminService.CreateUserImpersonation + operations: + - POST /admin/users/{username}/authorizations + - name: AdminService.DeleteUser + operations: + - DELETE /admin/users/{username} + - name: AdminService.DeleteUserImpersonation + operations: + - DELETE /admin/users/{username}/authorizations + - name: AdminService.GetAdminStats + operations: + - GET /enterprise/stats/all + - name: AdminService.RenameOrg + operations: + - PATCH /admin/organizations/{org} + - name: AdminService.RenameOrgByName + operations: + - PATCH /admin/organizations/{org} + - name: AdminService.UpdateTeamLDAPMapping + operations: + - PATCH /admin/ldap/teams/{team_id}/mapping + - name: AdminService.UpdateUserLDAPMapping + operations: + - PATCH /admin/ldap/users/{username}/mapping + - name: AppsService.AddRepository + operations: + - PUT /user/installations/{installation_id}/repositories/{repository_id} + - name: AppsService.CompleteAppManifest + operations: + - POST /app-manifests/{code}/conversions + - name: AppsService.CreateAttachment + operations: + - POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments + - name: AppsService.CreateInstallationToken + operations: + - POST /app/installations/{installation_id}/access_tokens + - name: AppsService.DeleteInstallation + operations: + - DELETE /app/installations/{installation_id} + - name: AppsService.FindOrganizationInstallation + operations: + - GET /orgs/{org}/installation + - name: AppsService.FindRepositoryInstallation + operations: + - GET /repos/{owner}/{repo}/installation + - name: AppsService.FindRepositoryInstallationByID + operations: + - GET /repositories/{repository_id}/installation + - name: AppsService.FindUserInstallation + operations: + - GET /users/{username}/installation + - name: AppsService.Get + operations: + - GET /app + - GET /apps/{app_slug} + - name: AppsService.GetHookConfig + operations: + - GET /app/hook/config + - name: AppsService.GetHookDelivery + operations: + - GET /app/hook/deliveries/{delivery_id} + - name: AppsService.GetInstallation + operations: + - GET /app/installations/{installation_id} + - name: AppsService.ListHookDeliveries + operations: + - GET /app/hook/deliveries + - name: AppsService.ListInstallationRequests + operations: + - GET /app/installation-requests + - name: AppsService.ListInstallations + operations: + - GET /app/installations + - name: AppsService.ListRepos + operations: + - GET /installation/repositories + - name: AppsService.ListUserInstallations + operations: + - GET /user/installations + - name: AppsService.ListUserRepos + operations: + - GET /user/installations/{installation_id}/repositories + - name: AppsService.RedeliverHookDelivery + operations: + - POST /app/hook/deliveries/{delivery_id}/attempts + - name: AppsService.RemoveRepository + operations: + - DELETE /user/installations/{installation_id}/repositories/{repository_id} + - name: AppsService.RevokeInstallationToken + operations: + - DELETE /installation/token + - name: AppsService.SuspendInstallation + operations: + - PUT /app/installations/{installation_id}/suspended + - name: AppsService.UnsuspendInstallation + operations: + - DELETE /app/installations/{installation_id}/suspended + - name: AppsService.UpdateHookConfig + operations: + - PATCH /app/hook/config + - name: AuthorizationsService.Check + operations: + - POST /applications/{client_id}/token + - name: AuthorizationsService.CreateImpersonation + operations: + - POST /admin/users/{username}/authorizations + - name: AuthorizationsService.DeleteGrant + operations: + - DELETE /applications/{client_id}/grant + - name: AuthorizationsService.DeleteImpersonation + operations: + - DELETE /admin/users/{username}/authorizations + - name: AuthorizationsService.Reset + operations: + - PATCH /applications/{client_id}/token + - name: AuthorizationsService.Revoke + operations: + - DELETE /applications/{client_id}/token + - name: BillingService.GetActionsBillingOrg + operations: + - GET /orgs/{org}/settings/billing/actions + - name: BillingService.GetActionsBillingUser + operations: + - GET /users/{username}/settings/billing/actions + - name: BillingService.GetAdvancedSecurityActiveCommittersOrg + operations: + - GET /orgs/{org}/settings/billing/advanced-security + - name: BillingService.GetPackagesBillingOrg + operations: + - GET /orgs/{org}/settings/billing/packages + - name: BillingService.GetPackagesBillingUser + operations: + - GET /users/{username}/settings/billing/packages + - name: BillingService.GetStorageBillingOrg + operations: + - GET /orgs/{org}/settings/billing/shared-storage + - name: BillingService.GetStorageBillingUser + operations: + - GET /users/{username}/settings/billing/shared-storage + - name: ChecksService.CreateCheckRun + operations: + - POST /repos/{owner}/{repo}/check-runs + - name: ChecksService.CreateCheckSuite + operations: + - POST /repos/{owner}/{repo}/check-suites + - name: ChecksService.GetCheckRun + operations: + - GET /repos/{owner}/{repo}/check-runs/{check_run_id} + - name: ChecksService.GetCheckSuite + operations: + - GET /repos/{owner}/{repo}/check-suites/{check_suite_id} + - name: ChecksService.ListCheckRunAnnotations + operations: + - GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + - name: ChecksService.ListCheckRunsCheckSuite + operations: + - GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + - name: ChecksService.ListCheckRunsForRef + operations: + - GET /repos/{owner}/{repo}/commits/{ref}/check-runs + - name: ChecksService.ListCheckSuitesForRef + operations: + - GET /repos/{owner}/{repo}/commits/{ref}/check-suites + - name: ChecksService.ReRequestCheckRun + operations: + - POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest + - name: ChecksService.ReRequestCheckSuite + operations: + - POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + - name: ChecksService.SetCheckSuitePreferences + operations: + - PATCH /repos/{owner}/{repo}/check-suites/preferences + - name: ChecksService.UpdateCheckRun + operations: + - PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} + - name: CodeScanningService.DeleteAnalysis + operations: + - DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} + - name: CodeScanningService.GetAlert + operations: + - GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + - name: CodeScanningService.GetAnalysis + operations: + - GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} + - name: CodeScanningService.GetCodeQLDatabase + operations: + - GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} + - name: CodeScanningService.GetDefaultSetupConfiguration + operations: + - GET /repos/{owner}/{repo}/code-scanning/default-setup + - name: CodeScanningService.GetSARIF + operations: + - GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} + - name: CodeScanningService.ListAlertInstances + operations: + - GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances + - name: CodeScanningService.ListAlertsForOrg + operations: + - GET /orgs/{org}/code-scanning/alerts + - name: CodeScanningService.ListAlertsForRepo + operations: + - GET /repos/{owner}/{repo}/code-scanning/alerts + - name: CodeScanningService.ListAnalysesForRepo + operations: + - GET /repos/{owner}/{repo}/code-scanning/analyses + - name: CodeScanningService.ListCodeQLDatabases + operations: + - GET /repos/{owner}/{repo}/code-scanning/codeql/databases + - name: CodeScanningService.UpdateAlert + operations: + - PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + - name: CodeScanningService.UpdateDefaultSetupConfiguration + operations: + - PATCH /repos/{owner}/{repo}/code-scanning/default-setup + - name: CodeScanningService.UploadSarif + operations: + - POST /repos/{owner}/{repo}/code-scanning/sarifs + - name: CodesOfConductService.Get + operations: + - GET /codes_of_conduct/{key} + - name: CodesOfConductService.List + operations: + - GET /codes_of_conduct + - name: CodespacesService.AddSelectedRepoToOrgSecret + operations: + - PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + - name: CodespacesService.AddSelectedRepoToUserSecret + operations: + - PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + - name: CodespacesService.CreateInRepo + operations: + - POST /repos/{owner}/{repo}/codespaces + - name: CodespacesService.CreateOrUpdateOrgSecret + operations: + - PUT /orgs/{org}/codespaces/secrets/{secret_name} + - name: CodespacesService.CreateOrUpdateRepoSecret + operations: + - PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + - name: CodespacesService.CreateOrUpdateUserSecret + operations: + - PUT /user/codespaces/secrets/{secret_name} + - name: CodespacesService.Delete + operations: + - DELETE /user/codespaces/{codespace_name} + - name: CodespacesService.DeleteOrgSecret + operations: + - DELETE /orgs/{org}/codespaces/secrets/{secret_name} + - name: CodespacesService.DeleteRepoSecret + operations: + - DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + - name: CodespacesService.DeleteUserSecret + operations: + - DELETE /user/codespaces/secrets/{secret_name} + - name: CodespacesService.GetOrgPublicKey + operations: + - GET /orgs/{org}/codespaces/secrets/public-key + - name: CodespacesService.GetOrgSecret + operations: + - GET /orgs/{org}/codespaces/secrets/{secret_name} + - name: CodespacesService.GetRepoPublicKey + operations: + - GET /repos/{owner}/{repo}/codespaces/secrets/public-key + - name: CodespacesService.GetRepoSecret + operations: + - GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + - name: CodespacesService.GetUserPublicKey + operations: + - GET /user/codespaces/secrets/public-key + - name: CodespacesService.GetUserSecret + operations: + - GET /user/codespaces/secrets/{secret_name} + - name: CodespacesService.List + operations: + - GET /user/codespaces + - name: CodespacesService.ListInRepo + operations: + - GET /repos/{owner}/{repo}/codespaces + - name: CodespacesService.ListOrgSecrets + operations: + - GET /orgs/{org}/codespaces/secrets + - name: CodespacesService.ListRepoSecrets + operations: + - GET /repos/{owner}/{repo}/codespaces/secrets + - name: CodespacesService.ListSelectedReposForOrgSecret + operations: + - GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories + - name: CodespacesService.ListSelectedReposForUserSecret + operations: + - GET /user/codespaces/secrets/{secret_name}/repositories + - name: CodespacesService.ListUserSecrets + operations: + - GET /user/codespaces/secrets + - name: CodespacesService.RemoveSelectedRepoFromOrgSecret + operations: + - DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + - name: CodespacesService.RemoveSelectedRepoFromUserSecret + operations: + - DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + - name: CodespacesService.SetSelectedReposForOrgSecret + operations: + - PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories + - name: CodespacesService.SetSelectedReposForUserSecret + operations: + - PUT /user/codespaces/secrets/{secret_name}/repositories + - name: CodespacesService.Start + operations: + - POST /user/codespaces/{codespace_name}/start + - name: CodespacesService.Stop + operations: + - POST /user/codespaces/{codespace_name}/stop + - name: DependabotService.AddSelectedRepoToOrgSecret + operations: + - PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} + - name: DependabotService.CreateOrUpdateOrgSecret + operations: + - PUT /orgs/{org}/dependabot/secrets/{secret_name} + - name: DependabotService.CreateOrUpdateRepoSecret + operations: + - PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + - name: DependabotService.DeleteOrgSecret + operations: + - DELETE /orgs/{org}/dependabot/secrets/{secret_name} + - name: DependabotService.DeleteRepoSecret + operations: + - DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + - name: DependabotService.GetOrgPublicKey + operations: + - GET /orgs/{org}/dependabot/secrets/public-key + - name: DependabotService.GetOrgSecret + operations: + - GET /orgs/{org}/dependabot/secrets/{secret_name} + - name: DependabotService.GetRepoAlert + operations: + - GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} + - name: DependabotService.GetRepoPublicKey + operations: + - GET /repos/{owner}/{repo}/dependabot/secrets/public-key + - name: DependabotService.GetRepoSecret + operations: + - GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} + - name: DependabotService.ListOrgAlerts + operations: + - GET /orgs/{org}/dependabot/alerts + - name: DependabotService.ListOrgSecrets + operations: + - GET /orgs/{org}/dependabot/secrets + - name: DependabotService.ListRepoAlerts + operations: + - GET /repos/{owner}/{repo}/dependabot/alerts + - name: DependabotService.ListRepoSecrets + operations: + - GET /repos/{owner}/{repo}/dependabot/secrets + - name: DependabotService.ListSelectedReposForOrgSecret + operations: + - GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories + - name: DependabotService.RemoveSelectedRepoFromOrgSecret + operations: + - DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} + - name: DependabotService.SetSelectedReposForOrgSecret + operations: + - PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories + - name: DependencyGraphService.GetSBOM + operations: + - GET /repos/{owner}/{repo}/dependency-graph/sbom + - name: EmojisService.List + operations: + - GET /emojis + - name: EnterpriseService.AddOrganizationAccessRunnerGroup + operations: + - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + - name: EnterpriseService.AddRunnerGroupRunners + operations: + - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + - name: EnterpriseService.CreateEnterpriseRunnerGroup + operations: + - POST /enterprises/{enterprise}/actions/runner-groups + - name: EnterpriseService.CreateRegistrationToken + operations: + - POST /enterprises/{enterprise}/actions/runners/registration-token + - name: EnterpriseService.DeleteEnterpriseRunnerGroup + operations: + - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + - name: EnterpriseService.EnableDisableSecurityFeature + operations: + - POST /enterprises/{enterprise}/{security_product}/{enablement} + - name: EnterpriseService.GenerateEnterpriseJITConfig + operations: + - POST /enterprises/{enterprise}/actions/runners/generate-jitconfig + - name: EnterpriseService.GetAuditLog + operations: + - GET /enterprises/{enterprise}/audit-log + - name: EnterpriseService.GetCodeSecurityAndAnalysis + operations: + - GET /enterprises/{enterprise}/code_security_and_analysis + - name: EnterpriseService.GetEnterpriseRunnerGroup + operations: + - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + - name: EnterpriseService.ListOrganizationAccessRunnerGroup + operations: + - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + - name: EnterpriseService.ListRunnerApplicationDownloads + operations: + - GET /enterprises/{enterprise}/actions/runners/downloads + - name: EnterpriseService.ListRunnerGroupRunners + operations: + - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + - name: EnterpriseService.ListRunnerGroups + operations: + - GET /enterprises/{enterprise}/actions/runner-groups + - name: EnterpriseService.ListRunners + operations: + - GET /enterprises/{enterprise}/actions/runners + - name: EnterpriseService.RemoveOrganizationAccessRunnerGroup + operations: + - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + - name: EnterpriseService.RemoveRunner + operations: + - DELETE /enterprises/{enterprise}/actions/runners/{runner_id} + - name: EnterpriseService.RemoveRunnerGroupRunners + operations: + - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + - name: EnterpriseService.SetOrganizationAccessRunnerGroup + operations: + - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + - name: EnterpriseService.SetRunnerGroupRunners + operations: + - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + - name: EnterpriseService.UpdateCodeSecurityAndAnalysis + operations: + - PATCH /enterprises/{enterprise}/code_security_and_analysis + - name: EnterpriseService.UpdateEnterpriseRunnerGroup + operations: + - PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + - name: GistsService.Create + operations: + - POST /gists + - name: GistsService.CreateComment + operations: + - POST /gists/{gist_id}/comments + - name: GistsService.Delete + operations: + - DELETE /gists/{gist_id} + - name: GistsService.DeleteComment + operations: + - DELETE /gists/{gist_id}/comments/{comment_id} + - name: GistsService.Edit + operations: + - PATCH /gists/{gist_id} + - name: GistsService.EditComment + operations: + - PATCH /gists/{gist_id}/comments/{comment_id} + - name: GistsService.Fork + operations: + - POST /gists/{gist_id}/forks + - name: GistsService.Get + operations: + - GET /gists/{gist_id} + - name: GistsService.GetComment + operations: + - GET /gists/{gist_id}/comments/{comment_id} + - name: GistsService.GetRevision + operations: + - GET /gists/{gist_id}/{sha} + - name: GistsService.IsStarred + operations: + - GET /gists/{gist_id}/star + - name: GistsService.List + operations: + - GET /gists + - GET /users/{username}/gists + - name: GistsService.ListAll + operations: + - GET /gists/public + - name: GistsService.ListComments + operations: + - GET /gists/{gist_id}/comments + - name: GistsService.ListCommits + operations: + - GET /gists/{gist_id}/commits + - name: GistsService.ListForks + operations: + - GET /gists/{gist_id}/forks + - name: GistsService.ListStarred + operations: + - GET /gists/starred + - name: GistsService.Star + operations: + - PUT /gists/{gist_id}/star + - name: GistsService.Unstar + operations: + - DELETE /gists/{gist_id}/star + - name: GitService.CreateBlob + operations: + - POST /repos/{owner}/{repo}/git/blobs + - name: GitService.CreateCommit + operations: + - POST /repos/{owner}/{repo}/git/commits + - name: GitService.CreateRef + operations: + - POST /repos/{owner}/{repo}/git/refs + - name: GitService.CreateTag + operations: + - POST /repos/{owner}/{repo}/git/tags + - name: GitService.CreateTree + operations: + - POST /repos/{owner}/{repo}/git/trees + - name: GitService.DeleteRef + operations: + - DELETE /repos/{owner}/{repo}/git/refs/{ref} + - name: GitService.GetBlob + operations: + - GET /repos/{owner}/{repo}/git/blobs/{file_sha} + - name: GitService.GetBlobRaw + operations: + - GET /repos/{owner}/{repo}/git/blobs/{file_sha} + - name: GitService.GetCommit + operations: + - GET /repos/{owner}/{repo}/git/commits/{commit_sha} + - name: GitService.GetRef + operations: + - GET /repos/{owner}/{repo}/git/ref/{ref} + - name: GitService.GetTag + operations: + - GET /repos/{owner}/{repo}/git/tags/{tag_sha} + - name: GitService.GetTree + operations: + - GET /repos/{owner}/{repo}/git/trees/{tree_sha} + - name: GitService.ListMatchingRefs + operations: + - GET /repos/{owner}/{repo}/git/matching-refs/{ref} + - name: GitService.UpdateRef + operations: + - PATCH /repos/{owner}/{repo}/git/refs/{ref} + - name: GitignoresService.Get + operations: + - GET /gitignore/templates/{name} + - name: GitignoresService.List + operations: + - GET /gitignore/templates + - name: InteractionsService.GetRestrictionsForOrg + operations: + - GET /orgs/{org}/interaction-limits + - name: InteractionsService.GetRestrictionsForRepo + operations: + - GET /repos/{owner}/{repo}/interaction-limits + - name: InteractionsService.RemoveRestrictionsFromOrg + operations: + - DELETE /orgs/{org}/interaction-limits + - name: InteractionsService.RemoveRestrictionsFromRepo + operations: + - DELETE /repos/{owner}/{repo}/interaction-limits + - name: InteractionsService.UpdateRestrictionsForOrg + operations: + - PUT /orgs/{org}/interaction-limits + - name: InteractionsService.UpdateRestrictionsForRepo + operations: + - PUT /repos/{owner}/{repo}/interaction-limits + - name: IssueImportService.CheckStatus + operations: + - GET /repos/{owner}/{repo}/import/issues/{issue_number} + - name: IssueImportService.CheckStatusSince + operations: + - GET /repos/{owner}/{repo}/import/issues + - name: IssueImportService.Create + operations: + - POST /repos/{owner}/{repo}/import/issues + - name: IssuesService.AddAssignees + operations: + - POST /repos/{owner}/{repo}/issues/{issue_number}/assignees + - name: IssuesService.AddLabelsToIssue + operations: + - POST /repos/{owner}/{repo}/issues/{issue_number}/labels + - name: IssuesService.Create + operations: + - POST /repos/{owner}/{repo}/issues + - name: IssuesService.CreateComment + operations: + - POST /repos/{owner}/{repo}/issues/{issue_number}/comments + - name: IssuesService.CreateLabel + operations: + - POST /repos/{owner}/{repo}/labels + - name: IssuesService.CreateMilestone + operations: + - POST /repos/{owner}/{repo}/milestones + - name: IssuesService.DeleteComment + operations: + - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} + - name: IssuesService.DeleteLabel + operations: + - DELETE /repos/{owner}/{repo}/labels/{name} + - name: IssuesService.DeleteMilestone + operations: + - DELETE /repos/{owner}/{repo}/milestones/{milestone_number} + - name: IssuesService.Edit + operations: + - PATCH /repos/{owner}/{repo}/issues/{issue_number} + - name: IssuesService.EditComment + operations: + - PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} + - name: IssuesService.EditLabel + operations: + - PATCH /repos/{owner}/{repo}/labels/{name} + - name: IssuesService.EditMilestone + operations: + - PATCH /repos/{owner}/{repo}/milestones/{milestone_number} + - name: IssuesService.Get + operations: + - GET /repos/{owner}/{repo}/issues/{issue_number} + - name: IssuesService.GetComment + operations: + - GET /repos/{owner}/{repo}/issues/comments/{comment_id} + - name: IssuesService.GetEvent + operations: + - GET /repos/{owner}/{repo}/issues/events/{event_id} + - name: IssuesService.GetLabel + operations: + - GET /repos/{owner}/{repo}/labels/{name} + - name: IssuesService.GetMilestone + operations: + - GET /repos/{owner}/{repo}/milestones/{milestone_number} + - name: IssuesService.IsAssignee + operations: + - GET /repos/{owner}/{repo}/assignees/{assignee} + - name: IssuesService.List + operations: + - GET /issues + - GET /user/issues + - name: IssuesService.ListAssignees + operations: + - GET /repos/{owner}/{repo}/assignees + - name: IssuesService.ListByOrg + operations: + - GET /orgs/{org}/issues + - name: IssuesService.ListByRepo + operations: + - GET /repos/{owner}/{repo}/issues + - name: IssuesService.ListComments + operations: + - GET /repos/{owner}/{repo}/issues/comments + - GET /repos/{owner}/{repo}/issues/{issue_number}/comments + - name: IssuesService.ListIssueEvents + operations: + - GET /repos/{owner}/{repo}/issues/{issue_number}/events + - name: IssuesService.ListIssueTimeline + operations: + - GET /repos/{owner}/{repo}/issues/{issue_number}/timeline + - name: IssuesService.ListLabels + operations: + - GET /repos/{owner}/{repo}/labels + - name: IssuesService.ListLabelsByIssue + operations: + - GET /repos/{owner}/{repo}/issues/{issue_number}/labels + - name: IssuesService.ListLabelsForMilestone + operations: + - GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels + - name: IssuesService.ListMilestones + operations: + - GET /repos/{owner}/{repo}/milestones + - name: IssuesService.ListRepositoryEvents + operations: + - GET /repos/{owner}/{repo}/issues/events + - name: IssuesService.Lock + operations: + - PUT /repos/{owner}/{repo}/issues/{issue_number}/lock + - name: IssuesService.RemoveAssignees + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees + - name: IssuesService.RemoveLabelForIssue + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + - name: IssuesService.RemoveLabelsForIssue + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels + - name: IssuesService.RemoveMilestone + operations: + - PATCH /repos/{owner}/{repo}/issues/{issue_number} + - name: IssuesService.ReplaceLabelsForIssue + operations: + - PUT /repos/{owner}/{repo}/issues/{issue_number}/labels + - name: IssuesService.Unlock + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock + - name: LicensesService.Get + operations: + - GET /licenses/{license} + - name: LicensesService.List + operations: + - GET /licenses + - name: MarkdownService.Render + operations: + - POST /markdown + - name: MarketplaceService.GetPlanAccountForAccount + operations: + - GET /marketplace_listing/accounts/{account_id} + - GET /marketplace_listing/stubbed/accounts/{account_id} + - name: MarketplaceService.ListMarketplacePurchasesForUser + operations: + - GET /user/marketplace_purchases + - GET /user/marketplace_purchases/stubbed + - name: MarketplaceService.ListPlanAccountsForPlan + operations: + - GET /marketplace_listing/plans/{plan_id}/accounts + - GET /marketplace_listing/stubbed/plans/{plan_id}/accounts + - name: MarketplaceService.ListPlans + operations: + - GET /marketplace_listing/plans + - GET /marketplace_listing/stubbed/plans + - name: MetaService.Get + operations: + - GET /meta + - name: MetaService.Octocat + operations: + - GET /octocat + - name: MetaService.Zen + operations: + - GET /zen + - name: MigrationService.CancelImport + operations: + - DELETE /repos/{owner}/{repo}/import + - name: MigrationService.CommitAuthors + operations: + - GET /repos/{owner}/{repo}/import/authors + - name: MigrationService.DeleteMigration + operations: + - DELETE /orgs/{org}/migrations/{migration_id}/archive + - name: MigrationService.DeleteUserMigration + operations: + - DELETE /user/migrations/{migration_id}/archive + - name: MigrationService.ImportProgress + operations: + - GET /repos/{owner}/{repo}/import + - name: MigrationService.LargeFiles + operations: + - GET /repos/{owner}/{repo}/import/large_files + - name: MigrationService.ListMigrations + operations: + - GET /orgs/{org}/migrations + - name: MigrationService.ListUserMigrations + operations: + - GET /user/migrations + - name: MigrationService.MapCommitAuthor + operations: + - PATCH /repos/{owner}/{repo}/import/authors/{author_id} + - name: MigrationService.MigrationArchiveURL + operations: + - GET /orgs/{org}/migrations/{migration_id}/archive + - name: MigrationService.MigrationStatus + operations: + - GET /orgs/{org}/migrations/{migration_id} + - name: MigrationService.SetLFSPreference + operations: + - PATCH /repos/{owner}/{repo}/import/lfs + - name: MigrationService.StartImport + operations: + - PUT /repos/{owner}/{repo}/import + - name: MigrationService.StartMigration + operations: + - POST /orgs/{org}/migrations + - name: MigrationService.StartUserMigration + operations: + - POST /user/migrations + - name: MigrationService.UnlockRepo + operations: + - DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock + - name: MigrationService.UnlockUserRepo + operations: + - DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock + - name: MigrationService.UpdateImport + operations: + - PATCH /repos/{owner}/{repo}/import + - name: MigrationService.UserMigrationArchiveURL + operations: + - GET /user/migrations/{migration_id}/archive + - name: MigrationService.UserMigrationStatus + operations: + - GET /user/migrations/{migration_id} + - name: OrganizationsService.AddSecurityManagerTeam + operations: + - PUT /orgs/{org}/security-managers/teams/{team_slug} + - name: OrganizationsService.BlockUser + operations: + - PUT /orgs/{org}/blocks/{username} + - name: OrganizationsService.ConcealMembership + operations: + - DELETE /orgs/{org}/public_members/{username} + - name: OrganizationsService.ConvertMemberToOutsideCollaborator + operations: + - PUT /orgs/{org}/outside_collaborators/{username} + - name: OrganizationsService.CreateCustomRepoRole + operations: + - POST /orgs/{org}/custom-repository-roles + - name: OrganizationsService.CreateHook + operations: + - POST /orgs/{org}/hooks + - name: OrganizationsService.CreateOrgInvitation + operations: + - POST /orgs/{org}/invitations + - name: OrganizationsService.CreateOrganizationRuleset + operations: + - POST /orgs/{org}/rulesets + - name: OrganizationsService.CreateProject + operations: + - POST /orgs/{org}/projects + - name: OrganizationsService.Delete + operations: + - DELETE /orgs/{org} + - name: OrganizationsService.DeleteCustomRepoRole + operations: + - DELETE /orgs/{org}/custom-repository-roles/{role_id} + - name: OrganizationsService.DeleteHook + operations: + - DELETE /orgs/{org}/hooks/{hook_id} + - name: OrganizationsService.DeleteOrganizationRuleset + operations: + - DELETE /orgs/{org}/rulesets/{ruleset_id} + - name: OrganizationsService.DeletePackage + operations: + - DELETE /orgs/{org}/packages/{package_type}/{package_name} + - name: OrganizationsService.Edit + operations: + - PATCH /orgs/{org} + - name: OrganizationsService.EditActionsAllowed + operations: + - PUT /orgs/{org}/actions/permissions/selected-actions + - name: OrganizationsService.EditActionsPermissions + operations: + - PUT /orgs/{org}/actions/permissions + - name: OrganizationsService.EditHook + operations: + - PATCH /orgs/{org}/hooks/{hook_id} + - name: OrganizationsService.EditHookConfiguration + operations: + - PATCH /orgs/{org}/hooks/{hook_id}/config + - name: OrganizationsService.EditOrgMembership + operations: + - PATCH /user/memberships/orgs/{org} + - PUT /orgs/{org}/memberships/{username} + - name: OrganizationsService.Get + operations: + - GET /orgs/{org} + - name: OrganizationsService.GetActionsAllowed + operations: + - GET /orgs/{org}/actions/permissions/selected-actions + - name: OrganizationsService.GetActionsPermissions + operations: + - GET /orgs/{org}/actions/permissions + - name: OrganizationsService.GetAllOrganizationRulesets + operations: + - GET /orgs/{org}/rulesets + - name: OrganizationsService.GetAuditLog + operations: + - GET /orgs/{org}/audit-log + - name: OrganizationsService.GetByID + operations: + - GET /organizations/{organization_id} + - name: OrganizationsService.GetHook + operations: + - GET /orgs/{org}/hooks/{hook_id} + - name: OrganizationsService.GetHookConfiguration + operations: + - GET /orgs/{org}/hooks/{hook_id}/config + - name: OrganizationsService.GetHookDelivery + operations: + - GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} + - name: OrganizationsService.GetOrgMembership + operations: + - GET /orgs/{org}/memberships/{username} + - GET /user/memberships/orgs/{org} + - name: OrganizationsService.GetOrganizationRuleset + operations: + - GET /orgs/{org}/rulesets/{ruleset_id} + - name: OrganizationsService.GetPackage + operations: + - GET /orgs/{org}/packages/{package_type}/{package_name} + - name: OrganizationsService.IsBlocked + operations: + - GET /orgs/{org}/blocks/{username} + - name: OrganizationsService.IsMember + operations: + - GET /orgs/{org}/members/{username} + - name: OrganizationsService.IsPublicMember + operations: + - GET /orgs/{org}/public_members/{username} + - name: OrganizationsService.List + operations: + - GET /user/orgs + - GET /users/{username}/orgs + - name: OrganizationsService.ListAll + operations: + - GET /organizations + - name: OrganizationsService.ListBlockedUsers + operations: + - GET /orgs/{org}/blocks + - name: OrganizationsService.ListCredentialAuthorizations + operations: + - GET /orgs/{org}/credential-authorizations + - name: OrganizationsService.ListCustomRepoRoles + operations: + - GET /orgs/{org}/custom-repository-roles + - name: OrganizationsService.ListFailedOrgInvitations + operations: + - GET /orgs/{org}/failed_invitations + - name: OrganizationsService.ListHookDeliveries + operations: + - GET /orgs/{org}/hooks/{hook_id}/deliveries + - name: OrganizationsService.ListHooks + operations: + - GET /orgs/{org}/hooks + - name: OrganizationsService.ListInstallations + operations: + - GET /orgs/{org}/installations + - name: OrganizationsService.ListMembers + operations: + - GET /orgs/{org}/members + - GET /orgs/{org}/public_members + - name: OrganizationsService.ListOrgInvitationTeams + operations: + - GET /orgs/{org}/invitations/{invitation_id}/teams + - name: OrganizationsService.ListOrgMemberships + operations: + - GET /user/memberships/orgs + - name: OrganizationsService.ListOutsideCollaborators + operations: + - GET /orgs/{org}/outside_collaborators + - name: OrganizationsService.ListPackages + operations: + - GET /orgs/{org}/packages + - name: OrganizationsService.ListPendingOrgInvitations + operations: + - GET /orgs/{org}/invitations + - name: OrganizationsService.ListProjects + operations: + - GET /orgs/{org}/projects + - name: OrganizationsService.ListSecurityManagerTeams + operations: + - GET /orgs/{org}/security-managers + - name: OrganizationsService.PackageDeleteVersion + operations: + - DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} + - name: OrganizationsService.PackageGetAllVersions + operations: + - GET /orgs/{org}/packages/{package_type}/{package_name}/versions + - name: OrganizationsService.PackageGetVersion + operations: + - GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} + - name: OrganizationsService.PackageRestoreVersion + operations: + - POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + - name: OrganizationsService.PingHook + operations: + - POST /orgs/{org}/hooks/{hook_id}/pings + - name: OrganizationsService.PublicizeMembership + operations: + - PUT /orgs/{org}/public_members/{username} + - name: OrganizationsService.RedeliverHookDelivery + operations: + - POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts + - name: OrganizationsService.RemoveCredentialAuthorization + operations: + - DELETE /orgs/{org}/credential-authorizations/{credential_id} + - name: OrganizationsService.RemoveMember + operations: + - DELETE /orgs/{org}/members/{username} + - name: OrganizationsService.RemoveOrgMembership + operations: + - DELETE /orgs/{org}/memberships/{username} + - name: OrganizationsService.RemoveOutsideCollaborator + operations: + - DELETE /orgs/{org}/outside_collaborators/{username} + - name: OrganizationsService.RemoveSecurityManagerTeam + operations: + - DELETE /orgs/{org}/security-managers/teams/{team_slug} + - name: OrganizationsService.RestorePackage + operations: + - POST /orgs/{org}/packages/{package_type}/{package_name}/restore + - name: OrganizationsService.ReviewPersonalAccessTokenRequest + operations: + - POST /orgs/{org}/personal-access-token-requests/{pat_request_id} + - name: OrganizationsService.UnblockUser + operations: + - DELETE /orgs/{org}/blocks/{username} + - name: OrganizationsService.UpdateCustomRepoRole + operations: + - PATCH /orgs/{org}/custom-repository-roles/{role_id} + - name: OrganizationsService.UpdateOrganizationRuleset + operations: + - PUT /orgs/{org}/rulesets/{ruleset_id} + - name: ProjectsService.AddProjectCollaborator + operations: + - PUT /projects/{project_id}/collaborators/{username} + - name: ProjectsService.CreateProjectCard + operations: + - POST /projects/columns/{column_id}/cards + - name: ProjectsService.CreateProjectColumn + operations: + - POST /projects/{project_id}/columns + - name: ProjectsService.DeleteProject + operations: + - DELETE /projects/{project_id} + - name: ProjectsService.DeleteProjectCard + operations: + - DELETE /projects/columns/cards/{card_id} + - name: ProjectsService.DeleteProjectColumn + operations: + - DELETE /projects/columns/{column_id} + - name: ProjectsService.GetProject + operations: + - GET /projects/{project_id} + - name: ProjectsService.GetProjectCard + operations: + - GET /projects/columns/cards/{card_id} + - name: ProjectsService.GetProjectColumn + operations: + - GET /projects/columns/{column_id} + - name: ProjectsService.ListProjectCards + operations: + - GET /projects/columns/{column_id}/cards + - name: ProjectsService.ListProjectCollaborators + operations: + - GET /projects/{project_id}/collaborators + - name: ProjectsService.ListProjectColumns + operations: + - GET /projects/{project_id}/columns + - name: ProjectsService.MoveProjectCard + operations: + - POST /projects/columns/cards/{card_id}/moves + - name: ProjectsService.MoveProjectColumn + operations: + - POST /projects/columns/{column_id}/moves + - name: ProjectsService.RemoveProjectCollaborator + operations: + - DELETE /projects/{project_id}/collaborators/{username} + - name: ProjectsService.ReviewProjectCollaboratorPermission + operations: + - GET /projects/{project_id}/collaborators/{username}/permission + - name: ProjectsService.UpdateProject + operations: + - PATCH /projects/{project_id} + - name: ProjectsService.UpdateProjectCard + operations: + - PATCH /projects/columns/cards/{card_id} + - name: ProjectsService.UpdateProjectColumn + operations: + - PATCH /projects/columns/{column_id} + - name: PullRequestsService.Create + operations: + - POST /repos/{owner}/{repo}/pulls + - name: PullRequestsService.CreateComment + operations: + - POST /repos/{owner}/{repo}/pulls/{pull_number}/comments + - name: PullRequestsService.CreateCommentInReplyTo + operations: + - POST /repos/{owner}/{repo}/pulls/{pull_number}/comments + - name: PullRequestsService.CreateReview + operations: + - POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews + - name: PullRequestsService.DeleteComment + operations: + - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} + - name: PullRequestsService.DeletePendingReview + operations: + - DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + - name: PullRequestsService.DismissReview + operations: + - PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals + - name: PullRequestsService.Edit + operations: + - PATCH /repos/{owner}/{repo}/pulls/{pull_number} + - name: PullRequestsService.EditComment + operations: + - PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} + - name: PullRequestsService.Get + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number} + - name: PullRequestsService.GetComment + operations: + - GET /repos/{owner}/{repo}/pulls/comments/{comment_id} + - name: PullRequestsService.GetRaw + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number} + - name: PullRequestsService.GetReview + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + - name: PullRequestsService.IsMerged + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/merge + - name: PullRequestsService.List + operations: + - GET /repos/{owner}/{repo}/pulls + - name: PullRequestsService.ListComments + operations: + - GET /repos/{owner}/{repo}/pulls/comments + - GET /repos/{owner}/{repo}/pulls/{pull_number}/comments + - name: PullRequestsService.ListCommits + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/commits + - name: PullRequestsService.ListFiles + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/files + - name: PullRequestsService.ListPullRequestsWithCommit + operations: + - GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls + - name: PullRequestsService.ListReviewComments + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + - name: PullRequestsService.ListReviewers + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + - name: PullRequestsService.ListReviews + operations: + - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews + - name: PullRequestsService.Merge + operations: + - PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge + - name: PullRequestsService.RemoveReviewers + operations: + - DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + - name: PullRequestsService.RequestReviewers + operations: + - POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + - name: PullRequestsService.SubmitReview + operations: + - POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + - name: PullRequestsService.UpdateBranch + operations: + - PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch + - name: PullRequestsService.UpdateReview + operations: + - PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + - name: ReactionsService.CreateCommentReaction + operations: + - POST /repos/{owner}/{repo}/comments/{comment_id}/reactions + - name: ReactionsService.CreateIssueCommentReaction + operations: + - POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + - name: ReactionsService.CreateIssueReaction + operations: + - POST /repos/{owner}/{repo}/issues/{issue_number}/reactions + - name: ReactionsService.CreatePullRequestCommentReaction + operations: + - POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + - name: ReactionsService.CreateReleaseReaction + operations: + - POST /repos/{owner}/{repo}/releases/{release_id}/reactions + - name: ReactionsService.CreateTeamDiscussionCommentReaction + operations: + - POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + - name: ReactionsService.CreateTeamDiscussionReaction + operations: + - POST /teams/{team_id}/discussions/{discussion_number}/reactions + - name: ReactionsService.DeleteCommentReaction + operations: + - DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeleteCommentReactionByID + operations: + - DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeleteIssueCommentReaction + operations: + - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeleteIssueCommentReactionByID + operations: + - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeleteIssueReaction + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + - name: ReactionsService.DeleteIssueReactionByID + operations: + - DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + - name: ReactionsService.DeletePullRequestCommentReaction + operations: + - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeletePullRequestCommentReactionByID + operations: + - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + - name: ReactionsService.DeleteTeamDiscussionCommentReaction + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + - name: ReactionsService.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + - name: ReactionsService.DeleteTeamDiscussionReaction + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + - name: ReactionsService.DeleteTeamDiscussionReactionByOrgIDAndTeamID + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + - name: ReactionsService.ListCommentReactions + operations: + - GET /repos/{owner}/{repo}/comments/{comment_id}/reactions + - name: ReactionsService.ListIssueCommentReactions + operations: + - GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + - name: ReactionsService.ListIssueReactions + operations: + - GET /repos/{owner}/{repo}/issues/{issue_number}/reactions + - name: ReactionsService.ListPullRequestCommentReactions + operations: + - GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + - name: ReactionsService.ListTeamDiscussionCommentReactions + operations: + - GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + - name: ReactionsService.ListTeamDiscussionReactions + operations: + - GET /teams/{team_id}/discussions/{discussion_number}/reactions + - name: RepositoriesService.AddAdminEnforcement + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + - name: RepositoriesService.AddAppRestrictions + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + - name: RepositoriesService.AddAutolink + operations: + - POST /repos/{owner}/{repo}/autolinks + - name: RepositoriesService.AddCollaborator + operations: + - PUT /repos/{owner}/{repo}/collaborators/{username} + - name: RepositoriesService.AddTeamRestrictions + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + - name: RepositoriesService.AddUserRestrictions + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + - name: RepositoriesService.CompareCommits + operations: + - GET /repos/{owner}/{repo}/compare/{basehead} + - name: RepositoriesService.CompareCommitsRaw + operations: + - GET /repos/{owner}/{repo}/compare/{basehead} + - name: RepositoriesService.Create + operations: + - POST /orgs/{org}/repos + - POST /user/repos + - name: RepositoriesService.CreateComment + operations: + - POST /repos/{owner}/{repo}/commits/{commit_sha}/comments + - name: RepositoriesService.CreateDeployment + operations: + - POST /repos/{owner}/{repo}/deployments + - name: RepositoriesService.CreateDeploymentBranchPolicy + operations: + - POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + - name: RepositoriesService.CreateDeploymentStatus + operations: + - POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + - name: RepositoriesService.CreateFile + operations: + - PUT /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.CreateFork + operations: + - POST /repos/{owner}/{repo}/forks + - name: RepositoriesService.CreateFromTemplate + operations: + - POST /repos/{template_owner}/{template_repo}/generate + - name: RepositoriesService.CreateHook + operations: + - POST /repos/{owner}/{repo}/hooks + - name: RepositoriesService.CreateKey + operations: + - POST /repos/{owner}/{repo}/keys + - name: RepositoriesService.CreateProject + operations: + - POST /repos/{owner}/{repo}/projects + - name: RepositoriesService.CreateRelease + operations: + - POST /repos/{owner}/{repo}/releases + - name: RepositoriesService.CreateRuleset + operations: + - POST /repos/{owner}/{repo}/rulesets + - name: RepositoriesService.CreateStatus + operations: + - POST /repos/{owner}/{repo}/statuses/{sha} + - name: RepositoriesService.CreateTagProtection + operations: + - POST /repos/{owner}/{repo}/tags/protection + - name: RepositoriesService.CreateUpdateEnvironment + operations: + - PUT /repos/{owner}/{repo}/environments/{environment_name} + - name: RepositoriesService.Delete + operations: + - DELETE /repos/{owner}/{repo} + - name: RepositoriesService.DeleteAutolink + operations: + - DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} + - name: RepositoriesService.DeleteComment + operations: + - DELETE /repos/{owner}/{repo}/comments/{comment_id} + - name: RepositoriesService.DeleteDeployment + operations: + - DELETE /repos/{owner}/{repo}/deployments/{deployment_id} + - name: RepositoriesService.DeleteDeploymentBranchPolicy + operations: + - DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + - name: RepositoriesService.DeleteEnvironment + operations: + - DELETE /repos/{owner}/{repo}/environments/{environment_name} + - name: RepositoriesService.DeleteFile + operations: + - DELETE /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.DeleteHook + operations: + - DELETE /repos/{owner}/{repo}/hooks/{hook_id} + - name: RepositoriesService.DeleteInvitation + operations: + - DELETE /repos/{owner}/{repo}/invitations/{invitation_id} + - name: RepositoriesService.DeleteKey + operations: + - DELETE /repos/{owner}/{repo}/keys/{key_id} + - name: RepositoriesService.DeletePreReceiveHook + operations: + - DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + - name: RepositoriesService.DeleteRelease + operations: + - DELETE /repos/{owner}/{repo}/releases/{release_id} + - name: RepositoriesService.DeleteReleaseAsset + operations: + - DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} + - name: RepositoriesService.DeleteRuleset + operations: + - DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} + - name: RepositoriesService.DeleteTagProtection + operations: + - DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} + - name: RepositoriesService.DisableAutomatedSecurityFixes + operations: + - DELETE /repos/{owner}/{repo}/automated-security-fixes + - name: RepositoriesService.DisableDismissalRestrictions + operations: + - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + - name: RepositoriesService.DisableLFS + operations: + - DELETE /repos/{owner}/{repo}/lfs + - name: RepositoriesService.DisablePages + operations: + - DELETE /repos/{owner}/{repo}/pages + - name: RepositoriesService.DisablePrivateReporting + operations: + - DELETE /repos/{owner}/{repo}/private-vulnerability-reporting + - name: RepositoriesService.DisableVulnerabilityAlerts + operations: + - DELETE /repos/{owner}/{repo}/vulnerability-alerts + - name: RepositoriesService.Dispatch + operations: + - POST /repos/{owner}/{repo}/dispatches + - name: RepositoriesService.DownloadContents + operations: + - GET /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.DownloadContentsWithMeta + operations: + - GET /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.DownloadReleaseAsset + operations: + - GET /repos/{owner}/{repo}/releases/assets/{asset_id} + - name: RepositoriesService.Edit + operations: + - PATCH /repos/{owner}/{repo} + - name: RepositoriesService.EditActionsAccessLevel + operations: + - PUT /repos/{owner}/{repo}/actions/permissions/access + - name: RepositoriesService.EditActionsAllowed + operations: + - PUT /repos/{owner}/{repo}/actions/permissions/selected-actions + - name: RepositoriesService.EditActionsPermissions + operations: + - PUT /repos/{owner}/{repo}/actions/permissions + - name: RepositoriesService.EditHook + operations: + - PATCH /repos/{owner}/{repo}/hooks/{hook_id} + - name: RepositoriesService.EditHookConfiguration + operations: + - PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config + - name: RepositoriesService.EditRelease + operations: + - PATCH /repos/{owner}/{repo}/releases/{release_id} + - name: RepositoriesService.EditReleaseAsset + operations: + - PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} + - name: RepositoriesService.EnableAutomatedSecurityFixes + operations: + - PUT /repos/{owner}/{repo}/automated-security-fixes + - name: RepositoriesService.EnableLFS + operations: + - PUT /repos/{owner}/{repo}/lfs + - name: RepositoriesService.EnablePages + operations: + - POST /repos/{owner}/{repo}/pages + - name: RepositoriesService.EnablePrivateReporting + operations: + - PUT /repos/{owner}/{repo}/private-vulnerability-reporting + - name: RepositoriesService.EnableVulnerabilityAlerts + operations: + - PUT /repos/{owner}/{repo}/vulnerability-alerts + - name: RepositoriesService.GenerateReleaseNotes + operations: + - POST /repos/{owner}/{repo}/releases/generate-notes + - name: RepositoriesService.Get + operations: + - GET /repos/{owner}/{repo} + - name: RepositoriesService.GetActionsAccessLevel + operations: + - GET /repos/{owner}/{repo}/actions/permissions/access + - name: RepositoriesService.GetActionsAllowed + operations: + - GET /repos/{owner}/{repo}/actions/permissions/selected-actions + - name: RepositoriesService.GetActionsPermissions + operations: + - GET /repos/{owner}/{repo}/actions/permissions + - name: RepositoriesService.GetAdminEnforcement + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + - name: RepositoriesService.GetAllRulesets + operations: + - GET /repos/{owner}/{repo}/rulesets + - name: RepositoriesService.GetArchiveLink + operations: + - GET /repos/{owner}/{repo}/tarball/{ref} + - GET /repos/{owner}/{repo}/zipball/{ref} + - name: RepositoriesService.GetAutolink + operations: + - GET /repos/{owner}/{repo}/autolinks/{autolink_id} + - name: RepositoriesService.GetAutomatedSecurityFixes + operations: + - GET /repos/{owner}/{repo}/automated-security-fixes + - name: RepositoriesService.GetBranch + operations: + - GET /repos/{owner}/{repo}/branches/{branch} + - name: RepositoriesService.GetBranchProtection + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection + - name: RepositoriesService.GetByID + operations: + - GET /repositories/{repository_id} + - name: RepositoriesService.GetCodeOfConduct + operations: + - GET /repos/{owner}/{repo} + - name: RepositoriesService.GetCodeownersErrors + operations: + - GET /repos/{owner}/{repo}/codeowners/errors + - name: RepositoriesService.GetCombinedStatus + operations: + - GET /repos/{owner}/{repo}/commits/{ref}/status + - name: RepositoriesService.GetComment + operations: + - GET /repos/{owner}/{repo}/comments/{comment_id} + - name: RepositoriesService.GetCommit + operations: + - GET /repos/{owner}/{repo}/commits/{ref} + - name: RepositoriesService.GetCommitRaw + operations: + - GET /repos/{owner}/{repo}/commits/{ref} + - name: RepositoriesService.GetCommitSHA1 + operations: + - GET /repos/{owner}/{repo}/commits/{ref} + - name: RepositoriesService.GetCommunityHealthMetrics + operations: + - GET /repos/{owner}/{repo}/community/profile + - name: RepositoriesService.GetContents + operations: + - GET /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.GetDeployment + operations: + - GET /repos/{owner}/{repo}/deployments/{deployment_id} + - name: RepositoriesService.GetDeploymentBranchPolicy + operations: + - GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + - name: RepositoriesService.GetDeploymentStatus + operations: + - GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + - name: RepositoriesService.GetEnvironment + operations: + - GET /repos/{owner}/{repo}/environments/{environment_name} + - name: RepositoriesService.GetHook + operations: + - GET /repos/{owner}/{repo}/hooks/{hook_id} + - name: RepositoriesService.GetHookConfiguration + operations: + - GET /repos/{owner}/{repo}/hooks/{hook_id}/config + - name: RepositoriesService.GetHookDelivery + operations: + - GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} + - name: RepositoriesService.GetKey + operations: + - GET /repos/{owner}/{repo}/keys/{key_id} + - name: RepositoriesService.GetLatestPagesBuild + operations: + - GET /repos/{owner}/{repo}/pages/builds/latest + - name: RepositoriesService.GetLatestRelease + operations: + - GET /repos/{owner}/{repo}/releases/latest + - name: RepositoriesService.GetPageBuild + operations: + - GET /repos/{owner}/{repo}/pages/builds/{build_id} + - name: RepositoriesService.GetPageHealthCheck + operations: + - GET /repos/{owner}/{repo}/pages/health + - name: RepositoriesService.GetPagesInfo + operations: + - GET /repos/{owner}/{repo}/pages + - name: RepositoriesService.GetPermissionLevel + operations: + - GET /repos/{owner}/{repo}/collaborators/{username}/permission + - name: RepositoriesService.GetPreReceiveHook + operations: + - GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + - name: RepositoriesService.GetPullRequestReviewEnforcement + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + - name: RepositoriesService.GetReadme + operations: + - GET /repos/{owner}/{repo}/readme + - name: RepositoriesService.GetRelease + operations: + - GET /repos/{owner}/{repo}/releases/{release_id} + - name: RepositoriesService.GetReleaseAsset + operations: + - GET /repos/{owner}/{repo}/releases/assets/{asset_id} + - name: RepositoriesService.GetReleaseByTag + operations: + - GET /repos/{owner}/{repo}/releases/tags/{tag} + - name: RepositoriesService.GetRequiredStatusChecks + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + - name: RepositoriesService.GetRulesForBranch + operations: + - GET /repos/{owner}/{repo}/rules/branches/{branch} + - name: RepositoriesService.GetRuleset + operations: + - GET /repos/{owner}/{repo}/rulesets/{ruleset_id} + - name: RepositoriesService.GetSignaturesProtectedBranch + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + - name: RepositoriesService.GetVulnerabilityAlerts + operations: + - GET /repos/{owner}/{repo}/vulnerability-alerts + - name: RepositoriesService.IsCollaborator + operations: + - GET /repos/{owner}/{repo}/collaborators/{username} + - name: RepositoriesService.License + operations: + - GET /repos/{owner}/{repo}/license + - name: RepositoriesService.List + operations: + - GET /user/repos + - GET /users/{username}/repos + - name: RepositoriesService.ListAll + operations: + - GET /repositories + - name: RepositoriesService.ListAllTopics + operations: + - GET /repos/{owner}/{repo}/topics + - name: RepositoriesService.ListAppRestrictions + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + - name: RepositoriesService.ListApps + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + - name: RepositoriesService.ListAutolinks + operations: + - GET /repos/{owner}/{repo}/autolinks + - name: RepositoriesService.ListBranches + operations: + - GET /repos/{owner}/{repo}/branches + - name: RepositoriesService.ListBranchesHeadCommit + operations: + - GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + - name: RepositoriesService.ListByOrg + operations: + - GET /orgs/{org}/repos + - name: RepositoriesService.ListCodeFrequency + operations: + - GET /repos/{owner}/{repo}/stats/code_frequency + - name: RepositoriesService.ListCollaborators + operations: + - GET /repos/{owner}/{repo}/collaborators + - name: RepositoriesService.ListComments + operations: + - GET /repos/{owner}/{repo}/comments + - name: RepositoriesService.ListCommitActivity + operations: + - GET /repos/{owner}/{repo}/stats/commit_activity + - name: RepositoriesService.ListCommitComments + operations: + - GET /repos/{owner}/{repo}/commits/{commit_sha}/comments + - name: RepositoriesService.ListCommits + operations: + - GET /repos/{owner}/{repo}/commits + - name: RepositoriesService.ListContributors + operations: + - GET /repos/{owner}/{repo}/contributors + - name: RepositoriesService.ListContributorsStats + operations: + - GET /repos/{owner}/{repo}/stats/contributors + - name: RepositoriesService.ListDeploymentBranchPolicies + operations: + - GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies + - name: RepositoriesService.ListDeploymentStatuses + operations: + - GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses + - name: RepositoriesService.ListDeployments + operations: + - GET /repos/{owner}/{repo}/deployments + - name: RepositoriesService.ListEnvironments + operations: + - GET /repos/{owner}/{repo}/environments + - name: RepositoriesService.ListForks + operations: + - GET /repos/{owner}/{repo}/forks + - name: RepositoriesService.ListHookDeliveries + operations: + - GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries + - name: RepositoriesService.ListHooks + operations: + - GET /repos/{owner}/{repo}/hooks + - name: RepositoriesService.ListInvitations + operations: + - GET /repos/{owner}/{repo}/invitations + - name: RepositoriesService.ListKeys + operations: + - GET /repos/{owner}/{repo}/keys + - name: RepositoriesService.ListLanguages + operations: + - GET /repos/{owner}/{repo}/languages + - name: RepositoriesService.ListPagesBuilds + operations: + - GET /repos/{owner}/{repo}/pages/builds + - name: RepositoriesService.ListParticipation + operations: + - GET /repos/{owner}/{repo}/stats/participation + - name: RepositoriesService.ListPreReceiveHooks + operations: + - GET /repos/{owner}/{repo}/pre-receive-hooks + - name: RepositoriesService.ListProjects + operations: + - GET /repos/{owner}/{repo}/projects + - name: RepositoriesService.ListPunchCard + operations: + - GET /repos/{owner}/{repo}/stats/punch_card + - name: RepositoriesService.ListReleaseAssets + operations: + - GET /repos/{owner}/{repo}/releases/{release_id}/assets + - name: RepositoriesService.ListReleases + operations: + - GET /repos/{owner}/{repo}/releases + - name: RepositoriesService.ListRequiredStatusChecksContexts + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + - name: RepositoriesService.ListStatuses + operations: + - GET /repos/{owner}/{repo}/commits/{ref}/statuses + - name: RepositoriesService.ListTagProtection + operations: + - GET /repos/{owner}/{repo}/tags/protection + - name: RepositoriesService.ListTags + operations: + - GET /repos/{owner}/{repo}/tags + - name: RepositoriesService.ListTeamRestrictions + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + - name: RepositoriesService.ListTeams + operations: + - GET /repos/{owner}/{repo}/teams + - name: RepositoriesService.ListTrafficClones + operations: + - GET /repos/{owner}/{repo}/traffic/clones + - name: RepositoriesService.ListTrafficPaths + operations: + - GET /repos/{owner}/{repo}/traffic/popular/paths + - name: RepositoriesService.ListTrafficReferrers + operations: + - GET /repos/{owner}/{repo}/traffic/popular/referrers + - name: RepositoriesService.ListTrafficViews + operations: + - GET /repos/{owner}/{repo}/traffic/views + - name: RepositoriesService.ListUserRestrictions + operations: + - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + - name: RepositoriesService.Merge + operations: + - POST /repos/{owner}/{repo}/merges + - name: RepositoriesService.MergeUpstream + operations: + - POST /repos/{owner}/{repo}/merge-upstream + - name: RepositoriesService.OptionalSignaturesOnProtectedBranch + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + - name: RepositoriesService.PingHook + operations: + - POST /repos/{owner}/{repo}/hooks/{hook_id}/pings + - name: RepositoriesService.RedeliverHookDelivery + operations: + - POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts + - name: RepositoriesService.RemoveAdminEnforcement + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + - name: RepositoriesService.RemoveAppRestrictions + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + - name: RepositoriesService.RemoveBranchProtection + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection + - name: RepositoriesService.RemoveCollaborator + operations: + - DELETE /repos/{owner}/{repo}/collaborators/{username} + - name: RepositoriesService.RemovePullRequestReviewEnforcement + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + - name: RepositoriesService.RemoveRequiredStatusChecks + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + - name: RepositoriesService.RemoveTeamRestrictions + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + - name: RepositoriesService.RemoveUserRestrictions + operations: + - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + - name: RepositoriesService.RenameBranch + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/rename + - name: RepositoriesService.ReplaceAllTopics + operations: + - PUT /repos/{owner}/{repo}/topics + - name: RepositoriesService.ReplaceAppRestrictions + operations: + - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + - name: RepositoriesService.ReplaceTeamRestrictions + operations: + - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + - name: RepositoriesService.ReplaceUserRestrictions + operations: + - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + - name: RepositoriesService.RequestPageBuild + operations: + - POST /repos/{owner}/{repo}/pages/builds + - name: RepositoriesService.RequireSignaturesOnProtectedBranch + operations: + - POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + - name: RepositoriesService.Subscribe + operations: + - POST /hub + - name: RepositoriesService.TestHook + operations: + - POST /repos/{owner}/{repo}/hooks/{hook_id}/tests + - name: RepositoriesService.Transfer + operations: + - POST /repos/{owner}/{repo}/transfer + - name: RepositoriesService.Unsubscribe + operations: + - POST /hub + - name: RepositoriesService.UpdateBranchProtection + operations: + - PUT /repos/{owner}/{repo}/branches/{branch}/protection + - name: RepositoriesService.UpdateComment + operations: + - PATCH /repos/{owner}/{repo}/comments/{comment_id} + - name: RepositoriesService.UpdateDeploymentBranchPolicy + operations: + - PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} + - name: RepositoriesService.UpdateFile + operations: + - PUT /repos/{owner}/{repo}/contents/{path} + - name: RepositoriesService.UpdateInvitation + operations: + - PATCH /repos/{owner}/{repo}/invitations/{invitation_id} + - name: RepositoriesService.UpdatePages + operations: + - PUT /repos/{owner}/{repo}/pages + - name: RepositoriesService.UpdatePreReceiveHook + operations: + - PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + - name: RepositoriesService.UpdatePullRequestReviewEnforcement + operations: + - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + - name: RepositoriesService.UpdateRequiredStatusChecks + operations: + - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + - name: RepositoriesService.UpdateRuleset + operations: + - PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} + - name: RepositoriesService.UploadReleaseAsset + operations: + - POST /repos/{owner}/{repo}/releases/{release_id}/assets + - name: SCIMService.DeleteSCIMUserFromOrg + operations: + - DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} + - name: SCIMService.GetSCIMProvisioningInfoForUser + operations: + - GET /scim/v2/organizations/{org}/Users/{scim_user_id} + - name: SCIMService.ListSCIMProvisionedIdentities + operations: + - GET /scim/v2/organizations/{org}/Users + - name: SCIMService.ProvisionAndInviteSCIMUser + operations: + - POST /scim/v2/organizations/{org}/Users + - name: SCIMService.UpdateAttributeForSCIMUser + operations: + - PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} + - name: SCIMService.UpdateProvisionedOrgMembership + operations: + - PUT /scim/v2/organizations/{org}/Users/{scim_user_id} + - name: SearchService.Code + operations: + - GET /search/code + - name: SearchService.Commits + operations: + - GET /search/commits + - name: SearchService.Issues + operations: + - GET /search/issues + - name: SearchService.Labels + operations: + - GET /search/labels + - name: SearchService.Repositories + operations: + - GET /search/repositories + - name: SearchService.Topics + operations: + - GET /search/topics + - name: SearchService.Users + operations: + - GET /search/users + - name: SecretScanningService.GetAlert + operations: + - GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + - name: SecretScanningService.ListAlertsForEnterprise + operations: + - GET /enterprises/{enterprise}/secret-scanning/alerts + - name: SecretScanningService.ListAlertsForOrg + operations: + - GET /orgs/{org}/secret-scanning/alerts + - name: SecretScanningService.ListAlertsForRepo + operations: + - GET /repos/{owner}/{repo}/secret-scanning/alerts + - name: SecretScanningService.ListLocationsForAlert + operations: + - GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations + - name: SecretScanningService.UpdateAlert + operations: + - PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + - name: SecurityAdvisoriesService.ListRepositorySecurityAdvisories + operations: + - GET /repos/{owner}/{repo}/security-advisories + - name: SecurityAdvisoriesService.ListRepositorySecurityAdvisoriesForOrg + operations: + - GET /orgs/{org}/security-advisories + - name: SecurityAdvisoriesService.RequestCVE + operations: + - POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve + - name: TeamsService.AddTeamMembershipByID + operations: + - PUT /orgs/{org}/teams/{team_slug}/memberships/{username} + - name: TeamsService.AddTeamMembershipBySlug + operations: + - PUT /orgs/{org}/teams/{team_slug}/memberships/{username} + - name: TeamsService.AddTeamProjectByID + operations: + - PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.AddTeamProjectBySlug + operations: + - PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.AddTeamRepoByID + operations: + - PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.AddTeamRepoBySlug + operations: + - PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.CreateCommentByID + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + - name: TeamsService.CreateCommentBySlug + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + - name: TeamsService.CreateDiscussionByID + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions + - name: TeamsService.CreateDiscussionBySlug + operations: + - POST /orgs/{org}/teams/{team_slug}/discussions + - name: TeamsService.CreateOrUpdateIDPGroupConnectionsByID + operations: + - PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + - name: TeamsService.CreateOrUpdateIDPGroupConnectionsBySlug + operations: + - PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + - name: TeamsService.CreateTeam + operations: + - POST /orgs/{org}/teams + - name: TeamsService.DeleteCommentByID + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.DeleteCommentBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.DeleteDiscussionByID + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.DeleteDiscussionBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.DeleteTeamByID + operations: + - DELETE /orgs/{org}/teams/{team_slug} + - name: TeamsService.DeleteTeamBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug} + - name: TeamsService.EditCommentByID + operations: + - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.EditCommentBySlug + operations: + - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.EditDiscussionByID + operations: + - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.EditDiscussionBySlug + operations: + - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.EditTeamByID + operations: + - PATCH /orgs/{org}/teams/{team_slug} + - name: TeamsService.EditTeamBySlug + operations: + - PATCH /orgs/{org}/teams/{team_slug} + - name: TeamsService.GetCommentByID + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.GetCommentBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + - name: TeamsService.GetDiscussionByID + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.GetDiscussionBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + - name: TeamsService.GetExternalGroup + operations: + - GET /orgs/{org}/external-group/{group_id} + - name: TeamsService.GetTeamByID + operations: + - GET /orgs/{org}/teams/{team_slug} + - name: TeamsService.GetTeamBySlug + operations: + - GET /orgs/{org}/teams/{team_slug} + - name: TeamsService.GetTeamMembershipByID + operations: + - GET /orgs/{org}/teams/{team_slug}/members + - name: TeamsService.GetTeamMembershipBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/memberships/{username} + - name: TeamsService.IsTeamRepoByID + operations: + - GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.IsTeamRepoBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.ListChildTeamsByParentID + operations: + - GET /orgs/{org}/teams/{team_slug}/teams + - name: TeamsService.ListChildTeamsByParentSlug + operations: + - GET /orgs/{org}/teams/{team_slug}/teams + - name: TeamsService.ListCommentsByID + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + - name: TeamsService.ListCommentsBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + - name: TeamsService.ListDiscussionsByID + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions + - name: TeamsService.ListDiscussionsBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/discussions + - name: TeamsService.ListExternalGroups + operations: + - GET /orgs/{org}/external-groups + - name: TeamsService.ListExternalGroupsForTeamBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/external-groups + - name: TeamsService.ListIDPGroupsForTeamByID + operations: + - GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + - name: TeamsService.ListIDPGroupsForTeamBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + - name: TeamsService.ListIDPGroupsInOrganization + operations: + - GET /orgs/{org}/team-sync/groups + - name: TeamsService.ListPendingTeamInvitationsByID + operations: + - GET /orgs/{org}/teams/{team_slug}/invitations + - name: TeamsService.ListPendingTeamInvitationsBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/invitations + - name: TeamsService.ListTeamMembersByID + operations: + - GET /orgs/{org}/teams/{team_slug}/members + - name: TeamsService.ListTeamMembersBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/members + - name: TeamsService.ListTeamProjectsByID + operations: + - GET /orgs/{org}/teams/{team_slug}/projects + - name: TeamsService.ListTeamProjectsBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/projects + - name: TeamsService.ListTeamReposByID + operations: + - GET /orgs/{org}/teams/{team_slug}/repos + - name: TeamsService.ListTeamReposBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/repos + - name: TeamsService.ListTeams + operations: + - GET /orgs/{org}/teams + - name: TeamsService.ListUserTeams + operations: + - GET /user/teams + - name: TeamsService.RemoveConnectedExternalGroup + operations: + - DELETE /orgs/{org}/teams/{team_slug}/external-groups + - name: TeamsService.RemoveTeamMembershipByID + operations: + - DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} + - name: TeamsService.RemoveTeamMembershipBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} + - name: TeamsService.RemoveTeamProjectByID + operations: + - DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.RemoveTeamProjectBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.RemoveTeamRepoByID + operations: + - DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.RemoveTeamRepoBySlug + operations: + - DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + - name: TeamsService.ReviewTeamProjectsByID + operations: + - GET /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.ReviewTeamProjectsBySlug + operations: + - GET /orgs/{org}/teams/{team_slug}/projects/{project_id} + - name: TeamsService.UpdateConnectedExternalGroup + operations: + - PATCH /orgs/{org}/teams/{team_slug}/external-groups + - name: UsersService.AcceptInvitation + operations: + - PATCH /user/repository_invitations/{invitation_id} + - name: UsersService.AddEmails + operations: + - POST /user/emails + - name: UsersService.BlockUser + operations: + - PUT /user/blocks/{username} + - name: UsersService.CreateGPGKey + operations: + - POST /user/gpg_keys + - name: UsersService.CreateKey + operations: + - POST /user/keys + - name: UsersService.CreateProject + operations: + - POST /user/projects + - name: UsersService.CreateSSHSigningKey + operations: + - POST /user/ssh_signing_keys + - name: UsersService.DeclineInvitation + operations: + - DELETE /user/repository_invitations/{invitation_id} + - name: UsersService.DeleteEmails + operations: + - DELETE /user/emails + - name: UsersService.DeleteGPGKey + operations: + - DELETE /user/gpg_keys/{gpg_key_id} + - name: UsersService.DeleteKey + operations: + - DELETE /user/keys/{key_id} + - name: UsersService.DeletePackage + operations: + - DELETE /user/packages/{package_type}/{package_name} + - DELETE /users/{username}/packages/{package_type}/{package_name} + - name: UsersService.DeleteSSHSigningKey + operations: + - DELETE /user/ssh_signing_keys/{ssh_signing_key_id} + - name: UsersService.DemoteSiteAdmin + operations: + - DELETE /users/{username}/site_admin + - name: UsersService.Edit + operations: + - PATCH /user + - name: UsersService.Follow + operations: + - PUT /user/following/{username} + - name: UsersService.Get + operations: + - GET /user + - GET /users/{username} + - name: UsersService.GetByID + operations: + - GET /user/{user_id} + - name: UsersService.GetGPGKey + operations: + - GET /user/gpg_keys/{gpg_key_id} + - name: UsersService.GetHovercard + operations: + - GET /users/{username}/hovercard + - name: UsersService.GetKey + operations: + - GET /user/keys/{key_id} + - name: UsersService.GetPackage + operations: + - GET /user/packages/{package_type}/{package_name} + - GET /users/{username}/packages/{package_type}/{package_name} + - name: UsersService.GetSSHSigningKey + operations: + - GET /user/ssh_signing_keys/{ssh_signing_key_id} + - name: UsersService.IsBlocked + operations: + - GET /user/blocks/{username} + - name: UsersService.IsFollowing + operations: + - GET /user/following/{username} + - GET /users/{username}/following/{target_user} + - name: UsersService.ListAll + operations: + - GET /users + - name: UsersService.ListBlockedUsers + operations: + - GET /user/blocks + - name: UsersService.ListEmails + operations: + - GET /user/emails + - name: UsersService.ListFollowers + operations: + - GET /user/followers + - GET /users/{username}/followers + - name: UsersService.ListFollowing + operations: + - GET /user/following + - GET /users/{username}/following + - name: UsersService.ListGPGKeys + operations: + - GET /user/gpg_keys + - GET /users/{username}/gpg_keys + - name: UsersService.ListInvitations + operations: + - GET /user/repository_invitations + - name: UsersService.ListKeys + operations: + - GET /user/keys + - GET /users/{username}/keys + - name: UsersService.ListPackages + operations: + - GET /user/packages + - GET /users/{username}/packages + - name: UsersService.ListProjects + operations: + - GET /users/{username}/projects + - name: UsersService.ListSSHSigningKeys + operations: + - GET /user/ssh_signing_keys + - GET /users/{username}/ssh_signing_keys + - name: UsersService.PackageDeleteVersion + operations: + - DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} + - DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} + - name: UsersService.PackageGetAllVersions + operations: + - GET /user/packages/{package_type}/{package_name}/versions + - GET /users/{username}/packages/{package_type}/{package_name}/versions + - name: UsersService.PackageGetVersion + operations: + - GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} + - GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} + - name: UsersService.PackageRestoreVersion + operations: + - POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + - POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore + - name: UsersService.PromoteSiteAdmin + operations: + - PUT /users/{username}/site_admin + - name: UsersService.RestorePackage + operations: + - POST /user/packages/{package_type}/{package_name}/restore + - POST /users/{username}/packages/{package_type}/{package_name}/restore + - name: UsersService.SetEmailVisibility + operations: + - PATCH /user/email/visibility + - name: UsersService.Suspend + operations: + - PUT /users/{username}/suspended + - name: UsersService.UnblockUser + operations: + - DELETE /user/blocks/{username} + - name: UsersService.Unfollow + operations: + - DELETE /user/following/{username} + - name: UsersService.Unsuspend + operations: + - DELETE /users/{username}/suspended operations: - - openapi: - method: GET - endpoint_url: / - documentation_url: https://docs.github.com/rest/meta/meta#github-api-root - summary: GitHub API Root + - name: POST /hub + documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub + - name: GET /organizations/{organization_id} + - name: GET /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: POST /orgs/{org}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PATCH /orgs/{org}/actions/required_workflows/{workflow_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /repos/{owner}/{repo}/actions/required_workflows + documentation_url: https://docs.github.com/actions/using-workflows/required-workflows + - name: GET /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues + - name: POST /repos/{owner}/{repo}/import/issues + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import + - name: GET /repos/{owner}/{repo}/import/issues/{issue_number} + documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request + - name: GET /repositories/{repository_id} + - name: GET /repositories/{repository_id}/installation + - name: GET /user/{user_id} +operation_overrides: + - name: GET /meta + documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information + - name: DELETE /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site + - name: GET /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#get-a-github-pages-site + - name: POST /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-site + - name: PUT /repos/{owner}/{repo}/pages + documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site + - name: GET /repos/{owner}/{repo}/pages/builds + documentation_url: https://docs.github.com/rest/pages/pages#list-github-pages-builds + - name: POST /repos/{owner}/{repo}/pages/builds + 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_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 - - openapi: - method: GET - endpoint_url: /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks - summary: List global webhooks + - name: GET /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#list-global-webhooks openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /admin/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook - summary: Create a global webhook + - name: POST /admin/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#create-a-global-webhook openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#delete-a-global-webhook - summary: Delete a global webhook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#get-a-global-webhook - summary: Get a global webhook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /admin/hooks/{hook_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#update-a-global-webhook - summary: Update a global webhook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /admin/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/global-webhooks#ping-a-global-webhook - summary: Ping a global webhook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /admin/keys - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys - summary: List public keys + - name: GET /admin/keys + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-public-keys openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /admin/keys/{key_ids} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key - summary: Delete a public key + - name: DELETE /admin/keys/{key_ids} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-public-key openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update LDAP mapping for a team + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.UpdateTeamLDAPMapping - - openapi: - method: POST - endpoint_url: /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 - summary: Sync LDAP mapping for a team + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update LDAP mapping for a user + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.UpdateUserLDAPMapping - - openapi: - method: POST - endpoint_url: /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 - summary: Sync LDAP mapping for a user + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /admin/organizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization - summary: Create an organization + - name: POST /admin/organizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#create-an-organization openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.CreateOrg - - openapi: - method: PATCH - endpoint_url: /admin/organizations/{org} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name - summary: Update an organization name + - name: PATCH /admin/organizations/{org} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/orgs#update-an-organization-name openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.RenameOrg - - AdminService.RenameOrgByName - - openapi: - method: GET - endpoint_url: /admin/pre-receive-environments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments - summary: List pre-receive environments + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /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 - summary: Create a pre-receive environment + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a pre-receive environment + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get a pre-receive environment + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a pre-receive environment + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /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 - summary: Start a pre-receive environment download + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get the download status for a pre-receive environment + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /admin/pre-receive-hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks - summary: List pre-receive hooks + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /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 - summary: Create a pre-receive hook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a pre-receive hook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get a pre-receive hook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a pre-receive hook + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /admin/tokens - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens - summary: List personal access tokens + - name: GET /admin/tokens + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#list-personal-access-tokens openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /admin/tokens/{token_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-personal-access-token - summary: Delete a personal access token + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /admin/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user - summary: Create a user + - name: POST /admin/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-a-user openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.CreateUser - - openapi: - method: DELETE - endpoint_url: /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user - summary: Delete a user + - name: DELETE /admin/users/{username} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-a-user openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.DeleteUser - - openapi: - method: PATCH - endpoint_url: /admin/users/{username} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#update-the-username-for-a-user - summary: Update the username for a user + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#delete-an-impersonation-oauth-token - summary: Delete an impersonation OAuth token + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.DeleteUserImpersonation - - AuthorizationsService.DeleteImpersonation - - openapi: - method: POST - endpoint_url: /admin/users/{username}/authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#create-an-impersonation-oauth-token - summary: Create an impersonation OAuth token + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.CreateUserImpersonation - - AuthorizationsService.CreateImpersonation - - openapi: - method: GET - endpoint_url: /advisories - documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories - summary: List global security advisories + - 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 - - openapi: - method: GET - endpoint_url: /advisories/{ghsa_id} - documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory - summary: Get a global security advisory + - 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 - - openapi: - method: GET - endpoint_url: /app - documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app - summary: Get the authenticated app + - 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 - go_methods: - - AppsService.Get - - openapi: - method: POST - endpoint_url: /app-manifests/{code}/conversions - documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest - summary: Create a GitHub App from a manifest + - 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 - go_methods: - - AppsService.CompleteAppManifest - - openapi: - method: GET - endpoint_url: /app/hook/config - documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app - summary: Get a webhook configuration for an app + - 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 - go_methods: - - AppsService.GetHookConfig - - openapi: - method: PATCH - endpoint_url: /app/hook/config - documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app - summary: Update a webhook configuration for an app + - 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 - go_methods: - - AppsService.UpdateHookConfig - - openapi: - method: GET - endpoint_url: /app/hook/deliveries - documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook - summary: List deliveries for an app webhook + - 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 - go_methods: - - AppsService.ListHookDeliveries - - openapi: - method: GET - endpoint_url: /app/hook/deliveries/{delivery_id} - documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook - summary: Get a delivery for an app webhook + - 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 - go_methods: - - AppsService.GetHookDelivery - - openapi: - method: POST - endpoint_url: /app/hook/deliveries/{delivery_id}/attempts - documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook - summary: Redeliver a delivery for an app webhook + - 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 - go_methods: - - AppsService.RedeliverHookDelivery - - openapi: - method: GET - endpoint_url: /app/installation-requests - documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app - summary: List installation requests for the authenticated app + - 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 - - openapi: - method: GET - endpoint_url: /app/installations - documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app - summary: List installations for the authenticated app + - 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 - go_methods: - - AppsService.ListInstallations - - openapi: - method: DELETE - endpoint_url: /app/installations/{installation_id} - documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app - summary: Delete an installation for the authenticated app + - 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 - go_methods: - - AppsService.DeleteInstallation - - openapi: - method: GET - endpoint_url: /app/installations/{installation_id} - documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app - summary: Get an installation for the authenticated app + - 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 - go_methods: - - AppsService.GetInstallation - - openapi: - method: POST - endpoint_url: /app/installations/{installation_id}/access_tokens - documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app - summary: Create an installation access token for an app + - 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 - go_methods: - - AppsService.CreateInstallationToken - - openapi: - method: DELETE - endpoint_url: /app/installations/{installation_id}/suspended - documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation - summary: Unsuspend an app installation + - 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 - go_methods: - - AppsService.UnsuspendInstallation - - openapi: - method: PUT - endpoint_url: /app/installations/{installation_id}/suspended - documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation - summary: Suspend an app installation + - 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 - go_methods: - - AppsService.SuspendInstallation - - openapi: - method: GET - endpoint_url: /applications/grants - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants - summary: List your grants + - name: GET /applications/grants + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-grants openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant - summary: Delete a grant + - name: DELETE /applications/grants/{grant_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-a-grant openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /applications/grants/{grant_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant - summary: Get a single grant + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /applications/{client_id}/grant - documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization - summary: Delete an app authorization + - 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 - go_methods: - - AuthorizationsService.DeleteGrant - - openapi: - method: DELETE - endpoint_url: /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 - summary: Revoke a grant for an application + - 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: - descriptions/ghes-3.3/ghes-3.3.json - - openapi: - method: DELETE - endpoint_url: /applications/{client_id}/token - documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token - summary: Delete an app token + - name: DELETE /applications/{client_id}/token + documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AuthorizationsService.Revoke - - openapi: - method: PATCH - endpoint_url: /applications/{client_id}/token - documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token - summary: Reset a token + - 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 - go_methods: - - AuthorizationsService.Reset - - openapi: - method: POST - endpoint_url: /applications/{client_id}/token - documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token - summary: Check a token + - 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 - go_methods: - - AuthorizationsService.Check - - openapi: - method: POST - endpoint_url: /applications/{client_id}/token/scoped - documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token - summary: Create a scoped access token + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Revoke an authorization for an application + - 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: - descriptions/ghes-3.3/ghes-3.3.json - - openapi: - method: GET - endpoint_url: /applications/{client_id}/tokens/{access_token} - documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#check-an-authorization - summary: Check an authorization + - name: GET /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#check-an-authorization openapi_files: - descriptions/ghes-3.3/ghes-3.3.json - - openapi: - method: POST - endpoint_url: /applications/{client_id}/tokens/{access_token} - documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#reset-an-authorization - summary: Reset an authorization + - name: POST /applications/{client_id}/tokens/{access_token} + documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#reset-an-authorization openapi_files: - descriptions/ghes-3.3/ghes-3.3.json - - openapi: - method: GET - endpoint_url: /apps/{app_slug} - documentation_url: https://docs.github.com/rest/apps/apps#get-an-app - summary: Get an app + - name: GET /apps/{app_slug} + documentation_url: https://docs.github.com/rest/apps/apps#get-an-app openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AppsService.Get - - openapi: - method: GET - endpoint_url: /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations - summary: List your authorizations + - name: GET /assignments/{assignment_id} + documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /assignments/{assignment_id}/accepted_assignments + documentation_url: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /assignments/{assignment_id}/grades + documentation_url: https://docs.github.com/rest/classroom/classroom#get-assignment-grades + openapi_files: + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /authorizations - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization - summary: Create a new authorization + - name: POST /authorizations + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PUT - endpoint_url: /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 - summary: Get-or-create an authorization for a specific app + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PUT - endpoint_url: /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 - summary: Get-or-create an authorization for a specific app and fingerprint + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization - summary: Delete an authorization + - name: DELETE /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization - summary: Get a single authorization + - name: GET /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /authorizations/{authorization_id} - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization - summary: Update an existing authorization + - name: PATCH /authorizations/{authorization_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /codes_of_conduct - documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct - summary: Get all codes of conduct + - name: GET /classrooms + documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /classrooms/{classroom_id} + documentation_url: https://docs.github.com/rest/classroom/classroom#get-a-classroom + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /classrooms/{classroom_id}/assignments + documentation_url: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /codes_of_conduct + documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - Client.ListCodesOfConduct - - openapi: - method: GET - endpoint_url: /codes_of_conduct/{key} - documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct - summary: Get a code of conduct + - 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 - go_methods: - - Client.GetCodeOfConduct - - openapi: - method: GET - endpoint_url: /emojis - documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis - summary: Get emojis + - 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 - go_methods: - - Client.ListEmojis - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Enterprise Server statistics + - 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 - - openapi: - method: DELETE - endpoint_url: /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner - summary: Remove the global announcement banner + - name: DELETE /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner - summary: Get the global announcement banner + - name: GET /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#get-the-global-announcement-banner openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /enterprise/announcement - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner - summary: Set the global announcement banner + - name: PATCH /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#set-the-global-announcement-banner openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/settings/license - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information - summary: Get license information + - name: GET /enterprise/settings/license + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/license#get-license-information openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/all - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics - summary: Get all statistics + - name: GET /enterprise/stats/all + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-all-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - AdminService.GetAdminStats - - openapi: - method: GET - endpoint_url: /enterprise/stats/comments - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics - summary: Get comment statistics + - name: GET /enterprise/stats/comments + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-comment-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/gists - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics - summary: Get gist statistics + - name: GET /enterprise/stats/gists + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-gist-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/hooks - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics - summary: Get hooks statistics + - name: GET /enterprise/stats/hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-hooks-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/issues - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics - summary: Get issue statistics + - name: GET /enterprise/stats/issues + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-issue-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/milestones - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics - summary: Get milestone statistics + - name: GET /enterprise/stats/milestones + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-milestone-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/orgs - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics - summary: Get organization statistics + - name: GET /enterprise/stats/orgs + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-organization-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/pages - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics - summary: Get pages statistics + - name: GET /enterprise/stats/pages + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pages-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/pulls - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics - summary: Get pull request statistics + - name: GET /enterprise/stats/pulls + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-pull-request-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/repos - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics - summary: Get repository statistics + - name: GET /enterprise/stats/repos + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-repository-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/security-products - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-security-products-statistics - summary: Get security products statistics + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprise/stats/users - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics - summary: Get users statistics + - name: GET /enterprise/stats/users + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/admin-stats#get-users-statistics openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Actions cache usage for an enterprise + - 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 - go_methods: - - ActionsService.GetTotalCacheUsageForEnterprise - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Actions cache usage policy for an enterprise + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Set GitHub Actions cache usage policy for an enterprise + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PUT - endpoint_url: /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 - summary: Set the GitHub Actions OIDC custom issuer policy for an enterprise + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/actions/permissions - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise - summary: Get GitHub Actions permissions for an enterprise + - name: GET /enterprises/{enterprise}/actions/permissions + 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 - - openapi: - method: PUT - endpoint_url: /enterprises/{enterprise}/actions/permissions - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise - summary: Set GitHub Actions permissions for an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List selected organizations enabled for GitHub Actions in an enterprise + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set selected organizations enabled for GitHub Actions in an enterprise + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Disable a selected organization for GitHub Actions in an enterprise + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Enable a selected organization for GitHub Actions in an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get allowed actions and reusable workflows for an enterprise + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set allowed actions and reusable workflows for an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/actions/permissions/workflow - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise - summary: Get default workflow permissions for an enterprise + - 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 - - openapi: - method: PUT - endpoint_url: /enterprises/{enterprise}/actions/permissions/workflow - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise - summary: Set default workflow permissions for an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List self-hosted runner groups for an enterprise + - 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 - go_methods: - - EnterpriseService.ListRunnerGroups - - openapi: - method: POST - endpoint_url: /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 - summary: Create a self-hosted runner group for an enterprise + - 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 - go_methods: - - EnterpriseService.CreateEnterpriseRunnerGroup - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a self-hosted runner group from an enterprise + - 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 - go_methods: - - EnterpriseService.DeleteEnterpriseRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: Get a self-hosted runner group for an enterprise + - 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 - go_methods: - - EnterpriseService.GetEnterpriseRunnerGroup - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a self-hosted runner group for an enterprise + - 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 - go_methods: - - EnterpriseService.UpdateEnterpriseRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: List organization access to a self-hosted runner group in an enterprise + - 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 - go_methods: - - EnterpriseService.ListOrganizationAccessRunnerGroup - - openapi: - method: PUT - endpoint_url: /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 - summary: Set organization access for a self-hosted runner group in an enterprise + - 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 - go_methods: - - EnterpriseService.SetOrganizationAccessRunnerGroup - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove organization access to a self-hosted runner group in an enterprise + - 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 - go_methods: - - EnterpriseService.RemoveOrganizationAccessRunnerGroup - - openapi: - method: PUT - endpoint_url: /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 - summary: Add organization access to a self-hosted runner group in an enterprise + - 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 - go_methods: - - EnterpriseService.AddOrganizationAccessRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: List self-hosted runners in a group for an enterprise + - 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 - go_methods: - - EnterpriseService.ListRunnerGroupRunners - - openapi: - method: PUT - endpoint_url: /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 - summary: Set self-hosted runners in a group for an enterprise + - 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 - go_methods: - - EnterpriseService.SetRunnerGroupRunners - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove a self-hosted runner from a group for an enterprise + - 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 - go_methods: - - EnterpriseService.RemoveRunnerGroupRunners - - openapi: - method: PUT - endpoint_url: /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 - summary: Add a self-hosted runner to a group for an enterprise + - 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 - go_methods: - - EnterpriseService.AddRunnerGroupRunners - - openapi: - method: GET - endpoint_url: /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 - summary: List self-hosted runners for an enterprise + - 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 - go_methods: - - EnterpriseService.ListRunners - - openapi: - method: GET - endpoint_url: /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 - summary: List runner applications for an enterprise + - 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 - go_methods: - - EnterpriseService.ListRunnerApplicationDownloads - - openapi: - method: POST - endpoint_url: /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 - summary: Create configuration for a just-in-time runner for an Enterprise + - 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 - go_methods: - - EnterpriseService.GenerateEnterpriseJITConfig - - openapi: - method: POST - endpoint_url: /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 - summary: Create a registration token for an enterprise + - 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 - go_methods: - - EnterpriseService.CreateRegistrationToken - - openapi: - method: POST - endpoint_url: /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 - summary: Create a remove token for an enterprise + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a self-hosted runner from an enterprise + - 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 - go_methods: - - EnterpriseService.RemoveRunner - - openapi: - method: GET - endpoint_url: /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 - summary: Get a self-hosted runner for an enterprise + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove all custom labels from a self-hosted runner for an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List labels for a self-hosted runner for an enterprise + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Add custom labels to a self-hosted runner for an enterprise + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set custom labels for a self-hosted runner for an enterprise + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove a custom label from a self-hosted runner for an enterprise + - 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 - - openapi: - method: DELETE - endpoint_url: /enterprises/{enterprise}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise - summary: Remove announcement banner from enterprise + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#get-announcement-banner-for-enterprise - summary: Get announcement banner for enterprise + - name: GET /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#get-announcement-banner-for-enterprise openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: PATCH - endpoint_url: /enterprises/{enterprise}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#set-announcement-banner-for-enterprise - summary: Set announcement banner for enterprise + - name: PATCH /enterprises/{enterprise}/announcement + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#set-announcement-banner-for-enterprise openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/audit-log - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise - summary: Get the audit log for an enterprise + - name: GET /enterprises/{enterprise}/audit-log + 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 - go_methods: - - EnterpriseService.GetAuditLog - - openapi: - method: GET - endpoint_url: /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 - summary: List code scanning alerts for an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get code security and analysis features for an enterprise + - 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 - go_methods: - - EnterpriseService.GetCodeSecurityAndAnalysis - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update code security and analysis features for an enterprise + - 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 - go_methods: - - EnterpriseService.UpdateCodeSecurityAndAnalysis - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/consumed-licenses - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#list-enterprise-consumed-licenses - summary: List enterprise consumed licenses + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/dependabot/alerts - documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise - summary: List Dependabot alerts for an enterprise + - name: GET /enterprises/{enterprise}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/license-sync-status - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/license#get-a-license-sync-status - summary: Get a license sync status + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/secret-scanning/alerts - documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise - summary: List secret scanning alerts for an enterprise + - name: GET /enterprises/{enterprise}/secret-scanning/alerts + documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - SecretScanningService.ListAlertsForEnterprise - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Actions billing for an enterprise + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/settings/billing/advanced-security - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise - summary: Get GitHub Advanced Security active committers for an enterprise + - name: GET /enterprises/{enterprise}/settings/billing/advanced-security + 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Packages billing for an enterprise + - 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: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /enterprises/{enterprise}/settings/billing/shared-storage - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-shared-storage-billing-for-an-enterprise - summary: Get shared storage billing for an enterprise + - name: GET /enterprises/{enterprise}/settings/billing/shared-storage + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#get-shared-storage-billing-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /enterprises/{enterprise}/{security_product}/{enablement} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature - summary: Enable or disable a security feature + - name: POST /enterprises/{enterprise}/{security_product}/{enablement} + 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 - go_methods: - - EnterpriseService.EnableDisableSecurityFeature - - openapi: - method: GET - endpoint_url: /events - documentation_url: https://docs.github.com/rest/activity/events#list-public-events - summary: List public events + - 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 - go_methods: - - ActivityService.ListEvents - - openapi: - method: GET - endpoint_url: /feeds - documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds - summary: Get feeds + - 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 - go_methods: - - ActivityService.ListFeeds - - openapi: - method: GET - endpoint_url: /gists - documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user - summary: List gists for the authenticated user + - 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 - go_methods: - - GistsService.List - - openapi: - method: POST - endpoint_url: /gists - documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist - summary: Create a gist + - 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 - go_methods: - - GistsService.Create - - openapi: - method: GET - endpoint_url: /gists/public - documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists - summary: List public gists + - 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 - go_methods: - - GistsService.ListAll - - openapi: - method: GET - endpoint_url: /gists/starred - documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists - summary: List starred gists + - 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 - go_methods: - - GistsService.ListStarred - - openapi: - method: DELETE - endpoint_url: /gists/{gist_id} - documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist - summary: Delete a gist + - 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 - go_methods: - - GistsService.Delete - - openapi: - method: GET - endpoint_url: /gists/{gist_id} - documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist - summary: Get a gist + - 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 - go_methods: - - GistsService.Get - - openapi: - method: PATCH - endpoint_url: /gists/{gist_id} - documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist - summary: Update a gist + - 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 - go_methods: - - GistsService.Edit - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/comments - documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments - summary: List gist comments + - 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 - go_methods: - - GistsService.ListComments - - openapi: - method: POST - endpoint_url: /gists/{gist_id}/comments - documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment - summary: Create a gist comment + - 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 - go_methods: - - GistsService.CreateComment - - openapi: - method: DELETE - endpoint_url: /gists/{gist_id}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment - summary: Delete a gist comment + - 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 - go_methods: - - GistsService.DeleteComment - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment - summary: Get a gist comment + - 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 - go_methods: - - GistsService.GetComment - - openapi: - method: PATCH - endpoint_url: /gists/{gist_id}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment - summary: Update a gist comment + - 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 - go_methods: - - GistsService.EditComment - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/commits - documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits - summary: List gist commits + - 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 - go_methods: - - GistsService.ListCommits - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/forks - documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks - summary: List gist forks + - 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 - go_methods: - - GistsService.ListForks - - openapi: - method: POST - endpoint_url: /gists/{gist_id}/forks - documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist - summary: Fork a gist + - 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 - go_methods: - - GistsService.Fork - - openapi: - method: DELETE - endpoint_url: /gists/{gist_id}/star - documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist - summary: Unstar a gist + - 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 - go_methods: - - GistsService.Unstar - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/star - documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred - summary: Check if a gist is starred + - 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 - go_methods: - - GistsService.IsStarred - - openapi: - method: PUT - endpoint_url: /gists/{gist_id}/star - documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist - summary: Star a gist + - 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 - go_methods: - - GistsService.Star - - openapi: - method: GET - endpoint_url: /gists/{gist_id}/{sha} - documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision - summary: Get a gist revision + - 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 - go_methods: - - GistsService.GetRevision - - openapi: - method: GET - endpoint_url: /gitignore/templates - documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates - summary: Get all gitignore templates + - 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 - go_methods: - - GitignoresService.List - - openapi: - method: GET - endpoint_url: /gitignore/templates/{name} - documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template - summary: Get a gitignore template + - 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 - go_methods: - - GitignoresService.Get - - override: - method: POST - endpoint_url: /hub - documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub - go_methods: - - RepositoriesService.Subscribe - - RepositoriesService.Unsubscribe - - openapi: - method: GET - endpoint_url: /installation/repositories - documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation - summary: List repositories accessible to the app installation + - 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 - go_methods: - - AppsService.ListRepos - - openapi: - method: DELETE - endpoint_url: /installation/token - documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token - summary: Revoke an installation access token + - 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 - go_methods: - - AppsService.RevokeInstallationToken - - openapi: - method: GET - endpoint_url: /issues - documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user - summary: List issues assigned to the authenticated user + - 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 - go_methods: - - IssuesService.List - - openapi: - method: GET - endpoint_url: /licenses - documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses - summary: Get all commonly used licenses + - 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 - go_methods: - - LicensesService.List - - openapi: - method: GET - endpoint_url: /licenses/{license} - documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license - summary: Get a license + - 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 - go_methods: - - LicensesService.Get - - openapi: - method: GET - endpoint_url: /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 - summary: Get GHES node metadata for all nodes + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode - summary: Get the status of maintenance mode + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /manage/v1/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode - summary: Set the status of maintenance mode + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get the status of services running on all replica nodes + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get all GHES release versions for all nodes + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /markdown - documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document - summary: Render a Markdown document + - 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 - go_methods: - - Client.Markdown - - openapi: - method: POST - endpoint_url: /markdown/raw - documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode - summary: Render a Markdown document in raw mode + - 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 - - openapi: - method: GET - endpoint_url: /marketplace_listing/accounts/{account_id} - documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account - summary: Get a subscription plan for an account + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.GetPlanAccountForAccount - - openapi: - method: GET - endpoint_url: /marketplace_listing/plans - documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans - summary: List plans + - name: GET /marketplace_listing/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListPlans - - openapi: - method: GET - endpoint_url: /marketplace_listing/plans/{plan_id}/accounts - documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan - summary: List accounts for a plan + - name: GET /marketplace_listing/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListPlanAccountsForPlan - - openapi: - method: GET - endpoint_url: /marketplace_listing/stubbed/accounts/{account_id} - documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed - summary: Get a subscription plan for an account (stubbed) + - name: GET /marketplace_listing/stubbed/accounts/{account_id} + documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.GetPlanAccountForAccount - - openapi: - method: GET - endpoint_url: /marketplace_listing/stubbed/plans - documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed - summary: List plans (stubbed) + - name: GET /marketplace_listing/stubbed/plans + documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListPlans - - openapi: - method: GET - endpoint_url: /marketplace_listing/stubbed/plans/{plan_id}/accounts - documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed - summary: List accounts for a plan (stubbed) + - name: GET /marketplace_listing/stubbed/plans/{plan_id}/accounts + documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListPlanAccountsForPlan - - openapi: - method: GET - endpoint_url: /meta - documentation_url: https://docs.github.com/rest/meta/meta#get-apiname-meta-information - summary: Get GitHub meta information - override: - documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information + - name: GET /meta + documentation_url: https://docs.github.com/rest/meta/meta#get-apiname-meta-information openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - Client.APIMeta - - openapi: - method: GET - endpoint_url: /networks/{owner}/{repo}/events - documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories - summary: List public events for a network of repositories + - 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 - go_methods: - - ActivityService.ListEventsForRepoNetwork - - openapi: - method: GET - endpoint_url: /notifications - documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user - summary: List notifications for the authenticated user + - 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 - go_methods: - - ActivityService.ListNotifications - - openapi: - method: PUT - endpoint_url: /notifications - documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read - summary: Mark notifications as read + - 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 - go_methods: - - ActivityService.MarkNotificationsRead - - openapi: - method: GET - endpoint_url: /notifications/threads/{thread_id} - documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread - summary: Get a thread + - 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 - go_methods: - - ActivityService.GetThread - - openapi: - method: PATCH - endpoint_url: /notifications/threads/{thread_id} - documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read - summary: Mark a thread as read + - 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 - go_methods: - - ActivityService.MarkThreadRead - - openapi: - method: DELETE - endpoint_url: /notifications/threads/{thread_id}/subscription - documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription - summary: Delete a thread subscription + - 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 - go_methods: - - ActivityService.DeleteThreadSubscription - - openapi: - method: GET - endpoint_url: /notifications/threads/{thread_id}/subscription - documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user - summary: Get a thread subscription for the authenticated user + - 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 - go_methods: - - ActivityService.GetThreadSubscription - - openapi: - method: PUT - endpoint_url: /notifications/threads/{thread_id}/subscription - documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription - summary: Set a thread subscription + - 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 - go_methods: - - ActivityService.SetThreadSubscription - - openapi: - method: GET - endpoint_url: /octocat - documentation_url: https://docs.github.com/rest/meta/meta#get-octocat - summary: Get Octocat + - 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 - go_methods: - - Client.Octocat - - openapi: - method: GET - endpoint_url: /organizations - documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations - summary: List organizations + - 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 - go_methods: - - OrganizationsService.ListAll - - openapi: - method: GET - endpoint_url: /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 - summary: Deprecated - List custom repository roles in an organization + - 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 - - openapi: - method: DELETE - endpoint_url: /orgs/{org} - documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization - summary: Delete an organization + - 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 - go_methods: - - OrganizationsService.Delete - - openapi: - method: GET - endpoint_url: /orgs/{org} - documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization - summary: Get an organization + - 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 - go_methods: - - OrganizationsService.Get - - openapi: - method: PATCH - endpoint_url: /orgs/{org} - documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization - summary: Update an organization + - 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 - go_methods: - - OrganizationsService.Edit - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/cache/usage - documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization - summary: Get GitHub Actions cache usage for an organization + - 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 - go_methods: - - ActionsService.GetTotalCacheUsageForOrg - - openapi: - method: GET - endpoint_url: /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 - summary: List repositories with GitHub Actions cache usage for an organization + - 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 - go_methods: - - ActionsService.ListCacheUsageByRepoForOrg - - openapi: - method: GET - endpoint_url: /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 - summary: Get the customization template for an OIDC subject claim for an organization + - 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 - go_methods: - - ActionsService.GetOrgOIDCSubjectClaimCustomTemplate - - openapi: - method: PUT - endpoint_url: /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 - summary: Set the customization template for an OIDC subject claim for an organization + - 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 - go_methods: - - ActionsService.SetOrgOIDCSubjectClaimCustomTemplate - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/permissions - documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization - summary: Get GitHub Actions permissions for an organization + - 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 - go_methods: - - OrganizationsService.GetActionsPermissions - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/permissions - documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization - summary: Set GitHub Actions permissions for an organization + - 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 - go_methods: - - OrganizationsService.EditActionsPermissions - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/permissions/repositories - documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization - summary: List selected repositories enabled for GitHub Actions in an organization + - 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 - go_methods: - - ActionsService.ListEnabledReposInOrg - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/permissions/repositories - documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization - summary: Set selected repositories enabled for GitHub Actions in an organization + - 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 - go_methods: - - ActionsService.SetEnabledReposInOrg - - openapi: - method: DELETE - endpoint_url: /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 - summary: Disable a selected repository for GitHub Actions in an organization + - 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 - go_methods: - - ActionsService.RemoveEnabledRepoInOrg - - openapi: - method: PUT - endpoint_url: /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 - summary: Enable a selected repository for GitHub Actions in an organization + - 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 - go_methods: - - ActionsService.AddEnabledReposInOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/permissions/selected-actions - documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization - summary: Get allowed actions and reusable workflows for an organization + - 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 - go_methods: - - OrganizationsService.GetActionsAllowed - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/permissions/selected-actions - documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization - summary: Set allowed actions and reusable workflows for an organization + - 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 - go_methods: - - OrganizationsService.EditActionsAllowed - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/permissions/workflow - documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization - summary: Get default workflow permissions for an organization + - 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 - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/permissions/workflow - documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization - summary: Set default workflow permissions for an organization + - 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 - - override: - method: GET - endpoint_url: /orgs/{org}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.ListOrgRequiredWorkflows - - override: - method: POST - endpoint_url: /orgs/{org}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.CreateRequiredWorkflow - - override: - method: DELETE - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.DeleteRequiredWorkflow - - override: - method: GET - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.GetRequiredWorkflowByID - - override: - method: PATCH - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.UpdateRequiredWorkflow - - override: - method: GET - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.ListRequiredWorkflowSelectedRepos - - override: - method: PUT - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.SetRequiredWorkflowSelectedRepos - - override: - method: DELETE - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.RemoveRepoFromRequiredWorkflow - - override: - method: PUT - endpoint_url: /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.AddRepoToRequiredWorkflow - - openapi: - method: GET - endpoint_url: /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 - summary: List self-hosted runner groups for an organization - openapi_files: - - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.ListOrganizationRunnerGroups - - openapi: - method: POST - endpoint_url: /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 - summary: Create a self-hosted runner group for an organization - openapi_files: - - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.CreateOrganizationRunnerGroup - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a self-hosted runner group from an organization - openapi_files: - - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.DeleteOrganizationRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: Get a self-hosted runner group for an organization - openapi_files: - - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.GetOrganizationRunnerGroup - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a self-hosted runner group for an organization - openapi_files: - - descriptions/ghec/ghec.json - - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.UpdateOrganizationRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: 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 - go_methods: - - ActionsService.ListRepositoryAccessRunnerGroup - - openapi: - method: PUT - endpoint_url: /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 - summary: Set repository access for a self-hosted runner group in an organization + - 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 - go_methods: - - ActionsService.SetRepositoryAccessRunnerGroup - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove repository access to a self-hosted runner group in an organization + - 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 - go_methods: - - ActionsService.RemoveRepositoryAccessRunnerGroup - - openapi: - method: PUT - endpoint_url: /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 - summary: Add repository access to a self-hosted runner group in an organization + - 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 - go_methods: - - ActionsService.AddRepositoryAccessRunnerGroup - - openapi: - method: GET - endpoint_url: /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 - summary: List self-hosted runners in a group for an organization + - 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 - go_methods: - - ActionsService.ListRunnerGroupRunners - - openapi: - method: PUT - endpoint_url: /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 - summary: Set self-hosted runners in a group for an organization + - 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 - go_methods: - - ActionsService.SetRunnerGroupRunners - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove a self-hosted runner from a group for an organization + - 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 - go_methods: - - ActionsService.RemoveRunnerGroupRunners - - openapi: - method: PUT - endpoint_url: /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 - summary: Add a self-hosted runner to a group for an organization + - 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 - go_methods: - - ActionsService.AddRunnerGroupRunners - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/runners - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization - summary: List self-hosted runners for an organization + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 - go_methods: - - ActionsService.ListOrganizationRunners - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/runners/downloads - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization - summary: List runner applications for an organization + - 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 - go_methods: - - ActionsService.ListOrganizationRunnerApplicationDownloads - - openapi: - method: POST - endpoint_url: /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 - summary: Create configuration for a just-in-time runner for an organization + - 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 - go_methods: - - ActionsService.GenerateOrgJITConfig - - openapi: - method: POST - endpoint_url: /orgs/{org}/actions/runners/registration-token - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization - summary: Create a registration token for an organization + - 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 - go_methods: - - ActionsService.CreateOrganizationRegistrationToken - - openapi: - method: POST - endpoint_url: /orgs/{org}/actions/runners/remove-token - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization - summary: Create a remove token for an organization + - 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 - go_methods: - - ActionsService.CreateOrganizationRemoveToken - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a self-hosted runner from an organization + - 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 - go_methods: - - ActionsService.RemoveOrganizationRunner - - openapi: - method: GET - endpoint_url: /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 - summary: Get a self-hosted runner for an organization + - 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 - go_methods: - - ActionsService.GetOrganizationRunner - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove all custom labels from a self-hosted runner for an organization + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List labels for a self-hosted runner for an organization + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Add custom labels to a self-hosted runner for an organization + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set custom labels for a self-hosted runner for an organization + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove a custom label from a self-hosted runner for an organization + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/secrets - documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets - summary: List organization secrets + - 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 - go_methods: - - ActionsService.ListOrgSecrets - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/secrets/public-key - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key - summary: Get an organization public key + - 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 - go_methods: - - ActionsService.GetOrgPublicKey - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret - summary: Delete an organization secret + - 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 - go_methods: - - ActionsService.DeleteOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret - summary: Get an organization secret + - 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 - go_methods: - - ActionsService.GetOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret - summary: Create or update an organization secret + - 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 - go_methods: - - ActionsService.CreateOrUpdateOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret - summary: List selected repositories for an organization secret + - 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 - go_methods: - - ActionsService.ListSelectedReposForOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret - summary: Set selected repositories for an organization secret + - 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 - go_methods: - - ActionsService.SetSelectedReposForOrgSecret - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove selected repository from an organization secret + - 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 - go_methods: - - ActionsService.RemoveSelectedRepoFromOrgSecret - - openapi: - method: PUT - endpoint_url: /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 - summary: Add selected repository to an organization secret + - 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 - go_methods: - - ActionsService.AddSelectedRepoToOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/variables - documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables - summary: List organization variables + - 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 - go_methods: - - ActionsService.ListOrgVariables - - openapi: - method: POST - endpoint_url: /orgs/{org}/actions/variables - documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable - summary: Create an organization variable + - 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 - go_methods: - - ActionsService.CreateOrgVariable - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable - summary: Delete an organization variable + - 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 - go_methods: - - ActionsService.DeleteOrgVariable - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable - summary: Get an organization variable + - 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 - go_methods: - - ActionsService.GetOrgVariable - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable - summary: Update an organization variable + - 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 - go_methods: - - ActionsService.UpdateOrgVariable - - openapi: - method: GET - endpoint_url: /orgs/{org}/actions/variables/{name}/repositories - documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable - summary: List selected repositories for an organization variable + - 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 - go_methods: - - ActionsService.ListSelectedReposForOrgVariable - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/variables/{name}/repositories - documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable - summary: Set selected repositories for an organization variable + - 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 - go_methods: - - ActionsService.SetSelectedReposForOrgVariable - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/actions/variables/{name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable - summary: Remove selected repository from an organization variable + - 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 - go_methods: - - ActionsService.RemoveSelectedRepoFromOrgVariable - - openapi: - method: PUT - endpoint_url: /orgs/{org}/actions/variables/{name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable - summary: Add selected repository to an organization variable + - 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 - go_methods: - - ActionsService.AddSelectedRepoToOrgVariable - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization - summary: Remove announcement banner from organization + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization - summary: Get announcement banner for organization + - 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 - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/announcement - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization - summary: Set announcement banner for organization + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/audit-log - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization - summary: Get the audit log for an organization + - 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 - go_methods: - - OrganizationsService.GetAuditLog - - openapi: - method: GET - endpoint_url: /orgs/{org}/blocks - documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization - summary: List users blocked by an organization + - name: GET /orgs/{org}/blocks + documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.ListBlockedUsers - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/blocks/{username} - documentation_url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization - summary: Unblock a user from an organization + - name: DELETE /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.UnblockUser - - openapi: - method: GET - endpoint_url: /orgs/{org}/blocks/{username} - documentation_url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization - summary: Check if a user is blocked by an organization + - name: GET /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.IsBlocked - - openapi: - method: PUT - endpoint_url: /orgs/{org}/blocks/{username} - documentation_url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization - summary: Block a user from an organization + - name: PUT /orgs/{org}/blocks/{username} + documentation_url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.BlockUser - - openapi: - method: GET - endpoint_url: /orgs/{org}/code-scanning/alerts - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization - summary: List code scanning alerts for an organization + - name: GET /orgs/{org}/code-scanning/alerts + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-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 - go_methods: - - CodeScanningService.ListAlertsForOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/codespaces - documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization - summary: List codespaces for the organization + - name: GET /orgs/{org}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: PUT - endpoint_url: /orgs/{org}/codespaces/access - documentation_url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces - summary: Manage access control for organization codespaces + - name: PUT /orgs/{org}/codespaces/access + documentation_url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/codespaces/access/selected_users - documentation_url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization - summary: Remove users from Codespaces access for an organization + - name: DELETE /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /orgs/{org}/codespaces/access/selected_users - documentation_url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization - summary: Add users to Codespaces access for an organization + - name: POST /orgs/{org}/codespaces/access/selected_users + documentation_url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/codespaces/secrets - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets - summary: List organization secrets + - name: GET /orgs/{org}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListOrgSecrets - - openapi: - method: GET - endpoint_url: /orgs/{org}/codespaces/secrets/public-key - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key - summary: Get an organization public key + - name: GET /orgs/{org}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetOrgPublicKey - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret - summary: Delete an organization secret + - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.DeleteOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret - summary: Get an organization secret + - name: GET /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret - summary: Create or update an organization secret + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.CreateOrUpdateOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret - summary: List selected repositories for an organization secret + - name: GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListSelectedReposForOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret - summary: Set selected repositories for an organization secret + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.SetSelectedReposForOrgSecret - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret - summary: Remove selected repository from an organization secret + - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.RemoveSelectedRepoFromOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret - summary: Add selected repository to an organization secret + - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.AddSelectedRepoToOrgSecret - - openapi: - method: GET - endpoint_url: /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 - summary: Get Copilot for Business seat information and settings for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /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 - summary: List all Copilot for Business seat assignments for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove teams from the Copilot for Business subscription for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /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 - summary: Add teams to the Copilot for Business subscription for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove users from the Copilot for Business subscription for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /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 - summary: Add users to the Copilot for Business subscription for an organization + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/credential-authorizations - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization - summary: List SAML SSO authorizations for an organization + - name: GET /orgs/{org}/credential-authorizations + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization openapi_files: - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.ListCredentialAuthorizations - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/credential-authorizations/{credential_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization - summary: Remove a SAML SSO authorization for an organization + - name: DELETE /orgs/{org}/credential-authorizations/{credential_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization openapi_files: - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.RemoveCredentialAuthorization - - openapi: - method: GET - endpoint_url: /orgs/{org}/custom-repository-roles - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization - summary: List custom repository roles in an organization + - name: GET /orgs/{org}/custom-repository-roles + 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 - go_methods: - - OrganizationsService.ListCustomRepoRoles - - openapi: - method: POST - endpoint_url: /orgs/{org}/custom-repository-roles - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role - summary: Create a custom repository role + - 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 - go_methods: - - OrganizationsService.CreateCustomRepoRole - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a custom repository role + - 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 - go_methods: - - OrganizationsService.DeleteCustomRepoRole - - openapi: - method: GET - endpoint_url: /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 - summary: Get a custom repository role + - 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 - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a custom repository role + - 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 - go_methods: - - OrganizationsService.UpdateCustomRepoRole - - openapi: - method: POST - endpoint_url: /orgs/{org}/custom_roles - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---create-a-custom-role - summary: Deprecated - Create a custom role + - 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: - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---delete-a-custom-role - summary: Deprecated - Delete a custom role + - name: DELETE /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---delete-a-custom-role openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---get-a-custom-role - summary: Deprecated - Get a custom role + - name: GET /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---get-a-custom-role openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/custom_roles/{role_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---update-a-custom-role - summary: Deprecated - Update a custom role + - name: PATCH /orgs/{org}/custom_roles/{role_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---update-a-custom-role openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/dependabot/alerts - documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization - summary: List Dependabot alerts for an organization + - name: GET /orgs/{org}/dependabot/alerts + documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-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 - go_methods: - - DependabotService.ListOrgAlerts - - openapi: - method: GET - endpoint_url: /orgs/{org}/dependabot/secrets - documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets - summary: List organization secrets + - 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 - go_methods: - - DependabotService.ListOrgSecrets - - openapi: - method: GET - endpoint_url: /orgs/{org}/dependabot/secrets/public-key - documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key - summary: Get an organization public key + - 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 - go_methods: - - DependabotService.GetOrgPublicKey - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret - summary: Delete an organization secret + - 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 - go_methods: - - DependabotService.DeleteOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret - summary: Get an organization secret + - 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 - go_methods: - - DependabotService.GetOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret - summary: Create or update an organization secret + - 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 - go_methods: - - DependabotService.CreateOrUpdateOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret - summary: List selected repositories for an organization secret + - 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 - go_methods: - - DependabotService.ListSelectedReposForOrgSecret - - openapi: - method: PUT - endpoint_url: /orgs/{org}/dependabot/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret - summary: Set selected repositories for an organization secret + - 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 - go_methods: - - DependabotService.SetSelectedReposForOrgSecret - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove selected repository from an organization secret + - 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 - go_methods: - - DependabotService.RemoveSelectedRepoFromOrgSecret - - openapi: - method: PUT - endpoint_url: /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 - summary: Add selected repository to an organization secret + - 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 - go_methods: - - DependabotService.AddSelectedRepoToOrgSecret - - openapi: - method: GET - endpoint_url: /orgs/{org}/docker/conflicts - documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization - summary: Get list of conflicting packages during Docker migration for organization + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/events - documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events - summary: List public organization events + - 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 - go_methods: - - ActivityService.ListEventsForOrganization - - openapi: - method: GET - endpoint_url: /orgs/{org}/external-group/{group_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group - summary: Get an external group + - 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 - go_methods: - - TeamsService.GetExternalGroup - - openapi: - method: GET - endpoint_url: /orgs/{org}/external-groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-in-an-organization - summary: List external groups in an organization + - 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 - go_methods: - - TeamsService.ListExternalGroups - - openapi: - method: GET - endpoint_url: /orgs/{org}/failed_invitations - documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations - summary: List failed organization invitations + - name: GET /orgs/{org}/failed_invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.ListFailedOrgInvitations - - openapi: - method: GET - endpoint_url: /orgs/{org}/fine_grained_permissions - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-fine-grained-permissions-for-an-organization - summary: Deprecated - List fine-grained permissions for an organization + - name: GET /orgs/{org}/fine_grained_permissions + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#deprecated---list-fine-grained-permissions-for-an-organization openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/hooks - documentation_url: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks - summary: List organization webhooks + - name: GET /orgs/{org}/hooks + documentation_url: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - OrganizationsService.ListHooks - - openapi: - method: POST - endpoint_url: /orgs/{org}/hooks - documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook - summary: Create an organization webhook + - 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 - go_methods: - - OrganizationsService.CreateHook - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook - summary: Delete an organization webhook + - 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 - go_methods: - - OrganizationsService.DeleteHook - - openapi: - method: GET - endpoint_url: /orgs/{org}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook - summary: Get an organization webhook + - 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 - go_methods: - - OrganizationsService.GetHook - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook - summary: Update an organization webhook + - 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 - go_methods: - - OrganizationsService.EditHook - - openapi: - method: GET - endpoint_url: /orgs/{org}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization - summary: Get a webhook configuration for an organization + - 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 - go_methods: - - OrganizationsService.GetHookConfiguration - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization - summary: Update a webhook configuration for an organization + - 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 - go_methods: - - OrganizationsService.EditHookConfiguration - - openapi: - method: GET - endpoint_url: /orgs/{org}/hooks/{hook_id}/deliveries - documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook - summary: List deliveries for an organization webhook + - 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 - go_methods: - - OrganizationsService.ListHookDeliveries - - openapi: - method: GET - endpoint_url: /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 - summary: Get a webhook delivery for an organization webhook + - 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 - go_methods: - - OrganizationsService.GetHookDelivery - - openapi: - method: POST - endpoint_url: /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 - summary: Redeliver a delivery for an organization webhook + - 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 - go_methods: - - OrganizationsService.RedeliverHookDelivery - - openapi: - method: POST - endpoint_url: /orgs/{org}/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook - summary: Ping an organization webhook + - 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 - go_methods: - - OrganizationsService.PingHook - - openapi: - method: GET - endpoint_url: /orgs/{org}/installation - documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app - summary: Get an organization installation for the authenticated app + - 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 - go_methods: - - AppsService.FindOrganizationInstallation - - openapi: - method: GET - endpoint_url: /orgs/{org}/installations - documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization - summary: List app installations for an organization + - 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 - go_methods: - - OrganizationsService.ListInstallations - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization - summary: Remove interaction restrictions for an organization + - name: DELETE /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.RemoveRestrictionsFromOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization - summary: Get interaction restrictions for an organization + - name: GET /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.GetRestrictionsForOrg - - openapi: - method: PUT - endpoint_url: /orgs/{org}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization - summary: Set interaction restrictions for an organization + - name: PUT /orgs/{org}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.UpdateRestrictionsForOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/invitations - documentation_url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations - summary: List pending organization invitations + - name: GET /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.ListPendingOrgInvitations - - openapi: - method: POST - endpoint_url: /orgs/{org}/invitations - documentation_url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation - summary: Create an organization invitation + - name: POST /orgs/{org}/invitations + documentation_url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.CreateOrgInvitation - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/invitations/{invitation_id} - documentation_url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation - summary: Cancel an organization invitation + - name: DELETE /orgs/{org}/invitations/{invitation_id} + documentation_url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/invitations/{invitation_id}/teams - documentation_url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams - summary: List organization invitation teams + - name: GET /orgs/{org}/invitations/{invitation_id}/teams + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.ListOrgInvitationTeams - - openapi: - method: GET - endpoint_url: /orgs/{org}/issues - documentation_url: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user - summary: List organization issues assigned to the authenticated user + - name: GET /orgs/{org}/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-organization-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 - go_methods: - - IssuesService.ListByOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/members - documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members - summary: List organization members + - 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 - go_methods: - - OrganizationsService.ListMembers - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/members/{username} - documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member - summary: Remove an organization member + - 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 - go_methods: - - OrganizationsService.RemoveMember - - openapi: - method: GET - endpoint_url: /orgs/{org}/members/{username} - documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user - summary: Check organization membership for a user + - 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 - go_methods: - - OrganizationsService.IsMember - - openapi: - method: GET - endpoint_url: /orgs/{org}/members/{username}/codespaces - documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization - summary: List codespaces for a user in organization + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/members/{username}/codespaces/{codespace_name} - documentation_url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization - summary: Delete a codespace from the organization + - name: DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop - documentation_url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user - summary: Stop a codespace for an organization user + - name: POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get Copilot for Business seat assignment details for a user + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/memberships/{username} - documentation_url: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user - summary: Remove organization membership for a user + - name: DELETE /orgs/{org}/memberships/{username} + documentation_url: https://docs.github.com/rest/orgs/members#remove-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 - go_methods: - - OrganizationsService.RemoveOrgMembership - - openapi: - method: GET - endpoint_url: /orgs/{org}/memberships/{username} - documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user - summary: Get organization membership for a user + - 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 - go_methods: - - OrganizationsService.GetOrgMembership - - openapi: - method: PUT - endpoint_url: /orgs/{org}/memberships/{username} - documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user - summary: Set organization membership for a user + - 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 - go_methods: - - OrganizationsService.EditOrgMembership - - openapi: - method: GET - endpoint_url: /orgs/{org}/migrations - documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations - summary: List organization migrations + - 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 - go_methods: - - MigrationService.ListMigrations - - openapi: - method: POST - endpoint_url: /orgs/{org}/migrations - documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration - summary: Start an organization migration + - 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 - go_methods: - - MigrationService.StartMigration - - openapi: - method: GET - endpoint_url: /orgs/{org}/migrations/{migration_id} - documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status - summary: Get an organization migration status + - 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 - go_methods: - - MigrationService.MigrationStatus - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/migrations/{migration_id}/archive - documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive - summary: Delete an organization migration archive + - 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 - go_methods: - - MigrationService.DeleteMigration - - openapi: - method: GET - endpoint_url: /orgs/{org}/migrations/{migration_id}/archive - documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive - summary: Download an organization migration archive + - 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 - go_methods: - - MigrationService.MigrationArchiveURL - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock - documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository - summary: Unlock an organization repository + - 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 - go_methods: - - MigrationService.UnlockRepo - - openapi: - method: GET - endpoint_url: /orgs/{org}/migrations/{migration_id}/repositories - documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration - summary: List repositories in an organization migration + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/outside_collaborators - documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization - summary: List outside collaborators for an organization + - 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 - go_methods: - - OrganizationsService.ListOutsideCollaborators - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/outside_collaborators/{username} - documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization - summary: Remove outside collaborator from an organization + - 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 - go_methods: - - OrganizationsService.RemoveOutsideCollaborator - - openapi: - method: PUT - endpoint_url: /orgs/{org}/outside_collaborators/{username} - documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator - summary: Convert an organization member to outside collaborator + - 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 - go_methods: - - OrganizationsService.ConvertMemberToOutsideCollaborator - - openapi: - method: GET - endpoint_url: /orgs/{org}/packages - documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization - summary: List packages for an organization + - 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 - go_methods: - - OrganizationsService.ListPackages - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization - summary: Delete a package for an organization + - 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 - go_methods: - - OrganizationsService.DeletePackage - - openapi: - method: GET - endpoint_url: /orgs/{org}/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization - summary: Get a package for an organization + - 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 - go_methods: - - OrganizationsService.GetPackage - - openapi: - method: POST - endpoint_url: /orgs/{org}/packages/{package_type}/{package_name}/restore - documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization - summary: Restore a package for an organization + - 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 - go_methods: - - OrganizationsService.RestorePackage - - openapi: - method: GET - endpoint_url: /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 - summary: List package versions for a package owned by an organization + - 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 - go_methods: - - OrganizationsService.PackageGetAllVersions - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete package version for an organization + - 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 - go_methods: - - OrganizationsService.PackageDeleteVersion - - openapi: - method: GET - endpoint_url: /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 - summary: Get a package version for an organization + - 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 - go_methods: - - OrganizationsService.PackageGetVersion - - openapi: - method: POST - endpoint_url: /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 - summary: Restore package version for an organization + - 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 - go_methods: - - OrganizationsService.PackageRestoreVersion - - openapi: - method: GET - endpoint_url: /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 - summary: List requests to access organization resources with fine-grained personal access tokens + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Review requests to access organization resources with fine-grained personal access tokens + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Review a request to access organization resources with a fine-grained personal access token + - 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 - go_methods: - - OrganizationsService.ReviewPersonalAccessTokenRequest - - openapi: - method: GET - endpoint_url: /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 - summary: List repositories requested to be accessed by a fine-grained personal access token + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List fine-grained personal access tokens with access to organization resources + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Update the access to organization resources via fine-grained personal access tokens + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Update the access a fine-grained personal access token has to organization resources + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List repositories a fine-grained personal access token has access to + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List pre-receive hooks for an organization + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove pre-receive hook enforcement for an organization + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get a pre-receive hook for an organization + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update pre-receive hook enforcement for an organization + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/projects - documentation_url: https://docs.github.com/rest/projects/projects#list-organization-projects - summary: List organization projects + - 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 - go_methods: - - OrganizationsService.ListProjects - - openapi: - method: POST - endpoint_url: /orgs/{org}/projects - documentation_url: https://docs.github.com/rest/projects/projects#create-an-organization-project - summary: Create an organization project + - 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 - go_methods: - - OrganizationsService.CreateProject - - openapi: - method: GET - endpoint_url: /orgs/{org}/public_members - documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members - summary: List public organization members + - name: GET /orgs/{org}/properties/schema + documentation_url: https://docs.github.com/rest/orgs/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 + 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 + 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 + 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 + 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 + 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 + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /orgs/{org}/public_members + documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - OrganizationsService.ListMembers - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/public_members/{username} - documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user - summary: Remove public organization membership for the authenticated user + - 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 - go_methods: - - OrganizationsService.ConcealMembership - - openapi: - method: GET - endpoint_url: /orgs/{org}/public_members/{username} - documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user - summary: Check public organization membership for a user + - 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 - go_methods: - - OrganizationsService.IsPublicMember - - openapi: - method: PUT - endpoint_url: /orgs/{org}/public_members/{username} - documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user - summary: Set public organization membership for the authenticated user + - 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 - go_methods: - - OrganizationsService.PublicizeMembership - - openapi: - method: GET - endpoint_url: /orgs/{org}/repos - documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories - summary: List organization repositories + - 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 - go_methods: - - RepositoriesService.ListByOrg - - openapi: - method: POST - endpoint_url: /orgs/{org}/repos - documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository - summary: Create an organization repository + - 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 - go_methods: - - RepositoriesService.Create - - openapi: - method: GET - endpoint_url: /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 - summary: List repository fine-grained permissions for an organization + - 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 - - openapi: - method: GET - endpoint_url: /orgs/{org}/rulesets - documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets - summary: Get all organization repository rulesets + - 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 - go_methods: - - OrganizationsService.GetAllOrganizationRulesets - - openapi: - method: POST - endpoint_url: /orgs/{org}/rulesets - documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset - summary: Create an organization repository ruleset + - 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 - go_methods: - - OrganizationsService.CreateOrganizationRuleset - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset - summary: Delete an organization repository ruleset + - name: GET /orgs/{org}/rulesets/rule-suites + documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.DeleteOrganizationRuleset - - openapi: - method: GET - endpoint_url: /orgs/{org}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset - summary: Get an organization repository ruleset + - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id} + documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.GetOrganizationRuleset - - openapi: - method: PUT - endpoint_url: /orgs/{org}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset - summary: Update an organization repository ruleset + - name: DELETE /orgs/{org}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - OrganizationsService.UpdateOrganizationRuleset - - openapi: - method: GET - endpoint_url: /orgs/{org}/secret-scanning/alerts - documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization - summary: List secret scanning alerts for an organization + - 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 + - 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 + - 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 - go_methods: - - SecretScanningService.ListAlertsForOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/security-advisories - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization - summary: List repository security advisories for an organization + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /orgs/{org}/security-managers - documentation_url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams - summary: List security manager teams + - name: GET /orgs/{org}/security-managers + documentation_url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - OrganizationsService.ListSecurityManagerTeams - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/security-managers/teams/{team_slug} - documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team - summary: Remove a security manager team + - 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 - go_methods: - - OrganizationsService.RemoveSecurityManagerTeam - - openapi: - method: PUT - endpoint_url: /orgs/{org}/security-managers/teams/{team_slug} - documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team - summary: Add a security manager team + - 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 - go_methods: - - OrganizationsService.AddSecurityManagerTeam - - openapi: - method: GET - endpoint_url: /orgs/{org}/settings/billing/actions - documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization - summary: Get GitHub Actions billing for an organization + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetActionsBillingOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/settings/billing/advanced-security - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization - summary: Get GitHub Advanced Security active committers for an organization + - name: GET /orgs/{org}/settings/billing/advanced-security + 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 - go_methods: - - BillingService.GetAdvancedSecurityActiveCommittersOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/settings/billing/packages - documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization - summary: Get GitHub Packages billing for an organization + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetPackagesBillingOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/settings/billing/shared-storage - documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization - summary: Get shared storage billing for an organization + - name: GET /orgs/{org}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetStorageBillingOrg - - openapi: - method: GET - endpoint_url: /orgs/{org}/team-sync/groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization - summary: List IdP groups for an organization + - name: GET /orgs/{org}/team-sync/groups + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization openapi_files: - descriptions/ghec/ghec.json - go_methods: - - TeamsService.ListIDPGroupsInOrganization - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams - documentation_url: https://docs.github.com/rest/teams/teams#list-teams - summary: List teams + - name: GET /orgs/{org}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - TeamsService.ListTeams - - openapi: - method: POST - endpoint_url: /orgs/{org}/teams - documentation_url: https://docs.github.com/rest/teams/teams#create-a-team - summary: Create a team + - 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 - go_methods: - - TeamsService.CreateTeam - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug} - documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team - summary: Delete a team + - 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 - go_methods: - - TeamsService.DeleteTeamByID - - TeamsService.DeleteTeamBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug} - documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name - summary: Get a team by name + - 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 - go_methods: - - TeamsService.GetTeamByID - - TeamsService.GetTeamBySlug - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/teams/{team_slug} - documentation_url: https://docs.github.com/rest/teams/teams#update-a-team - summary: Update a team + - 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 - go_methods: - - TeamsService.EditTeamByID - - TeamsService.EditTeamBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions - documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions - summary: List discussions + - 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 - go_methods: - - TeamsService.ListDiscussionsByID - - TeamsService.ListDiscussionsBySlug - - openapi: - method: POST - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions - documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion - summary: Create a discussion + - 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 - go_methods: - - TeamsService.CreateDiscussionByID - - TeamsService.CreateDiscussionBySlug - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion - summary: Delete a discussion + - 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 - go_methods: - - TeamsService.DeleteDiscussionByID - - TeamsService.DeleteDiscussionBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion - summary: Get a discussion + - 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 - go_methods: - - TeamsService.GetDiscussionByID - - TeamsService.GetDiscussionBySlug - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion - summary: Update a discussion + - 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 - go_methods: - - TeamsService.EditDiscussionByID - - TeamsService.EditDiscussionBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments - summary: List discussion comments + - 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 - go_methods: - - TeamsService.ListCommentsByID - - TeamsService.ListCommentsBySlug - - openapi: - method: POST - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment - summary: Create a discussion comment + - 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 - go_methods: - - TeamsService.CreateCommentByID - - TeamsService.CreateCommentBySlug - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a discussion comment + - 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 - go_methods: - - TeamsService.DeleteCommentByID - - TeamsService.DeleteCommentBySlug - - openapi: - method: GET - endpoint_url: /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 - summary: Get a discussion comment + - 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 - go_methods: - - TeamsService.GetCommentByID - - TeamsService.GetCommentBySlug - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a discussion comment + - 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 - go_methods: - - TeamsService.EditCommentByID - - TeamsService.EditCommentBySlug - - openapi: - method: GET - endpoint_url: /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 - summary: List reactions for a team discussion comment + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Create reaction for a team discussion comment + - 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 - go_methods: - - ReactionsService.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete team discussion comment reaction + - 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 - go_methods: - - ReactionsService.DeleteTeamDiscussionCommentReaction - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion - summary: List reactions for a team discussion + - 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 - - openapi: - method: POST - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion - summary: Create reaction for a team discussion + - 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 - go_methods: - - ReactionsService.DeleteTeamDiscussionReactionByOrgIDAndTeamID - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} - documentation_url: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction - summary: Delete team discussion reaction + - 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 - go_methods: - - ReactionsService.DeleteTeamDiscussionReaction - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove the connection between an external group and a team + - 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 - go_methods: - - TeamsService.RemoveConnectedExternalGroup - - openapi: - method: GET - endpoint_url: /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 - summary: List a connection between an external group and a team + - 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 - go_methods: - - TeamsService.ListExternalGroupsForTeamBySlug - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update the connection between an external group and a team + - 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 - go_methods: - - TeamsService.UpdateConnectedExternalGroup - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/invitations - documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations - summary: List pending team invitations + - name: GET /orgs/{org}/teams/{team_slug}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - TeamsService.ListPendingTeamInvitationsByID - - TeamsService.ListPendingTeamInvitationsBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/members - documentation_url: https://docs.github.com/rest/teams/members#list-team-members - summary: List team members + - name: GET /orgs/{org}/teams/{team_slug}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - TeamsService.GetTeamMembershipByID - - TeamsService.ListTeamMembersByID - - TeamsService.ListTeamMembersBySlug - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user - summary: Remove team membership for a user + - 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 - go_methods: - - TeamsService.RemoveTeamMembershipByID - - TeamsService.RemoveTeamMembershipBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user - summary: Get team membership for a user + - 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 - go_methods: - - TeamsService.GetTeamMembershipBySlug - - openapi: - method: PUT - endpoint_url: /orgs/{org}/teams/{team_slug}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user - summary: Add or update team membership for a user + - 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 - go_methods: - - TeamsService.AddTeamMembershipByID - - TeamsService.AddTeamMembershipBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/projects - documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects - summary: List team projects + - 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 - go_methods: - - TeamsService.ListTeamProjectsByID - - TeamsService.ListTeamProjectsBySlug - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team - summary: Remove a project from a team + - 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 - go_methods: - - TeamsService.RemoveTeamProjectByID - - TeamsService.RemoveTeamProjectBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project - summary: Check team permissions for a project + - 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 - go_methods: - - TeamsService.ReviewTeamProjectsByID - - TeamsService.ReviewTeamProjectsBySlug - - openapi: - method: PUT - endpoint_url: /orgs/{org}/teams/{team_slug}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions - summary: Add or update team project permissions + - 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 - go_methods: - - TeamsService.AddTeamProjectByID - - TeamsService.AddTeamProjectBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/repos - documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories - summary: List team repositories + - 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 - go_methods: - - TeamsService.ListTeamReposByID - - TeamsService.ListTeamReposBySlug - - openapi: - method: DELETE - endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team - summary: Remove a repository from a team + - 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 - go_methods: - - TeamsService.RemoveTeamRepoByID - - TeamsService.RemoveTeamRepoBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository - summary: Check team permissions for a repository + - 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 - go_methods: - - TeamsService.IsTeamRepoByID - - TeamsService.IsTeamRepoBySlug - - openapi: - method: PUT - endpoint_url: /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions - summary: Add or update team repository permissions + - 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 - go_methods: - - TeamsService.AddTeamRepoByID - - TeamsService.AddTeamRepoBySlug - - openapi: - method: GET - endpoint_url: /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 - summary: List IdP groups for a team + - 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: - descriptions/ghec/ghec.json - go_methods: - - TeamsService.ListIDPGroupsForTeamByID - - TeamsService.ListIDPGroupsForTeamBySlug - - openapi: - method: PATCH - endpoint_url: /orgs/{org}/teams/{team_slug}/team-sync/group-mappings - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections - summary: Create or update IdP group connections + - name: PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections openapi_files: - descriptions/ghec/ghec.json - go_methods: - - TeamsService.CreateOrUpdateIDPGroupConnectionsByID - - TeamsService.CreateOrUpdateIDPGroupConnectionsBySlug - - openapi: - method: GET - endpoint_url: /orgs/{org}/teams/{team_slug}/teams - documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams - summary: List child teams + - name: GET /orgs/{org}/teams/{team_slug}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - TeamsService.ListChildTeamsByParentID - - TeamsService.ListChildTeamsByParentSlug - - openapi: - method: POST - endpoint_url: /orgs/{org}/{security_product}/{enablement} - documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization - summary: Enable or disable a security feature for an organization + - 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 - - openapi: - method: DELETE - endpoint_url: /projects/columns/cards/{card_id} - documentation_url: https://docs.github.com/rest/projects/cards#delete-a-project-card - summary: Delete a project card + - 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 - go_methods: - - ProjectsService.DeleteProjectCard - - openapi: - method: GET - endpoint_url: /projects/columns/cards/{card_id} - documentation_url: https://docs.github.com/rest/projects/cards#get-a-project-card - summary: Get a project card + - 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 - go_methods: - - ProjectsService.GetProjectCard - - openapi: - method: PATCH - endpoint_url: /projects/columns/cards/{card_id} - documentation_url: https://docs.github.com/rest/projects/cards#update-an-existing-project-card - summary: Update an existing project card + - 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 - go_methods: - - ProjectsService.UpdateProjectCard - - openapi: - method: POST - endpoint_url: /projects/columns/cards/{card_id}/moves - documentation_url: https://docs.github.com/rest/projects/cards#move-a-project-card - summary: Move a project card + - 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 - go_methods: - - ProjectsService.MoveProjectCard - - openapi: - method: DELETE - endpoint_url: /projects/columns/{column_id} - documentation_url: https://docs.github.com/rest/projects/columns#delete-a-project-column - summary: Delete a project column + - 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 - go_methods: - - ProjectsService.DeleteProjectColumn - - openapi: - method: GET - endpoint_url: /projects/columns/{column_id} - documentation_url: https://docs.github.com/rest/projects/columns#get-a-project-column - summary: Get a project column + - 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 - go_methods: - - ProjectsService.GetProjectColumn - - openapi: - method: PATCH - endpoint_url: /projects/columns/{column_id} - documentation_url: https://docs.github.com/rest/projects/columns#update-an-existing-project-column - summary: Update an existing project column + - 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 - go_methods: - - ProjectsService.UpdateProjectColumn - - openapi: - method: GET - endpoint_url: /projects/columns/{column_id}/cards - documentation_url: https://docs.github.com/rest/projects/cards#list-project-cards - summary: List project cards + - 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 - go_methods: - - ProjectsService.ListProjectCards - - openapi: - method: POST - endpoint_url: /projects/columns/{column_id}/cards - documentation_url: https://docs.github.com/rest/projects/cards#create-a-project-card - summary: Create a project card + - 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 - go_methods: - - ProjectsService.CreateProjectCard - - openapi: - method: POST - endpoint_url: /projects/columns/{column_id}/moves - documentation_url: https://docs.github.com/rest/projects/columns#move-a-project-column - summary: Move a project column + - 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 - go_methods: - - ProjectsService.MoveProjectColumn - - openapi: - method: DELETE - endpoint_url: /projects/{project_id} - documentation_url: https://docs.github.com/rest/projects/projects#delete-a-project - summary: Delete a project + - 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 - go_methods: - - ProjectsService.DeleteProject - - openapi: - method: GET - endpoint_url: /projects/{project_id} - documentation_url: https://docs.github.com/rest/projects/projects#get-a-project - summary: Get a project + - 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 - go_methods: - - ProjectsService.GetProject - - openapi: - method: PATCH - endpoint_url: /projects/{project_id} - documentation_url: https://docs.github.com/rest/projects/projects#update-a-project - summary: Update a project + - 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 - go_methods: - - ProjectsService.UpdateProject - - openapi: - method: GET - endpoint_url: /projects/{project_id}/collaborators - documentation_url: https://docs.github.com/rest/projects/collaborators#list-project-collaborators - summary: List project collaborators + - 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 - go_methods: - - ProjectsService.ListProjectCollaborators - - openapi: - method: DELETE - endpoint_url: /projects/{project_id}/collaborators/{username} - documentation_url: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator - summary: Remove user as a collaborator + - 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 - go_methods: - - ProjectsService.RemoveProjectCollaborator - - openapi: - method: PUT - endpoint_url: /projects/{project_id}/collaborators/{username} - documentation_url: https://docs.github.com/rest/projects/collaborators#add-project-collaborator - summary: Add project collaborator + - 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 - go_methods: - - ProjectsService.AddProjectCollaborator - - openapi: - method: GET - endpoint_url: /projects/{project_id}/collaborators/{username}/permission - documentation_url: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user - summary: Get project permission for a user + - 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 - go_methods: - - ProjectsService.ReviewProjectCollaboratorPermission - - openapi: - method: GET - endpoint_url: /projects/{project_id}/columns - documentation_url: https://docs.github.com/rest/projects/columns#list-project-columns - summary: List project columns + - 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 - go_methods: - - ProjectsService.ListProjectColumns - - openapi: - method: POST - endpoint_url: /projects/{project_id}/columns - documentation_url: https://docs.github.com/rest/projects/columns#create-a-project-column - summary: Create a project column + - 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 - go_methods: - - ProjectsService.CreateProjectColumn - - openapi: - method: GET - endpoint_url: /rate_limit - documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user - summary: Get rate limit status for the authenticated user + - 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 - - openapi: - method: DELETE - endpoint_url: /reactions/{reaction_id} - documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy - summary: Delete a reaction (Legacy) + - name: DELETE /reactions/{reaction_id} + documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy openapi_files: - descriptions/ghes-3.4/ghes-3.4.json - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/repos/repos#delete-a-repository - summary: Delete a repository + - name: DELETE /repos/{owner}/{repo} + documentation_url: https://docs.github.com/rest/repos/repos#delete-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.Delete - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository - summary: Get a repository + - 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 - go_methods: - - RepositoriesService.Get - - RepositoriesService.GetCodeOfConduct - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository - summary: Update a repository + - 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 - go_methods: - - RepositoriesService.Edit - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/artifacts - documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository - summary: List artifacts for a repository + - 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 - go_methods: - - ActionsService.ListArtifacts - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id} - documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact - summary: Delete an artifact + - 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 - go_methods: - - ActionsService.DeleteArtifact - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id} - documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact - summary: Get an artifact + - 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 - go_methods: - - ActionsService.GetArtifact - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} - documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact - summary: Download an artifact + - 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 - go_methods: - - ActionsService.DownloadArtifact - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/cache/usage - documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository - summary: Get GitHub Actions cache usage for a repository + - 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 - go_methods: - - ActionsService.GetCacheUsageForRepo - - openapi: - method: GET - endpoint_url: /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 - summary: Get GitHub Actions cache usage policy for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /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 - summary: Set GitHub Actions cache usage policy for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete GitHub Actions caches for a repository (using a cache key) + - 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 - go_methods: - - ActionsService.DeleteCachesByKey - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/caches - documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository - summary: List GitHub Actions caches for a repository + - 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 - go_methods: - - ActionsService.ListCaches - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a GitHub Actions cache for a repository (using a cache ID) + - 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 - go_methods: - - ActionsService.DeleteCachesByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/jobs/{job_id} - documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run - summary: Get a job for a workflow run + - 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 - go_methods: - - ActionsService.GetWorkflowJobByID - - openapi: - method: GET - endpoint_url: /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 - summary: Download job logs for a workflow run + - 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 - go_methods: - - ActionsService.GetWorkflowJobLogs - - openapi: - method: POST - endpoint_url: /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 - summary: Re-run a job from a workflow run + - 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 - go_methods: - - ActionsService.RerunJobByID - - openapi: - method: GET - endpoint_url: /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 - summary: Get the customization template for an OIDC subject claim for a repository + - 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 - go_methods: - - ActionsService.GetRepoOIDCSubjectClaimCustomTemplate - - openapi: - method: PUT - endpoint_url: /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 - summary: Set the customization template for an OIDC subject claim for a repository + - 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 - go_methods: - - ActionsService.SetRepoOIDCSubjectClaimCustomTemplate - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/organization-secrets - documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets - summary: List repository organization secrets + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/organization-variables - documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables - summary: List repository organization variables + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/permissions - documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository - summary: Get GitHub Actions permissions for a repository + - 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 - go_methods: - - RepositoriesService.GetActionsPermissions - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/actions/permissions - documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository - summary: Set GitHub Actions permissions for a repository + - 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 - go_methods: - - RepositoriesService.EditActionsPermissions - - openapi: - method: GET - endpoint_url: /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 - summary: Get the level of access for workflows outside of the repository + - 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 - go_methods: - - RepositoriesService.GetActionsAccessLevel - - openapi: - method: PUT - endpoint_url: /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 - summary: Set the level of access for workflows outside of the repository + - 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 - go_methods: - - RepositoriesService.EditActionsAccessLevel - - openapi: - method: GET - endpoint_url: /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 - summary: Get allowed actions and reusable workflows for a repository + - 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 - go_methods: - - RepositoriesService.GetActionsAllowed - - openapi: - method: PUT - endpoint_url: /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 - summary: Set allowed actions and reusable workflows for a repository + - 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 - go_methods: - - RepositoriesService.EditActionsAllowed - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/permissions/workflow - documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository - summary: Get default workflow permissions for a repository + - 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 - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/actions/permissions/workflow - documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository - summary: Set default workflow permissions for a repository + - 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 - - override: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/required_workflows - documentation_url: https://docs.github.com/actions/using-workflows/required-workflows - go_methods: - - ActionsService.ListRepoRequiredWorkflows - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runners - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository - summary: List self-hosted runners for a repository + - 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 - go_methods: - - ActionsService.ListRunners - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runners/downloads - documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository - summary: List runner applications for a repository + - 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 - go_methods: - - ActionsService.ListRunnerApplicationDownloads - - openapi: - method: POST - endpoint_url: /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 - summary: Create configuration for a just-in-time runner for a repository + - 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 - go_methods: - - ActionsService.GenerateRepoJITConfig - - openapi: - method: POST - endpoint_url: /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 - summary: Create a registration token for a repository + - 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 - go_methods: - - ActionsService.CreateRegistrationToken - - openapi: - method: POST - endpoint_url: /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 - summary: Create a remove token for a repository + - 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 - go_methods: - - ActionsService.CreateRemoveToken - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a self-hosted runner from a repository + - 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 - go_methods: - - ActionsService.RemoveRunner - - openapi: - method: GET - endpoint_url: /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 - summary: Get a self-hosted runner for a repository + - 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 - go_methods: - - ActionsService.GetRunner - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove all custom labels from a self-hosted runner for a repository + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List labels for a self-hosted runner for a repository + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Add custom labels to a self-hosted runner for a repository + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set custom labels for a self-hosted runner for a repository + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove a custom label from a self-hosted runner for a repository + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs - documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository - summary: List workflow runs for a repository + - 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 - go_methods: - - ActionsService.ListRepositoryWorkflowRuns - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id} - documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run - summary: Delete a workflow run + - 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 - go_methods: - - ActionsService.DeleteWorkflowRun - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id} - documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run - summary: Get a workflow run + - 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 - go_methods: - - ActionsService.GetWorkflowRunByID - - openapi: - method: GET - endpoint_url: /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 - summary: Get the review history for a workflow run + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Approve a workflow run for a fork pull request + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts - documentation_url: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts - summary: List workflow run artifacts + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + documentation_url: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActionsService.ListWorkflowRunArtifacts - - openapi: - method: GET - endpoint_url: /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 - summary: Get a workflow run attempt + - 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 - go_methods: - - ActionsService.GetWorkflowRunAttempt - - openapi: - method: GET - endpoint_url: /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 - summary: List jobs for a workflow run attempt + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Download workflow run attempt logs + - 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 - go_methods: - - ActionsService.GetWorkflowRunAttemptLogs - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/cancel - documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run - summary: Cancel a workflow run + - 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 - go_methods: - - ActionsService.CancelWorkflowRunByID - - openapi: - method: POST - endpoint_url: /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 - summary: Review custom deployment protection rules for a workflow run + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/jobs - documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run - summary: List jobs for a workflow run + - 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: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs + documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-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 - go_methods: - - ActionsService.ListWorkflowJobs - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/logs - documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs - summary: Delete workflow run logs + - 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 - go_methods: - - ActionsService.DeleteWorkflowRunLogs - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/logs - documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs - summary: Download workflow run logs + - 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 - go_methods: - - ActionsService.GetWorkflowRunLogs - - openapi: - method: GET - endpoint_url: /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 - summary: Get pending deployments for a workflow run + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Review pending deployments for a workflow run + - 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 - go_methods: - - ActionsService.PendingDeployments - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/rerun - documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow - summary: Re-run a workflow + - 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 - go_methods: - - ActionsService.RerunWorkflowByID - - openapi: - method: POST - endpoint_url: /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 - summary: Re-run failed jobs from a workflow run + - 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 - go_methods: - - ActionsService.RerunFailedJobsByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/runs/{run_id}/timing - documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage - summary: Get workflow run usage + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - ActionsService.GetWorkflowRunUsageByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/secrets - documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-secrets - summary: List repository secrets + - name: GET /repos/{owner}/{repo}/actions/secrets + documentation_url: https://docs.github.com/rest/actions/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 - go_methods: - - ActionsService.ListRepoSecrets - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/secrets/public-key - documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key - summary: Get a repository public key + - 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 - go_methods: - - ActionsService.GetRepoPublicKey - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret - summary: Delete a repository secret + - 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 - go_methods: - - ActionsService.DeleteRepoSecret - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret - summary: Get a repository secret + - 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 - go_methods: - - ActionsService.GetRepoSecret - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/actions/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret - summary: Create or update a repository secret + - 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 - go_methods: - - ActionsService.CreateOrUpdateRepoSecret - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/variables - documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables - summary: List repository variables + - 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 - go_methods: - - ActionsService.ListRepoVariables - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/actions/variables - documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable - summary: Create a repository variable + - 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 - go_methods: - - ActionsService.CreateRepoVariable - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable - summary: Delete a repository variable + - 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 - go_methods: - - ActionsService.DeleteRepoVariable - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable - summary: Get a repository variable + - 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 - go_methods: - - ActionsService.GetRepoVariable - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/actions/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable - summary: Update a repository variable + - 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 - go_methods: - - ActionsService.UpdateRepoVariable - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/workflows - documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows - summary: List repository workflows + - 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 - go_methods: - - ActionsService.ListWorkflows - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id} - documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow - summary: Get a workflow + - 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 - go_methods: - - ActionsService.GetWorkflowByFileName - - ActionsService.GetWorkflowByID - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable - documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow - summary: Disable a workflow + - 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 - go_methods: - - ActionsService.DisableWorkflowByFileName - - ActionsService.DisableWorkflowByID - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches - documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event - summary: Create a workflow dispatch event + - 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 - go_methods: - - ActionsService.CreateWorkflowDispatchEventByFileName - - ActionsService.CreateWorkflowDispatchEventByID - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable - documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow - summary: Enable a workflow + - 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 - go_methods: - - ActionsService.EnableWorkflowByFileName - - ActionsService.EnableWorkflowByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs - documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow - summary: List workflow runs for a workflow + - 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 - go_methods: - - ActionsService.ListWorkflowRunsByFileName - - ActionsService.ListWorkflowRunsByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing - documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage - summary: Get workflow usage + - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - ActionsService.GetWorkflowUsageByFileName - - ActionsService.GetWorkflowUsageByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/activity - documentation_url: https://docs.github.com/rest/repos/repos#list-repository-activities - summary: List repository activities + - name: GET /repos/{owner}/{repo}/activity + documentation_url: https://docs.github.com/rest/repos/repos#list-repository-activities openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/assignees - documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees - summary: List assignees + - 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 - go_methods: - - IssuesService.ListAssignees - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/assignees/{assignee} - documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned - summary: Check if a user can be assigned + - 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 - go_methods: - - IssuesService.IsAssignee - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/autolinks - documentation_url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository - summary: List all autolinks of a repository + - 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 - go_methods: - - RepositoriesService.ListAutolinks - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/autolinks - documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository - summary: Create an autolink reference for a repository + - 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 - go_methods: - - RepositoriesService.AddAutolink - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/autolinks/{autolink_id} - documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository - summary: Delete an autolink reference from a repository + - 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 - go_methods: - - RepositoriesService.DeleteAutolink - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/autolinks/{autolink_id} - documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository - summary: Get an autolink reference of a repository + - 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 - go_methods: - - RepositoriesService.GetAutolink - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes - summary: Disable automated security fixes + - name: DELETE /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.DisableAutomatedSecurityFixes - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository - summary: Check if automated security fixes are enabled for a repository + - name: GET /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-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 - go_methods: - - RepositoriesService.GetAutomatedSecurityFixes - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/automated-security-fixes - documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes - summary: Enable automated security fixes + - name: PUT /repos/{owner}/{repo}/automated-security-fixes + documentation_url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.EnableAutomatedSecurityFixes - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches - documentation_url: https://docs.github.com/rest/branches/branches#list-branches - summary: List branches + - name: GET /repos/{owner}/{repo}/branches + documentation_url: https://docs.github.com/rest/branches/branches#list-branches openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListBranches - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch} - documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch - summary: Get a branch + - 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 - go_methods: - - RepositoriesService.GetBranch - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection - documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection - summary: Delete branch protection + - 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 - go_methods: - - RepositoriesService.RemoveBranchProtection - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection - documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection - summary: Get branch protection + - 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 - go_methods: - - RepositoriesService.GetBranchProtection - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection - documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection - summary: Update branch protection + - 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 - go_methods: - - RepositoriesService.UpdateBranchProtection - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection - summary: Delete admin branch protection + - 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 - go_methods: - - RepositoriesService.RemoveAdminEnforcement - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection - summary: Get admin branch protection + - 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 - go_methods: - - RepositoriesService.GetAdminEnforcement - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection - summary: Set admin branch protection + - 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 - go_methods: - - RepositoriesService.AddAdminEnforcement - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete pull request review protection + - 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 - go_methods: - - RepositoriesService.RemovePullRequestReviewEnforcement - - openapi: - method: GET - endpoint_url: /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 - summary: Get pull request review protection + - 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 - go_methods: - - RepositoriesService.GetPullRequestReviewEnforcement - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update pull request review protection + - 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 - go_methods: - - RepositoriesService.DisableDismissalRestrictions - - RepositoriesService.UpdatePullRequestReviewEnforcement - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection - summary: Delete commit signature protection + - 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 - go_methods: - - RepositoriesService.OptionalSignaturesOnProtectedBranch - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection - summary: Get commit signature protection + - 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 - go_methods: - - RepositoriesService.GetSignaturesProtectedBranch - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection - summary: Create commit signature protection + - 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 - go_methods: - - RepositoriesService.RequireSignaturesOnProtectedBranch - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection - summary: Remove status check protection + - 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 - go_methods: - - RepositoriesService.RemoveRequiredStatusChecks - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection - summary: Get status checks protection + - 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 - go_methods: - - RepositoriesService.GetRequiredStatusChecks - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection - summary: Update status check protection + - 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 - go_methods: - - RepositoriesService.UpdateRequiredStatusChecks - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts - documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts - summary: Remove status check contexts + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get all status check contexts + - 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 - go_methods: - - RepositoriesService.ListRequiredStatusChecksContexts - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts - documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts - summary: Add status check contexts + - 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 - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts - documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts - summary: Set status check contexts + - 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 - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions - documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions - summary: Delete access restrictions + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions - documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions - summary: Get access restrictions + - 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 - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions - summary: Remove app access restrictions + - 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 - go_methods: - - RepositoriesService.RemoveAppRestrictions - - openapi: - method: GET - endpoint_url: /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 - summary: Get apps with access to the protected branch + - 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 - go_methods: - - RepositoriesService.ListAppRestrictions - - RepositoriesService.ListApps - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions - summary: Add app access restrictions + - 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 - go_methods: - - RepositoriesService.AddAppRestrictions - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions - summary: Set app access restrictions + - 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 - go_methods: - - RepositoriesService.ReplaceAppRestrictions - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions - summary: Remove team access restrictions + - 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 - go_methods: - - RepositoriesService.RemoveTeamRestrictions - - openapi: - method: GET - endpoint_url: /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 - summary: Get teams with access to the protected branch + - 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 - go_methods: - - RepositoriesService.ListTeamRestrictions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions - summary: Add team access restrictions + - 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 - go_methods: - - RepositoriesService.AddTeamRestrictions - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions - summary: Set team access restrictions + - 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 - go_methods: - - RepositoriesService.ReplaceTeamRestrictions - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions - summary: Remove user access restrictions + - 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 - go_methods: - - RepositoriesService.RemoveUserRestrictions - - openapi: - method: GET - endpoint_url: /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 - summary: Get users with access to the protected branch + - 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 - go_methods: - - RepositoriesService.ListUserRestrictions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions - summary: Add user access restrictions + - 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 - go_methods: - - RepositoriesService.AddUserRestrictions - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions - summary: Set user access restrictions + - 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 - go_methods: - - RepositoriesService.ReplaceUserRestrictions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/branches/{branch}/rename - documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch - summary: Rename a branch + - 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 - go_methods: - - RepositoriesService.RenameBranch - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/check-runs - documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run - summary: Create a check run + - 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 - go_methods: - - ChecksService.CreateCheckRun - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id} - documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run - summary: Get a check run + - 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 - go_methods: - - ChecksService.GetCheckRun - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id} - documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run - summary: Update a check run + - 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 - go_methods: - - ChecksService.UpdateCheckRun - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations - documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations - summary: List check run annotations + - 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 - go_methods: - - ChecksService.ListCheckRunAnnotations - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest - documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run - summary: Rerequest a check run + - 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 - go_methods: - - ChecksService.ReRequestCheckRun - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/check-suites - documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite - summary: Create a check suite + - 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 - go_methods: - - ChecksService.CreateCheckSuite - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/check-suites/preferences - documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites - summary: Update repository preferences for check suites + - 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 - go_methods: - - ChecksService.SetCheckSuitePreferences - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/check-suites/{check_suite_id} - documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite - summary: Get a check suite + - 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 - go_methods: - - ChecksService.GetCheckSuite - - openapi: - method: GET - endpoint_url: /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 - summary: List check runs in a check suite + - 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 - go_methods: - - ChecksService.ListCheckRunsCheckSuite - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest - documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite - summary: Rerequest a check suite + - 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 - go_methods: - - ChecksService.ReRequestCheckSuite - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository - summary: List code scanning alerts for a repository + - 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 - go_methods: - - CodeScanningService.ListAlertsForRepo - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert - summary: Get a code scanning alert + - 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 - go_methods: - - CodeScanningService.GetAlert - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert - summary: Update a code scanning alert + - 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 - go_methods: - - CodeScanningService.UpdateAlert - - openapi: - method: GET - endpoint_url: /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 - summary: List instances of a code scanning alert + - 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 - go_methods: - - CodeScanningService.ListAlertInstances - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/analyses - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository - summary: List code scanning analyses for a repository + - 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 - go_methods: - - CodeScanningService.ListAnalysesForRepo - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a code scanning analysis from a repository + - 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 - go_methods: - - CodeScanningService.DeleteAnalysis - - openapi: - method: GET - endpoint_url: /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 - summary: Get a code scanning analysis for a repository + - 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 - go_methods: - - CodeScanningService.GetAnalysis - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/codeql/databases - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository - summary: List CodeQL databases for a repository + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodeScanningService.ListCodeQLDatabases - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository - summary: Get a CodeQL database for a repository + - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodeScanningService.GetCodeQLDatabase - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/code-scanning/default-setup - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration - summary: Get a code scanning default setup configuration + - name: GET /repos/{owner}/{repo}/code-scanning/default-setup + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-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 - go_methods: - - CodeScanningService.GetDefaultSetupConfiguration - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update a code scanning default setup configuration + - 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 - go_methods: - - CodeScanningService.UpdateDefaultSetupConfiguration - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/code-scanning/sarifs - documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data - summary: Upload an analysis as SARIF data + - 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 - go_methods: - - CodeScanningService.UploadSarif - - openapi: - method: GET - endpoint_url: /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 - summary: Get information about a SARIF upload + - 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 - go_methods: - - CodeScanningService.GetSARIF - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codeowners/errors - documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors - summary: List CODEOWNERS errors + - 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 - go_methods: - - RepositoriesService.GetCodeownersErrors - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces - documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user - summary: List codespaces in a repository for the authenticated user + - 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: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListInRepo - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/codespaces - documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository - summary: Create a codespace in a repository + - name: GET /repos/{owner}/{repo}/codespaces/devcontainers + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.CreateInRepo - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/devcontainers - documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user - summary: List devcontainer configurations in a repository for the authenticated user + - name: GET /repos/{owner}/{repo}/codespaces/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/machines - documentation_url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository - summary: List available machine types for a repository + - name: GET /repos/{owner}/{repo}/codespaces/new + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/new - documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace - summary: Get default attributes for a codespace + - name: GET /repos/{owner}/{repo}/codespaces/permissions_check + documentation_url: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/secrets - documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets - summary: List repository secrets + - name: GET /repos/{owner}/{repo}/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListRepoSecrets - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/public-key - documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key - summary: Get a repository public key + - name: GET /repos/{owner}/{repo}/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetRepoPublicKey - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret - summary: Delete a repository secret + - name: DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.DeleteRepoSecret - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret - summary: Get a repository secret + - name: GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetRepoSecret - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret - summary: Create or update a repository secret + - name: PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.CreateOrUpdateRepoSecret - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/collaborators - documentation_url: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators - summary: List repository collaborators + - name: GET /repos/{owner}/{repo}/collaborators + documentation_url: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListCollaborators - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/collaborators/{username} - documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator - summary: Remove a repository collaborator + - 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 - go_methods: - - RepositoriesService.RemoveCollaborator - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/collaborators/{username} - documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator - summary: Check if a user is a repository collaborator + - 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 - go_methods: - - RepositoriesService.IsCollaborator - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/collaborators/{username} - documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator - summary: Add a repository collaborator + - 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 - go_methods: - - RepositoriesService.AddCollaborator - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/collaborators/{username}/permission - documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user - summary: Get repository permissions for a user + - 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 - go_methods: - - RepositoriesService.GetPermissionLevel - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/comments - documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository - summary: List commit comments for a repository + - 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 - go_methods: - - RepositoriesService.ListComments - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment - summary: Delete a commit comment + - 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 - go_methods: - - RepositoriesService.DeleteComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment - summary: Get a commit comment + - 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 - go_methods: - - RepositoriesService.GetComment - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id} - documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment - summary: Update a commit comment + - 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 - go_methods: - - RepositoriesService.UpdateComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment - summary: List reactions for a commit comment + - 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 - go_methods: - - ReactionsService.ListCommentReactions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment - summary: Create reaction for a commit comment + - 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 - go_methods: - - ReactionsService.CreateCommentReaction - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} - documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction - summary: Delete a commit comment reaction + - 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 - go_methods: - - ReactionsService.DeleteCommentReaction - - ReactionsService.DeleteCommentReactionByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits - documentation_url: https://docs.github.com/rest/commits/commits#list-commits - summary: List commits + - 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 - go_methods: - - RepositoriesService.ListCommits - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head - documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit - summary: List branches for HEAD commit + - 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 - go_methods: - - RepositoriesService.ListBranchesHeadCommit - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/comments - documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments - summary: List commit comments + - 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 - go_methods: - - RepositoriesService.ListCommitComments - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/comments - documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment - summary: Create a commit comment + - 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 - go_methods: - - RepositoriesService.CreateComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{commit_sha}/pulls - documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit - summary: List pull requests associated with a commit + - 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 - go_methods: - - PullRequestsService.ListPullRequestsWithCommit - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{ref} - documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit - summary: Get a commit + - 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 - go_methods: - - RepositoriesService.GetCommit - - RepositoriesService.GetCommitRaw - - RepositoriesService.GetCommitSHA1 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{ref}/check-runs - documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference - summary: List check runs for a Git reference + - 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 - go_methods: - - ChecksService.ListCheckRunsForRef - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{ref}/check-suites - documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference - summary: List check suites for a Git reference + - 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 - go_methods: - - ChecksService.ListCheckSuitesForRef - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{ref}/status - documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference - summary: Get the combined status for a specific reference + - 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 - go_methods: - - RepositoriesService.GetCombinedStatus - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/commits/{ref}/statuses - documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference - summary: List commit statuses for a reference + - 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 - go_methods: - - RepositoriesService.ListStatuses - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/community/profile - documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics - summary: Get community profile metrics + - name: GET /repos/{owner}/{repo}/community/profile + documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.GetCommunityHealthMetrics - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/compare/{basehead} - documentation_url: https://docs.github.com/rest/commits/commits#compare-two-commits - summary: Compare two commits + - name: GET /repos/{owner}/{repo}/compare/{basehead} + documentation_url: https://docs.github.com/rest/commits/commits#compare-two-commits openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.CompareCommits - - RepositoriesService.CompareCommitsRaw - - openapi: - method: POST - endpoint_url: /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 - summary: Create a content attachment + - 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: - descriptions/ghes-3.3/ghes-3.3.json - go_methods: - - AppsService.CreateAttachment - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/contents/{path} - documentation_url: https://docs.github.com/rest/repos/contents#delete-a-file - summary: Delete a file + - name: DELETE /repos/{owner}/{repo}/contents/{path} + documentation_url: https://docs.github.com/rest/repos/contents#delete-a-file openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.DeleteFile - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/contents/{path} - documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content - summary: Get repository content + - 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 - go_methods: - - RepositoriesService.GetContents - - RepositoriesService.DownloadContents - - RepositoriesService.DownloadContentsWithMeta - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/contents/{path} - documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents - summary: Create or update file contents + - 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 - go_methods: - - RepositoriesService.CreateFile - - RepositoriesService.UpdateFile - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/contributors - documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors - summary: List repository contributors + - 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 - go_methods: - - RepositoriesService.ListContributors - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/dependabot/alerts - documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository - summary: List Dependabot alerts for a repository + - 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 - go_methods: - - DependabotService.ListRepoAlerts - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/dependabot/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert - summary: Get a Dependabot alert + - 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 - go_methods: - - DependabotService.GetRepoAlert - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/dependabot/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert - summary: Update a Dependabot alert + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/dependabot/secrets - documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets - summary: List repository secrets + - 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 - go_methods: - - DependabotService.ListRepoSecrets - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/public-key - documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key - summary: Get a repository public key + - 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 - go_methods: - - DependabotService.GetRepoPublicKey - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret - summary: Delete a repository secret + - 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 - go_methods: - - DependabotService.DeleteRepoSecret - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret - summary: Get a repository secret + - 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 - go_methods: - - DependabotService.GetRepoSecret - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret - summary: Create or update a repository secret + - 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 - go_methods: - - DependabotService.CreateOrUpdateRepoSecret - - openapi: - method: GET - endpoint_url: /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 - summary: Get a diff of the dependencies between commits + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Export a software bill of materials (SBOM) for a repository. + - 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 - go_methods: - - DependencyGraphService.GetSBOM - - openapi: - method: POST - endpoint_url: /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 - summary: Create a snapshot of dependencies for a repository + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/deployments - documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments - summary: List deployments + - 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 - go_methods: - - RepositoriesService.ListDeployments - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/deployments - documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment - summary: Create a deployment + - 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 - go_methods: - - RepositoriesService.CreateDeployment - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id} - documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment - summary: Delete a deployment + - 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 - go_methods: - - RepositoriesService.DeleteDeployment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id} - documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment - summary: Get a deployment + - 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 - go_methods: - - RepositoriesService.GetDeployment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses - documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses - summary: List deployment statuses + - 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 - go_methods: - - RepositoriesService.ListDeploymentStatuses - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses - documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status - summary: Create a deployment status + - 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 - go_methods: - - RepositoriesService.CreateDeploymentStatus - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} - documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status - summary: Get a deployment status + - 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 - go_methods: - - RepositoriesService.GetDeploymentStatus - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/dispatches - documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event - summary: Create a repository dispatch event + - 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 - go_methods: - - RepositoriesService.Dispatch - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/environments - documentation_url: https://docs.github.com/rest/deployments/environments#list-environments - summary: List environments + - 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 - go_methods: - - RepositoriesService.ListEnvironments - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} - documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment - summary: Delete an environment + - 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 - go_methods: - - RepositoriesService.DeleteEnvironment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} - documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment - summary: Get an environment + - 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 - go_methods: - - RepositoriesService.GetEnvironment - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/environments/{environment_name} - documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment - summary: Create or update an environment + - 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 - go_methods: - - RepositoriesService.CreateUpdateEnvironment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies - documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies - summary: List deployment branch policies + - 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 - go_methods: - - RepositoriesService.ListDeploymentBranchPolicies - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies - documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy - summary: Create a deployment branch policy + - 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 - go_methods: - - RepositoriesService.CreateDeploymentBranchPolicy - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a deployment branch policy + - 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 - go_methods: - - RepositoriesService.DeleteDeploymentBranchPolicy - - openapi: - method: GET - endpoint_url: /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 - summary: Get a deployment branch policy + - 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 - go_methods: - - RepositoriesService.GetDeploymentBranchPolicy - - openapi: - method: PUT - endpoint_url: /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 - summary: Update a deployment branch policy + - 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 - go_methods: - - RepositoriesService.UpdateDeploymentBranchPolicy - - openapi: - method: GET - endpoint_url: /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 - summary: Get all deployment protection rules for an environment + - 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 - - openapi: - method: POST - endpoint_url: /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 - summary: Create a custom deployment protection rule on an environment + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List custom deployment rule integrations available for an environment + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Disable a custom protection rule for an environment + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get a custom deployment protection rule + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/events - documentation_url: https://docs.github.com/rest/activity/events#list-repository-events - summary: List repository events + - 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 - go_methods: - - ActivityService.ListRepositoryEvents - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/forks - documentation_url: https://docs.github.com/rest/repos/forks#list-forks - summary: List forks + - 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 - go_methods: - - RepositoriesService.ListForks - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/forks - documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork - summary: Create a fork + - 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 - go_methods: - - RepositoriesService.CreateFork - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/git/blobs - documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob - summary: Create a blob + - 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 - go_methods: - - GitService.CreateBlob - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/blobs/{file_sha} - documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob - summary: Get a blob + - 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 - go_methods: - - GitService.GetBlob - - GitService.GetBlobRaw - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/git/commits - documentation_url: https://docs.github.com/rest/git/commits#create-a-commit - summary: Create a commit + - 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 - go_methods: - - GitService.CreateCommit - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/commits/{commit_sha} - documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object - summary: Get a commit object + - 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 - go_methods: - - GitService.GetCommit - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/matching-refs/{ref} - documentation_url: https://docs.github.com/rest/git/refs#list-matching-references - summary: List matching references + - 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 - go_methods: - - GitService.ListMatchingRefs - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/ref/{ref} - documentation_url: https://docs.github.com/rest/git/refs#get-a-reference - summary: Get a reference + - 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 - go_methods: - - GitService.GetRef - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/git/refs - documentation_url: https://docs.github.com/rest/git/refs#create-a-reference - summary: Create a reference + - 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 - go_methods: - - GitService.CreateRef - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/git/refs/{ref} - documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference - summary: Delete a reference + - 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 - go_methods: - - GitService.DeleteRef - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/git/refs/{ref} - documentation_url: https://docs.github.com/rest/git/refs#update-a-reference - summary: Update a reference + - 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 - go_methods: - - GitService.UpdateRef - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/git/tags - documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object - summary: Create a tag object + - 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 - go_methods: - - GitService.CreateTag - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/tags/{tag_sha} - documentation_url: https://docs.github.com/rest/git/tags#get-a-tag - summary: Get a tag + - 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 - go_methods: - - GitService.GetTag - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/git/trees - documentation_url: https://docs.github.com/rest/git/trees#create-a-tree - summary: Create a tree + - 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 - go_methods: - - GitService.CreateTree - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/git/trees/{tree_sha} - documentation_url: https://docs.github.com/rest/git/trees#get-a-tree - summary: Get a tree + - 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 - go_methods: - - GitService.GetTree - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#list-repository-webhooks - summary: List repository webhooks + - name: GET /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.ListHooks - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/hooks - documentation_url: https://docs.github.com/rest/webhooks/repos#create-a-repository-webhook - summary: Create a repository webhook + - name: POST /repos/{owner}/{repo}/hooks + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.CreateHook - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook - summary: Delete a repository webhook + - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.DeleteHook - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook - summary: Get a repository webhook + - name: GET /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.GetHook - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id} - documentation_url: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook - summary: Update a repository webhook + - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id} + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.EditHook - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository - summary: Get a webhook configuration for a repository + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.GetHookConfiguration - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/config - documentation_url: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository - summary: Update a webhook configuration for a repository + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.EditHookConfiguration - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/deliveries - documentation_url: https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook - summary: List deliveries for a repository webhook + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListHookDeliveries - - openapi: - method: GET - endpoint_url: /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 - summary: Get a delivery for a repository webhook + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.GetHookDelivery - - openapi: - method: POST - endpoint_url: /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 - summary: Redeliver a delivery for a repository webhook + - 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 openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.RedeliverHookDelivery - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/pings - documentation_url: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook - summary: Ping a repository webhook + - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.PingHook - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/hooks/{hook_id}/tests - documentation_url: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook - summary: Test the push repository webhook + - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests + documentation_url: https://docs.github.com/rest/webhooks/repos#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 - go_methods: - - RepositoriesService.TestHook - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/import - documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import - summary: Cancel an import + - name: DELETE /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.CancelImport - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/import - documentation_url: https://docs.github.com/rest/migrations/source-imports#get-an-import-status - summary: Get an import status + - name: GET /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-an-import-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.ImportProgress - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/import - documentation_url: https://docs.github.com/rest/migrations/source-imports#update-an-import - summary: Update an import + - name: PATCH /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-an-import openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.UpdateImport - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/import - documentation_url: https://docs.github.com/rest/migrations/source-imports#start-an-import - summary: Start an import + - name: PUT /repos/{owner}/{repo}/import + documentation_url: https://docs.github.com/rest/migrations/source-imports#start-an-import openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.StartImport - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/import/authors - documentation_url: https://docs.github.com/rest/migrations/source-imports#get-commit-authors - summary: Get commit authors + - name: GET /repos/{owner}/{repo}/import/authors + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-commit-authors openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.CommitAuthors - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/import/authors/{author_id} - documentation_url: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author - summary: Map a commit author + - name: PATCH /repos/{owner}/{repo}/import/authors/{author_id} + documentation_url: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.MapCommitAuthor - - override: - method: GET - endpoint_url: /repos/{owner}/{repo}/import/issues - documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues - go_methods: - - IssueImportService.CheckStatusSince - - override: - method: POST - endpoint_url: /repos/{owner}/{repo}/import/issues - documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import - go_methods: - - IssueImportService.Create - - override: - method: GET - endpoint_url: /repos/{owner}/{repo}/import/issues/{issue_number} - documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request - go_methods: - - IssueImportService.CheckStatus - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/import/large_files - documentation_url: https://docs.github.com/rest/migrations/source-imports#get-large-files - summary: Get large files + - name: GET /repos/{owner}/{repo}/import/large_files + documentation_url: https://docs.github.com/rest/migrations/source-imports#get-large-files openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.LargeFiles - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/import/lfs - documentation_url: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference - summary: Update Git LFS preference + - name: PATCH /repos/{owner}/{repo}/import/lfs + documentation_url: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.SetLFSPreference - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/installation - documentation_url: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app - summary: Get a repository installation for the authenticated app + - name: GET /repos/{owner}/{repo}/installation + documentation_url: https://docs.github.com/rest/apps/apps#get-a-repository-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 - go_methods: - - AppsService.FindRepositoryInstallation - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository - summary: Remove interaction restrictions for a repository + - name: DELETE /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.RemoveRestrictionsFromRepo - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository - summary: Get interaction restrictions for a repository + - name: GET /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.GetRestrictionsForRepo - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository - summary: Set interaction restrictions for a repository + - name: PUT /repos/{owner}/{repo}/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - InteractionsService.UpdateRestrictionsForRepo - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/invitations - documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations - summary: List repository invitations + - name: GET /repos/{owner}/{repo}/invitations + documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListInvitations - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/invitations/{invitation_id} - documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation - summary: Delete a repository invitation + - 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 - go_methods: - - RepositoriesService.DeleteInvitation - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/invitations/{invitation_id} - documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation - summary: Update a repository invitation + - 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 - go_methods: - - RepositoriesService.UpdateInvitation - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues - documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues - summary: List repository issues + - 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 - go_methods: - - IssuesService.ListByRepo - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues - documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue - summary: Create an issue + - 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 - go_methods: - - IssuesService.Create - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/comments - documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository - summary: List issue comments for a repository + - 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 - go_methods: - - IssuesService.ListComments - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} - documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment - summary: Delete an issue comment + - 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 - go_methods: - - IssuesService.DeleteComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} - documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment - summary: Get an issue comment + - 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 - go_methods: - - IssuesService.GetComment - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id} - documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment - summary: Update an issue comment + - 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 - go_methods: - - IssuesService.EditComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment - summary: List reactions for an issue comment + - 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 - go_methods: - - ReactionsService.ListIssueCommentReactions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment - summary: Create reaction for an issue comment + - 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 - go_methods: - - ReactionsService.CreateIssueCommentReaction - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} - documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction - summary: Delete an issue comment reaction + - 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 - go_methods: - - ReactionsService.DeleteIssueCommentReaction - - ReactionsService.DeleteIssueCommentReactionByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/events - documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository - summary: List issue events for a repository + - 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 - go_methods: - - IssuesService.ListRepositoryEvents - - ActivityService.ListIssueEventsForRepository - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/events/{event_id} - documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event - summary: Get an issue event + - 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 - go_methods: - - IssuesService.GetEvent - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number} - documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue - summary: Get an issue + - 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 - go_methods: - - IssuesService.Get - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number} - documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue - summary: Update an issue + - 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 - go_methods: - - IssuesService.Edit - - IssuesService.RemoveMilestone - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/assignees - documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue - summary: Remove assignees from an issue + - 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 - go_methods: - - IssuesService.RemoveAssignees - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/assignees - documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue - summary: Add assignees to an issue + - 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 - go_methods: - - IssuesService.AddAssignees - - openapi: - method: GET - endpoint_url: /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 - summary: Check if a user can be assigned to a issue + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/comments - documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments - summary: List issue comments + - 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 - go_methods: - - IssuesService.ListComments - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/comments - documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment - summary: Create an issue comment + - 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 - go_methods: - - IssuesService.CreateComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/events - documentation_url: https://docs.github.com/rest/issues/events#list-issue-events - summary: List issue events + - 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 - go_methods: - - IssuesService.ListIssueEvents - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels - documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue - summary: Remove all labels from an issue + - 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 - go_methods: - - IssuesService.RemoveLabelsForIssue - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels - documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue - summary: List labels for an issue + - 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 - go_methods: - - IssuesService.ListLabelsByIssue - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels - documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue - summary: Add labels to an issue + - 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 - go_methods: - - IssuesService.AddLabelsToIssue - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels - documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue - summary: Set labels for an issue + - 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 - go_methods: - - IssuesService.ReplaceLabelsForIssue - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} - documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue - summary: Remove a label from an issue + - 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 - go_methods: - - IssuesService.RemoveLabelForIssue - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/lock - documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue - summary: Unlock an issue + - 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 - go_methods: - - IssuesService.Unlock - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/lock - documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue - summary: Lock an issue + - 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 - go_methods: - - IssuesService.Lock - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue - summary: List reactions for an issue + - 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 - go_methods: - - ReactionsService.ListIssueReactions - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue - summary: Create reaction for an issue + - 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 - go_methods: - - ReactionsService.CreateIssueReaction - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} - documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction - summary: Delete an issue reaction + - 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 - go_methods: - - ReactionsService.DeleteIssueReaction - - ReactionsService.DeleteIssueReactionByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/issues/{issue_number}/timeline - documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue - summary: List timeline events for an issue + - 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 - go_methods: - - IssuesService.ListIssueTimeline - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/keys - documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys - summary: List deploy keys + - 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 - go_methods: - - RepositoriesService.ListKeys - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/keys - documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key - summary: Create a deploy key + - 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 - go_methods: - - RepositoriesService.CreateKey - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/keys/{key_id} - documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key - summary: Delete a deploy key + - 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 - go_methods: - - RepositoriesService.DeleteKey - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/keys/{key_id} - documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key - summary: Get a deploy key + - 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 - go_methods: - - RepositoriesService.GetKey - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/labels - documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository - summary: List labels for a repository + - 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 - go_methods: - - IssuesService.ListLabels - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/labels - documentation_url: https://docs.github.com/rest/issues/labels#create-a-label - summary: Create a label + - 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 - go_methods: - - IssuesService.CreateLabel - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/labels/{name} - documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label - summary: Delete a label + - 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 - go_methods: - - IssuesService.DeleteLabel - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/labels/{name} - documentation_url: https://docs.github.com/rest/issues/labels#get-a-label - summary: Get a label + - 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 - go_methods: - - IssuesService.GetLabel - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/labels/{name} - documentation_url: https://docs.github.com/rest/issues/labels#update-a-label - summary: Update a label + - 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 - go_methods: - - IssuesService.EditLabel - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/languages - documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages - summary: List repository languages + - 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 - go_methods: - - RepositoriesService.ListLanguages - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/lfs - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository - summary: Disable Git LFS for a repository + - 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 - go_methods: - - RepositoriesService.DisableLFS - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/lfs - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository - summary: Enable Git LFS for a repository + - 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 - go_methods: - - RepositoriesService.EnableLFS - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/license - documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository - summary: Get the license for a repository + - 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 - go_methods: - - RepositoriesService.License - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/merge-upstream - documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository - summary: Sync a fork branch with the upstream repository + - 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 - go_methods: - - RepositoriesService.MergeUpstream - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/merges - documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch - summary: Merge a branch + - 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 - go_methods: - - RepositoriesService.Merge - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/milestones - documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones - summary: List milestones + - 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 - go_methods: - - IssuesService.ListMilestones - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/milestones - documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone - summary: Create a milestone + - 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 - go_methods: - - IssuesService.CreateMilestone - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} - documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone - summary: Delete a milestone + - 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 - go_methods: - - IssuesService.DeleteMilestone - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} - documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone - summary: Get a milestone + - 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 - go_methods: - - IssuesService.GetMilestone - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number} - documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone - summary: Update a milestone + - 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 - go_methods: - - IssuesService.EditMilestone - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/milestones/{milestone_number}/labels - documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone - summary: List labels for issues in a milestone + - 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 - go_methods: - - IssuesService.ListLabelsForMilestone - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/notifications - documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user - summary: List repository notifications for the authenticated user + - 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 - go_methods: - - ActivityService.ListRepositoryNotifications - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/notifications - documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read - summary: Mark repository notifications as read + - 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 - go_methods: - - ActivityService.MarkRepositoryNotificationsRead - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/pages - documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site - summary: Delete a GitHub Pages site - override: - documentation_url: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site + - 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 - go_methods: - - RepositoriesService.DisablePages - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pages - documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site - summary: Get a GitHub Pages site - override: - documentation_url: https://docs.github.com/rest/pages/pages#get-a-github-pages-site + - 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 - go_methods: - - RepositoriesService.GetPagesInfo - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pages - documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site - summary: Create a GitHub Pages site - override: - documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-site + - 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 - go_methods: - - RepositoriesService.EnablePages - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/pages - documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site - summary: Update information about a GitHub Pages site - override: - documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site + - 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 - go_methods: - - RepositoriesService.UpdatePages - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pages/builds - documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds - summary: List GitHub Pages builds - override: - documentation_url: https://docs.github.com/rest/pages/pages#list-github-pages-builds + - 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 - go_methods: - - RepositoriesService.ListPagesBuilds - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pages/builds - documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build - summary: Request a GitHub Pages build - override: - documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build + - 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 - go_methods: - - RepositoriesService.RequestPageBuild - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pages/builds/latest - documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build - summary: Get latest Pages build + - 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 - go_methods: - - RepositoriesService.GetLatestPagesBuild - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pages/builds/{build_id} - documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build - summary: Get GitHub Pages build - override: - documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build + - 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 - go_methods: - - RepositoriesService.GetPageBuild - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pages/deployment - documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment - summary: Create a GitHub Pages deployment + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pages/health - documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages - summary: Get a DNS health check for GitHub Pages + - 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 - go_methods: - - RepositoriesService.GetPageHealthCheck - - openapi: - method: GET - endpoint_url: /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 - summary: List pre-receive hooks for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListPreReceiveHooks - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove pre-receive hook enforcement for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.DeletePreReceiveHook - - openapi: - method: GET - endpoint_url: /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 - summary: Get a pre-receive hook for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.GetPreReceiveHook - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update pre-receive hook enforcement for a repository + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.UpdatePreReceiveHook - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/private-vulnerability-reporting - documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository - summary: Disable private vulnerability reporting for a repository + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.DisablePrivateReporting - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/private-vulnerability-reporting - documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository - summary: Enable private vulnerability reporting for a repository + - name: PUT /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.EnablePrivateReporting - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/projects - documentation_url: https://docs.github.com/rest/projects/projects#list-repository-projects - summary: List repository projects + - name: GET /repos/{owner}/{repo}/projects + documentation_url: https://docs.github.com/rest/projects/projects#list-repository-projects openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.ListProjects - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/projects - documentation_url: https://docs.github.com/rest/projects/projects#create-a-repository-project - summary: Create a repository project + - 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 - go_methods: - - RepositoriesService.CreateProject - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls - documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests - summary: List pull requests + - name: GET /repos/{owner}/{repo}/properties/values + documentation_url: https://docs.github.com/rest/repos/properties#get-all-custom-property-values-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/pulls + documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - PullRequestsService.List - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pulls - documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request - summary: Create a pull request + - 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 - go_methods: - - PullRequestsService.Create - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/comments - documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository - summary: List review comments in a repository + - 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 - go_methods: - - PullRequestsService.ListComments - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} - documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request - summary: Delete a review comment for a pull request + - 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 - go_methods: - - PullRequestsService.DeleteComment - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} - documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request - summary: Get a review comment for a pull request + - 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 - go_methods: - - PullRequestsService.GetComment - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/pulls/comments/{comment_id} - documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request - summary: Update a review comment for a pull request + - 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 - go_methods: - - PullRequestsService.EditComment - - openapi: - method: GET - endpoint_url: /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 - summary: List reactions for a pull request review comment + - 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 - go_methods: - - ReactionsService.ListPullRequestCommentReactions - - openapi: - method: POST - endpoint_url: /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 - summary: Create reaction for a pull request review comment + - 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 - go_methods: - - ReactionsService.CreatePullRequestCommentReaction - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a pull request comment reaction + - 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 - go_methods: - - ReactionsService.DeletePullRequestCommentReaction - - ReactionsService.DeletePullRequestCommentReactionByID - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number} - documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request - summary: Get a pull request + - 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 - go_methods: - - PullRequestsService.Get - - PullRequestsService.GetRaw - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number} - documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request - summary: Update a pull request + - 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 - go_methods: - - PullRequestsService.Edit - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/codespaces - documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request - summary: Create a codespace from a pull request + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/comments - documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request - summary: List review comments on a pull request + - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/comments + documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-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 - go_methods: - - PullRequestsService.ListComments - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/comments - documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request - summary: Create a review comment for a pull request + - 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 - go_methods: - - PullRequestsService.CreateComment - - PullRequestsService.CreateCommentInReplyTo - - openapi: - method: POST - endpoint_url: /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 - summary: Create a reply for a review comment + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/commits - documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request - summary: List commits on a pull request + - 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 - go_methods: - - PullRequestsService.ListCommits - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/files - documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files - summary: List pull requests files + - 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 - go_methods: - - PullRequestsService.ListFiles - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/merge - documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged - summary: Check if a pull request has been merged + - 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 - go_methods: - - PullRequestsService.IsMerged - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/merge - documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request - summary: Merge a pull request + - 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 - go_methods: - - PullRequestsService.Merge - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove requested reviewers from a pull request + - 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 - go_methods: - - PullRequestsService.RemoveReviewers - - openapi: - method: GET - endpoint_url: /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 - summary: Get all requested reviewers for a pull request + - 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 - go_methods: - - PullRequestsService.ListReviewers - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers - documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request - summary: Request reviewers for a pull request + - 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 - go_methods: - - PullRequestsService.RequestReviewers - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/reviews - documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request - summary: List reviews for a pull request + - 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 - go_methods: - - PullRequestsService.ListReviews - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/reviews - documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request - summary: Create a review for a pull request + - 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 - go_methods: - - PullRequestsService.CreateReview - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a pending review for a pull request + - 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 - go_methods: - - PullRequestsService.DeletePendingReview - - openapi: - method: GET - endpoint_url: /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 - summary: Get a review for a pull request + - 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 - go_methods: - - PullRequestsService.GetReview - - openapi: - method: PUT - endpoint_url: /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 - summary: Update a review for a pull request + - 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 - go_methods: - - PullRequestsService.UpdateReview - - openapi: - method: GET - endpoint_url: /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 - summary: List comments for a pull request review + - 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 - go_methods: - - PullRequestsService.ListReviewComments - - openapi: - method: PUT - endpoint_url: /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 - summary: Dismiss a review for a pull request + - 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 - go_methods: - - PullRequestsService.DismissReview - - openapi: - method: POST - endpoint_url: /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 - summary: Submit a review for a pull request + - 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 - go_methods: - - PullRequestsService.SubmitReview - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/pulls/{pull_number}/update-branch - documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch - summary: Update a pull request branch + - 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 - go_methods: - - PullRequestsService.UpdateBranch - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/readme - documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme - summary: Get a repository README + - 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 - go_methods: - - RepositoriesService.GetReadme - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/readme/{dir} - documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory - summary: Get a repository README for a directory + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases - documentation_url: https://docs.github.com/rest/releases/releases#list-releases - summary: List releases + - 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 - go_methods: - - RepositoriesService.ListReleases - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/releases - documentation_url: https://docs.github.com/rest/releases/releases#create-a-release - summary: Create a release + - 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 - go_methods: - - RepositoriesService.CreateRelease - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} - documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset - summary: Delete a release asset + - 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 - go_methods: - - RepositoriesService.DeleteReleaseAsset - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} - documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset - summary: Get a release asset + - 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 - go_methods: - - RepositoriesService.DownloadReleaseAsset - - RepositoriesService.GetReleaseAsset - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/releases/assets/{asset_id} - documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset - summary: Update a release asset + - 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 - go_methods: - - RepositoriesService.EditReleaseAsset - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/releases/generate-notes - documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release - summary: Generate release notes content for a release + - 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 - go_methods: - - RepositoriesService.GenerateReleaseNotes - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/latest - documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release - summary: Get the latest release + - 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 - go_methods: - - RepositoriesService.GetLatestRelease - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/tags/{tag} - documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name - summary: Get a release by tag name + - 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 - go_methods: - - RepositoriesService.GetReleaseByTag - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/releases/{release_id} - documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release - summary: Delete a release + - 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 - go_methods: - - RepositoriesService.DeleteRelease - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/{release_id} - documentation_url: https://docs.github.com/rest/releases/releases#get-a-release - summary: Get a release + - 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 - go_methods: - - RepositoriesService.GetRelease - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/releases/{release_id} - documentation_url: https://docs.github.com/rest/releases/releases#update-a-release - summary: Update a release + - 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 - go_methods: - - RepositoriesService.EditRelease - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/assets - documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets - summary: List release assets + - 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 - go_methods: - - RepositoriesService.ListReleaseAssets - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/assets - documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset - summary: Upload a release asset + - 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 - go_methods: - - RepositoriesService.UploadReleaseAsset - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release - summary: List reactions for a release + - 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 - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release - summary: Create reaction for a release + - 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 - go_methods: - - ReactionsService.CreateReleaseReaction - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} - documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction - summary: Delete a release reaction + - 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 - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/replicas/caches - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/repos/repos#list-repository-cache-replication-status - summary: List repository cache replication status + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/rules/branches/{branch} - documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch - summary: Get rules for a branch + - 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 + - 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 + - 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 - go_methods: - - RepositoriesService.GetRulesForBranch - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/rulesets - documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets - summary: Get all repository rulesets + - name: GET /repos/{owner}/{repo}/rulesets/rule-suites + documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.GetAllRulesets - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/rulesets - documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset - summary: Create a repository ruleset + - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id} + documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.CreateRuleset - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset - summary: Delete a repository ruleset + - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} + documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.DeleteRuleset - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset - summary: Get a repository ruleset + - 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 - go_methods: - - RepositoriesService.GetRuleset - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/rulesets/{ruleset_id} - documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset - summary: Update a repository ruleset + - 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 - go_methods: - - RepositoriesService.UpdateRuleset - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts - documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository - summary: List secret scanning alerts for a repository + - 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 - go_methods: - - SecretScanningService.ListAlertsForRepo - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert - summary: Get a secret scanning alert + - 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 - go_methods: - - SecretScanningService.GetAlert - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} - documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert - summary: Update a secret scanning alert + - 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 - go_methods: - - SecretScanningService.UpdateAlert - - openapi: - method: GET - endpoint_url: /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 - summary: List locations for a secret scanning alert + - 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 - go_methods: - - SecretScanningService.ListLocationsForAlert - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/security-advisories - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories - summary: List repository security advisories + - name: GET /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/security-advisories - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory - summary: Create a repository security advisory + - name: POST /repos/{owner}/{repo}/security-advisories + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/security-advisories/reports - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability - summary: Privately report a security vulnerability + - name: POST /repos/{owner}/{repo}/security-advisories/reports + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id} - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory - summary: Get a repository security advisory + - name: GET /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: PATCH - endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id} - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory - summary: Update a repository security advisory + - name: PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve - documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory - summary: Request a CVE for a repository security advisory + - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve + documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - SecurityAdvisoriesService.RequestCVE - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stargazers - documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers - summary: List stargazers + - name: GET /repos/{owner}/{repo}/stargazers + documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - ActivityService.ListStargazers - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stats/code_frequency - documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity - summary: Get the weekly commit activity + - 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 - go_methods: - - RepositoriesService.ListCodeFrequency - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stats/commit_activity - documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity - summary: Get the last year of commit activity + - 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 - go_methods: - - RepositoriesService.ListCommitActivity - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stats/contributors - documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity - summary: Get all contributor commit activity + - 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 - go_methods: - - RepositoriesService.ListContributorsStats - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stats/participation - documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count - summary: Get the weekly commit count + - 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 - go_methods: - - RepositoriesService.ListParticipation - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/stats/punch_card - documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day - summary: Get the hourly commit count for each day + - 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 - go_methods: - - RepositoriesService.ListPunchCard - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/statuses/{sha} - documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status - summary: Create a commit status + - 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 - go_methods: - - RepositoriesService.CreateStatus - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/subscribers - documentation_url: https://docs.github.com/rest/activity/watching#list-watchers - summary: List watchers + - 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 - go_methods: - - ActivityService.ListWatchers - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/subscription - documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription - summary: Delete a repository subscription + - 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 - go_methods: - - ActivityService.DeleteRepositorySubscription - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/subscription - documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription - summary: Get a repository subscription + - 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 - go_methods: - - ActivityService.GetRepositorySubscription - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/subscription - documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription - summary: Set a repository subscription + - 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 - go_methods: - - ActivityService.SetRepositorySubscription - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/tags - documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags - summary: List repository tags + - 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 - go_methods: - - RepositoriesService.ListTags - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository - summary: List tag protection states for a repository + - 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 - go_methods: - - RepositoriesService.ListTagProtection - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/tags/protection - documentation_url: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository - summary: Create a tag protection state for a repository + - 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 - go_methods: - - RepositoriesService.CreateTagProtection - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a tag protection state for a repository + - 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 - go_methods: - - RepositoriesService.DeleteTagProtection - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/tarball/{ref} - documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar - summary: Download a repository archive (tar) + - 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 - go_methods: - - RepositoriesService.GetArchiveLink - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/teams - documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams - summary: List repository teams + - 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 - go_methods: - - RepositoriesService.ListTeams - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/topics - documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics - summary: Get all repository topics + - 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 - go_methods: - - RepositoriesService.ListAllTopics - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/topics - documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics - summary: Replace all repository topics + - 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 - go_methods: - - RepositoriesService.ReplaceAllTopics - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/traffic/clones - documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones - summary: Get repository clones + - name: GET /repos/{owner}/{repo}/traffic/clones + documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.ListTrafficClones - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/traffic/popular/paths - documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths - summary: Get top referral paths + - name: GET /repos/{owner}/{repo}/traffic/popular/paths + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.ListTrafficPaths - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/traffic/popular/referrers - documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources - summary: Get top referral sources + - name: GET /repos/{owner}/{repo}/traffic/popular/referrers + documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.ListTrafficReferrers - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/traffic/views - documentation_url: https://docs.github.com/rest/metrics/traffic#get-page-views - summary: Get page views + - name: GET /repos/{owner}/{repo}/traffic/views + documentation_url: https://docs.github.com/rest/metrics/traffic#get-page-views openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - RepositoriesService.ListTrafficViews - - openapi: - method: POST - endpoint_url: /repos/{owner}/{repo}/transfer - documentation_url: https://docs.github.com/rest/repos/repos#transfer-a-repository - summary: Transfer a repository + - name: POST /repos/{owner}/{repo}/transfer + documentation_url: https://docs.github.com/rest/repos/repos#transfer-a-repository openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - RepositoriesService.Transfer - - openapi: - method: DELETE - endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts - documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts - summary: Disable vulnerability alerts + - 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 - go_methods: - - RepositoriesService.DisableVulnerabilityAlerts - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts - documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository - summary: Check if vulnerability alerts are enabled for a repository + - 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 - go_methods: - - RepositoriesService.GetVulnerabilityAlerts - - openapi: - method: PUT - endpoint_url: /repos/{owner}/{repo}/vulnerability-alerts - documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts - summary: Enable vulnerability alerts + - 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 - go_methods: - - RepositoriesService.EnableVulnerabilityAlerts - - openapi: - method: GET - endpoint_url: /repos/{owner}/{repo}/zipball/{ref} - documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip - summary: Download a repository archive (zip) + - 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 - go_methods: - - RepositoriesService.GetArchiveLink - - openapi: - method: POST - endpoint_url: /repos/{template_owner}/{template_repo}/generate - documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template - summary: Create a repository using a template + - 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 - go_methods: - - RepositoriesService.CreateFromTemplate - - openapi: - method: GET - endpoint_url: /repositories - documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories - summary: List public repositories + - 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 - go_methods: - - RepositoriesService.ListAll - - openapi: - method: GET - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets - documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets - summary: List environment secrets + - 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 - go_methods: - - ActionsService.ListEnvSecrets - - openapi: - method: GET - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/public-key - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key - summary: Get an environment public key + - 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 - go_methods: - - ActionsService.GetEnvPublicKey - - openapi: - method: DELETE - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret - summary: Delete an environment secret + - 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 - go_methods: - - ActionsService.DeleteEnvSecret - - openapi: - method: GET - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret - summary: Get an environment secret + - 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 - go_methods: - - ActionsService.GetEnvSecret - - openapi: - method: PUT - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret - summary: Create or update an environment secret + - 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 - go_methods: - - ActionsService.CreateOrUpdateEnvSecret - - openapi: - method: GET - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables - documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables - summary: List environment variables + - 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 - go_methods: - - ActionsService.ListEnvVariables - - openapi: - method: POST - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables - documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable - summary: Create an environment variable + - 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 - go_methods: - - ActionsService.CreateEnvVariable - - openapi: - method: DELETE - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable - summary: Delete an environment variable + - 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 - go_methods: - - ActionsService.DeleteEnvVariable - - openapi: - method: GET - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable - summary: Get an environment variable + - 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 - go_methods: - - ActionsService.GetEnvVariable - - openapi: - method: PATCH - endpoint_url: /repositories/{repository_id}/environments/{environment_name}/variables/{name} - documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable - summary: Update an environment variable + - 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 - go_methods: - - ActionsService.UpdateEnvVariable - - openapi: - method: GET - endpoint_url: /scim/v2/Groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise - summary: List provisioned SCIM groups for an enterprise + - 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 - - openapi: - method: POST - endpoint_url: /scim/v2/Groups - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group - summary: Provision a SCIM enterprise group + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a SCIM group from an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get SCIM provisioning information for an enterprise group + - 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 - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update an attribute for a SCIM enterprise group + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set SCIM information for a provisioned enterprise group + - 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 - - openapi: - method: GET - endpoint_url: /scim/v2/Users - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise - summary: List SCIM provisioned identities for an enterprise + - 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 - - openapi: - method: POST - endpoint_url: /scim/v2/Users - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user - summary: Provision a SCIM enterprise user + - 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 - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a SCIM user from an enterprise + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: Get SCIM provisioning information for an enterprise user + - 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 - - openapi: - method: PATCH - endpoint_url: /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 - summary: Update an attribute for a SCIM enterprise user + - 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 - - openapi: - method: PUT - endpoint_url: /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 - summary: Set SCIM information for a provisioned enterprise user + - 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 - - openapi: - method: GET - endpoint_url: /scim/v2/organizations/{org}/Users - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities - summary: List SCIM provisioned identities + - 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: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.ListSCIMProvisionedIdentities - - openapi: - method: POST - endpoint_url: /scim/v2/organizations/{org}/Users - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user - summary: Provision and invite a SCIM user + - name: POST /scim/v2/organizations/{org}/Users + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user openapi_files: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.ProvisionAndInviteSCIMUser - - openapi: - method: DELETE - endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization - summary: Delete a SCIM user from an organization + - name: DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization openapi_files: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.DeleteSCIMUserFromOrg - - openapi: - method: GET - endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user - summary: Get SCIM provisioning information for a user + - name: GET /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user openapi_files: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.GetSCIMProvisioningInfoForUser - - openapi: - method: PATCH - endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user - summary: Update an attribute for a SCIM user + - name: PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user openapi_files: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.UpdateAttributeForSCIMUser - - openapi: - method: PUT - endpoint_url: /scim/v2/organizations/{org}/Users/{scim_user_id} - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership - summary: Update a provisioned organization membership + - name: PUT /scim/v2/organizations/{org}/Users/{scim_user_id} + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership openapi_files: - descriptions/ghec/ghec.json - go_methods: - - SCIMService.UpdateProvisionedOrgMembership - - openapi: - method: GET - endpoint_url: /search/code - documentation_url: https://docs.github.com/rest/search/search#search-code - summary: Search code + - name: GET /search/code + documentation_url: https://docs.github.com/rest/search/search#search-code openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - SearchService.Code - - openapi: - method: GET - endpoint_url: /search/commits - documentation_url: https://docs.github.com/rest/search/search#search-commits - summary: Search commits + - 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 - go_methods: - - SearchService.Commits - - openapi: - method: GET - endpoint_url: /search/issues - documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests - summary: Search issues and pull requests + - 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 - go_methods: - - SearchService.Issues - - openapi: - method: GET - endpoint_url: /search/labels - documentation_url: https://docs.github.com/rest/search/search#search-labels - summary: Search labels + - 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 - go_methods: - - SearchService.Labels - - openapi: - method: GET - endpoint_url: /search/repositories - documentation_url: https://docs.github.com/rest/search/search#search-repositories - summary: Search repositories + - 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 - go_methods: - - SearchService.Repositories - - openapi: - method: GET - endpoint_url: /search/topics - documentation_url: https://docs.github.com/rest/search/search#search-topics - summary: Search topics + - 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 - go_methods: - - SearchService.Topics - - openapi: - method: GET - endpoint_url: /search/users - documentation_url: https://docs.github.com/rest/search/search#search-users - summary: Search users + - 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 - go_methods: - - SearchService.Users - - openapi: - method: GET - endpoint_url: /setup/api/configcheck - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status - summary: Get the configuration status + - name: GET /setup/api/configcheck + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-configuration-status openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /setup/api/configure - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process - summary: Start a configuration process + - name: POST /setup/api/configure + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#start-a-configuration-process openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status - summary: Get the maintenance status + - name: GET /setup/api/maintenance + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-the-maintenance-status openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /setup/api/maintenance - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode - summary: Enable or disable maintenance mode + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings - summary: Get settings + - name: GET /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#get-settings openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PUT - endpoint_url: /setup/api/settings - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings - summary: Set settings + - name: PUT /setup/api/settings + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#set-settings openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /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 - summary: Remove an authorized SSH key + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /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 - summary: Get all authorized SSH keys + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /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 - summary: Add an authorized SSH key + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /setup/api/start - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license - summary: Create a GitHub license + - name: POST /setup/api/start + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#create-a-github-license openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: POST - endpoint_url: /setup/api/upgrade - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license - summary: Upgrade a license + - name: POST /setup/api/upgrade + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/management-console#upgrade-a-license openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /teams/{team_id} - documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy - summary: Delete a team (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id} - documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy - summary: Get a team (Legacy) + - 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 - - openapi: - method: PATCH - endpoint_url: /teams/{team_id} - documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy - summary: Update a team (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/discussions - documentation_url: https://docs.github.com/rest/teams/discussions#list-discussions-legacy - summary: List discussions (Legacy) + - 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 - - openapi: - method: POST - endpoint_url: /teams/{team_id}/discussions - documentation_url: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy - summary: Create a discussion (Legacy) + - 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 - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy - summary: Delete a discussion (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy - summary: Get a discussion (Legacy) + - 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 - - openapi: - method: PATCH - endpoint_url: /teams/{team_id}/discussions/{discussion_number} - documentation_url: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy - summary: Update a discussion (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments - documentation_url: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy - summary: List discussion comments (Legacy) + - 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 - - openapi: - method: POST - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments - documentation_url: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy - summary: Create a discussion comment (Legacy) + - 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 - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - documentation_url: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy - summary: Delete a discussion comment (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - documentation_url: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy - summary: Get a discussion comment (Legacy) + - 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 - - openapi: - method: PATCH - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - documentation_url: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy - summary: Update a discussion comment (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List reactions for a team discussion comment (Legacy) + - 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 - go_methods: - - ReactionsService.ListTeamDiscussionCommentReactions - - openapi: - method: POST - endpoint_url: /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 - summary: Create reaction for a team discussion comment (Legacy) + - 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 - go_methods: - - ReactionsService.CreateTeamDiscussionCommentReaction - - openapi: - method: GET - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy - summary: List reactions for a team discussion (Legacy) + - 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 - go_methods: - - ReactionsService.ListTeamDiscussionReactions - - openapi: - method: POST - endpoint_url: /teams/{team_id}/discussions/{discussion_number}/reactions - documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy - summary: Create reaction for a team discussion (Legacy) + - 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 - go_methods: - - ReactionsService.CreateTeamDiscussionReaction - - openapi: - method: GET - endpoint_url: /teams/{team_id}/invitations - documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy - summary: List pending team invitations (Legacy) + - name: GET /teams/{team_id}/invitations + documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /teams/{team_id}/members - documentation_url: https://docs.github.com/rest/teams/members#list-team-members-legacy - summary: List team members (Legacy) + - name: GET /teams/{team_id}/members + documentation_url: https://docs.github.com/rest/teams/members#list-team-members-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/members/{username} - documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy - summary: Remove team member (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/members/{username} - documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy - summary: Get team member (Legacy) + - 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 - - openapi: - method: PUT - endpoint_url: /teams/{team_id}/members/{username} - documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy - summary: Add team member (Legacy) + - 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 - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy - summary: Remove team membership for a user (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy - summary: Get team membership for a user (Legacy) + - 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 - - openapi: - method: PUT - endpoint_url: /teams/{team_id}/memberships/{username} - documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy - summary: Add or update team membership for a user (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/projects - documentation_url: https://docs.github.com/rest/teams/teams#list-team-projects-legacy - summary: List team projects (Legacy) + - 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 - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy - summary: Remove a project from a team (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy - summary: Check team permissions for a project (Legacy) + - 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 - - openapi: - method: PUT - endpoint_url: /teams/{team_id}/projects/{project_id} - documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy - summary: Add or update team project permissions (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/repos - documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy - summary: List team repositories (Legacy) + - 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 - - openapi: - method: DELETE - endpoint_url: /teams/{team_id}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy - summary: Remove a repository from a team (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /teams/{team_id}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy - summary: Check team permissions for a repository (Legacy) + - 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 - - openapi: - method: PUT - endpoint_url: /teams/{team_id}/repos/{owner}/{repo} - documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy - summary: Add or update team repository permissions (Legacy) + - 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 - - openapi: - method: GET - endpoint_url: /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 - summary: List IdP groups for a team (Legacy) + - 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: - descriptions/ghec/ghec.json - - openapi: - method: PATCH - endpoint_url: /teams/{team_id}/team-sync/group-mappings - documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections-legacy - summary: Create or update IdP group connections (Legacy) + - name: PATCH /teams/{team_id}/team-sync/group-mappings + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections-legacy openapi_files: - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /teams/{team_id}/teams - documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams-legacy - summary: List child teams (Legacy) + - name: GET /teams/{team_id}/teams + documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams-legacy openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: GET - endpoint_url: /user - documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user - summary: Get the authenticated user + - 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 - go_methods: - - UsersService.Get - - openapi: - method: PATCH - endpoint_url: /user - documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user - summary: Update the authenticated user + - 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 - go_methods: - - UsersService.Edit - - openapi: - method: GET - endpoint_url: /user/blocks - documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user - summary: List users blocked by the authenticated user + - name: GET /user/blocks + documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - UsersService.ListBlockedUsers - - openapi: - method: DELETE - endpoint_url: /user/blocks/{username} - documentation_url: https://docs.github.com/rest/users/blocking#unblock-a-user - summary: Unblock a user + - name: DELETE /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#unblock-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - UsersService.UnblockUser - - openapi: - method: GET - endpoint_url: /user/blocks/{username} - documentation_url: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user - summary: Check if a user is blocked by the authenticated user + - name: GET /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - UsersService.IsBlocked - - openapi: - method: PUT - endpoint_url: /user/blocks/{username} - documentation_url: https://docs.github.com/rest/users/blocking#block-a-user - summary: Block a user + - name: PUT /user/blocks/{username} + documentation_url: https://docs.github.com/rest/users/blocking#block-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - UsersService.BlockUser - - openapi: - method: GET - endpoint_url: /user/codespaces - documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user - summary: List codespaces for the authenticated user + - name: GET /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.List - - openapi: - method: POST - endpoint_url: /user/codespaces - documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user - summary: Create a codespace for the authenticated user + - name: POST /user/codespaces + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /user/codespaces/secrets - documentation_url: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user - summary: List secrets for the authenticated user + - name: GET /user/codespaces/secrets + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListUserSecrets - - openapi: - method: GET - endpoint_url: /user/codespaces/secrets/public-key - documentation_url: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user - summary: Get public key for the authenticated user + - name: GET /user/codespaces/secrets/public-key + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetUserPublicKey - - openapi: - method: DELETE - endpoint_url: /user/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user - summary: Delete a secret for the authenticated user + - name: DELETE /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.DeleteUserSecret - - openapi: - method: GET - endpoint_url: /user/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user - summary: Get a secret for the authenticated user + - name: GET /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.GetUserSecret - - openapi: - method: PUT - endpoint_url: /user/codespaces/secrets/{secret_name} - documentation_url: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user - summary: Create or update a secret for the authenticated user + - name: PUT /user/codespaces/secrets/{secret_name} + documentation_url: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.CreateOrUpdateUserSecret - - openapi: - method: GET - endpoint_url: /user/codespaces/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret - summary: List selected repositories for a user secret + - name: GET /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.ListSelectedReposForUserSecret - - openapi: - method: PUT - endpoint_url: /user/codespaces/secrets/{secret_name}/repositories - documentation_url: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret - summary: Set selected repositories for a user secret + - name: PUT /user/codespaces/secrets/{secret_name}/repositories + documentation_url: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.SetSelectedReposForUserSecret - - openapi: - method: DELETE - endpoint_url: /user/codespaces/secrets/{secret_name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret - summary: Remove a selected repository from a user secret + - name: DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.RemoveSelectedRepoFromUserSecret - - openapi: - method: PUT - endpoint_url: /user/codespaces/secrets/{secret_name}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret - summary: Add a selected repository to a user secret + - name: PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} + documentation_url: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.AddSelectedRepoToUserSecret - - openapi: - method: DELETE - endpoint_url: /user/codespaces/{codespace_name} - documentation_url: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user - summary: Delete a codespace for the authenticated user + - name: DELETE /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.Delete - - openapi: - method: GET - endpoint_url: /user/codespaces/{codespace_name} - documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user - summary: Get a codespace for the authenticated user + - name: GET /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: PATCH - endpoint_url: /user/codespaces/{codespace_name} - documentation_url: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user - summary: Update a codespace for the authenticated user + - name: PATCH /user/codespaces/{codespace_name} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /user/codespaces/{codespace_name}/exports - documentation_url: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user - summary: Export a codespace for the authenticated user + - name: POST /user/codespaces/{codespace_name}/exports + documentation_url: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /user/codespaces/{codespace_name}/exports/{export_id} - documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export - summary: Get details about a codespace export + - name: GET /user/codespaces/{codespace_name}/exports/{export_id} + documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /user/codespaces/{codespace_name}/machines - documentation_url: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace - summary: List machine types for a codespace + - name: GET /user/codespaces/{codespace_name}/machines + documentation_url: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /user/codespaces/{codespace_name}/publish - documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace - summary: Create a repository from an unpublished codespace + - name: POST /user/codespaces/{codespace_name}/publish + documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: POST - endpoint_url: /user/codespaces/{codespace_name}/start - documentation_url: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user - summary: Start a codespace for the authenticated user + - name: POST /user/codespaces/{codespace_name}/start + documentation_url: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.Start - - openapi: - method: POST - endpoint_url: /user/codespaces/{codespace_name}/stop - documentation_url: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user - summary: Stop a codespace for the authenticated user + - name: POST /user/codespaces/{codespace_name}/stop + documentation_url: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - CodespacesService.Stop - - openapi: - method: GET - endpoint_url: /user/docker/conflicts - documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user - summary: Get list of conflicting packages during Docker migration for authenticated-user + - name: GET /user/docker/conflicts + documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - - openapi: - method: PATCH - endpoint_url: /user/email/visibility - documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user - summary: Set primary email visibility for the authenticated user + - name: PATCH /user/email/visibility + documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - UsersService.SetEmailVisibility - - openapi: - method: DELETE - endpoint_url: /user/emails - documentation_url: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user - summary: Delete an email address for the authenticated user + - name: DELETE /user/emails + documentation_url: https://docs.github.com/rest/users/emails#delete-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 - go_methods: - - UsersService.DeleteEmails - - openapi: - method: GET - endpoint_url: /user/emails - documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user - summary: List email addresses for the authenticated user + - 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 - go_methods: - - UsersService.ListEmails - - openapi: - method: POST - endpoint_url: /user/emails - documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user - summary: Add an email address for the authenticated user + - 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 - go_methods: - - UsersService.AddEmails - - openapi: - method: GET - endpoint_url: /user/followers - documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user - summary: List followers of the authenticated user + - 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 - go_methods: - - UsersService.ListFollowers - - openapi: - method: GET - endpoint_url: /user/following - documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows - summary: List the people the authenticated user follows + - 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 - go_methods: - - UsersService.ListFollowing - - openapi: - method: DELETE - endpoint_url: /user/following/{username} - documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user - summary: Unfollow a user + - 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 - go_methods: - - UsersService.Unfollow - - openapi: - method: GET - endpoint_url: /user/following/{username} - documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user - summary: Check if a person is followed by the authenticated user + - 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 - go_methods: - - UsersService.IsFollowing - - openapi: - method: PUT - endpoint_url: /user/following/{username} - documentation_url: https://docs.github.com/rest/users/followers#follow-a-user - summary: Follow a user + - 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 - go_methods: - - UsersService.Follow - - openapi: - method: GET - endpoint_url: /user/gpg_keys - documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user - summary: List GPG keys for the authenticated user + - 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 - go_methods: - - UsersService.ListGPGKeys - - openapi: - method: POST - endpoint_url: /user/gpg_keys - documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user - summary: Create a GPG key for the authenticated user + - 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 - go_methods: - - UsersService.CreateGPGKey - - openapi: - method: DELETE - endpoint_url: /user/gpg_keys/{gpg_key_id} - documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user - summary: Delete a GPG key for the authenticated user + - 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 - go_methods: - - UsersService.DeleteGPGKey - - openapi: - method: GET - endpoint_url: /user/gpg_keys/{gpg_key_id} - documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user - summary: Get a GPG key for the authenticated user + - 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 - go_methods: - - UsersService.GetGPGKey - - openapi: - method: GET - endpoint_url: /user/installations - documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token - summary: List app installations accessible to the user access token + - 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 - go_methods: - - AppsService.ListUserInstallations - - openapi: - method: GET - endpoint_url: /user/installations/{installation_id}/repositories - documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token - summary: List repositories accessible to the user access token + - 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 - go_methods: - - AppsService.ListUserRepos - - openapi: - method: DELETE - endpoint_url: /user/installations/{installation_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation - summary: Remove a repository from an app installation + - 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 - go_methods: - - AppsService.RemoveRepository - - openapi: - method: PUT - endpoint_url: /user/installations/{installation_id}/repositories/{repository_id} - documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation - summary: Add a repository to an app installation + - 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 - go_methods: - - AppsService.AddRepository - - openapi: - method: DELETE - endpoint_url: /user/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories - summary: Remove interaction restrictions from your public repositories + - name: DELETE /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /user/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories - summary: Get interaction restrictions for your public repositories + - name: GET /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: PUT - endpoint_url: /user/interaction-limits - documentation_url: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories - summary: Set interaction restrictions for your public repositories + - name: PUT /user/interaction-limits + documentation_url: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /user/issues - documentation_url: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user - summary: List user account issues assigned to the authenticated user + - name: GET /user/issues + documentation_url: https://docs.github.com/rest/issues/issues#list-user-account-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 - go_methods: - - IssuesService.List - - openapi: - method: GET - endpoint_url: /user/keys - documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user - summary: List public SSH keys for the authenticated user + - 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 - go_methods: - - UsersService.ListKeys - - openapi: - method: POST - endpoint_url: /user/keys - documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user - summary: Create a public SSH key for the authenticated user + - 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 - go_methods: - - UsersService.CreateKey - - openapi: - method: DELETE - endpoint_url: /user/keys/{key_id} - documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user - summary: Delete a public SSH key for the authenticated user + - 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 - go_methods: - - UsersService.DeleteKey - - openapi: - method: GET - endpoint_url: /user/keys/{key_id} - documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user - summary: Get a public SSH key for the authenticated user + - 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 - go_methods: - - UsersService.GetKey - - openapi: - method: GET - endpoint_url: /user/marketplace_purchases - documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user - summary: List subscriptions for the authenticated user + - name: GET /user/marketplace_purchases + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListMarketplacePurchasesForUser - - openapi: - method: GET - endpoint_url: /user/marketplace_purchases/stubbed - documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed - summary: List subscriptions for the authenticated user (stubbed) + - name: GET /user/marketplace_purchases/stubbed + documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MarketplaceService.ListMarketplacePurchasesForUser - - openapi: - method: GET - endpoint_url: /user/memberships/orgs - documentation_url: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user - summary: List organization memberships for the authenticated user + - name: GET /user/memberships/orgs + documentation_url: https://docs.github.com/rest/orgs/members#list-organization-memberships-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 - go_methods: - - OrganizationsService.ListOrgMemberships - - openapi: - method: GET - endpoint_url: /user/memberships/orgs/{org} - documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user - summary: Get an organization membership for the authenticated user + - 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 - go_methods: - - OrganizationsService.GetOrgMembership - - openapi: - method: PATCH - endpoint_url: /user/memberships/orgs/{org} - documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user - summary: Update an organization membership for the authenticated user + - 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 - go_methods: - - OrganizationsService.EditOrgMembership - - openapi: - method: GET - endpoint_url: /user/migrations - documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations - summary: List user migrations + - 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 - go_methods: - - MigrationService.ListUserMigrations - - openapi: - method: POST - endpoint_url: /user/migrations - documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration - summary: Start a user migration + - 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 - go_methods: - - MigrationService.StartUserMigration - - openapi: - method: GET - endpoint_url: /user/migrations/{migration_id} - documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status - summary: Get a user migration status + - name: GET /user/migrations/{migration_id} + documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.UserMigrationStatus - - openapi: - method: DELETE - endpoint_url: /user/migrations/{migration_id}/archive - documentation_url: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive - summary: Delete a user migration archive + - name: DELETE /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.DeleteUserMigration - - openapi: - method: GET - endpoint_url: /user/migrations/{migration_id}/archive - documentation_url: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive - summary: Download a user migration archive + - name: GET /user/migrations/{migration_id}/archive + documentation_url: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - MigrationService.UserMigrationArchiveURL - - openapi: - method: DELETE - endpoint_url: /user/migrations/{migration_id}/repos/{repo_name}/lock - documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository - summary: Unlock a user repository + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - MigrationService.UnlockUserRepo - - openapi: - method: GET - endpoint_url: /user/migrations/{migration_id}/repositories - documentation_url: https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration - summary: List repositories for a user migration + - name: GET /user/migrations/{migration_id}/repositories + documentation_url: https://docs.github.com/rest/migrations/users#list-repositories-for-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 - - openapi: - method: GET - endpoint_url: /user/orgs - documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user - summary: List organizations for the authenticated user + - 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 - go_methods: - - OrganizationsService.List - - openapi: - method: GET - endpoint_url: /user/packages - documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace - summary: List packages for the authenticated user's namespace + - 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 - go_methods: - - UsersService.ListPackages - - openapi: - method: DELETE - endpoint_url: /user/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user - summary: Delete a package for the authenticated user + - 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 - go_methods: - - UsersService.DeletePackage - - openapi: - method: GET - endpoint_url: /user/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user - summary: Get a package for the authenticated user + - 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 - go_methods: - - UsersService.GetPackage - - openapi: - method: POST - endpoint_url: /user/packages/{package_type}/{package_name}/restore - documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user - summary: Restore a package for the authenticated user + - 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 - go_methods: - - UsersService.RestorePackage - - openapi: - method: GET - endpoint_url: /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 - summary: List package versions for a package owned by the authenticated user + - 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 - go_methods: - - UsersService.PackageGetAllVersions - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete a package version for the authenticated user + - 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 - go_methods: - - UsersService.PackageDeleteVersion - - openapi: - method: GET - endpoint_url: /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 - summary: Get a package version for the authenticated user + - 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 - go_methods: - - UsersService.PackageGetVersion - - openapi: - method: POST - endpoint_url: /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 - summary: Restore a package version for the authenticated user + - 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 - go_methods: - - UsersService.PackageRestoreVersion - - openapi: - method: POST - endpoint_url: /user/projects - documentation_url: https://docs.github.com/rest/projects/projects#create-a-user-project - summary: Create a user project + - 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 - go_methods: - - UsersService.CreateProject - - openapi: - method: GET - endpoint_url: /user/public_emails - documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user - summary: List public email addresses for the authenticated user + - 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 - - openapi: - method: GET - endpoint_url: /user/repos - documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user - summary: List repositories for the authenticated user + - 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 - go_methods: - - RepositoriesService.List - - openapi: - method: POST - endpoint_url: /user/repos - documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user - summary: Create a repository for the authenticated user + - 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 - go_methods: - - RepositoriesService.Create - - openapi: - method: GET - endpoint_url: /user/repository_invitations - documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user - summary: List repository invitations for the authenticated user + - 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 - go_methods: - - UsersService.ListInvitations - - openapi: - method: DELETE - endpoint_url: /user/repository_invitations/{invitation_id} - documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation - summary: Decline a repository invitation + - 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 - go_methods: - - UsersService.DeclineInvitation - - openapi: - method: PATCH - endpoint_url: /user/repository_invitations/{invitation_id} - documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation - summary: Accept a repository invitation + - 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 - go_methods: - - UsersService.AcceptInvitation - - openapi: - method: DELETE - endpoint_url: /user/social_accounts - documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user - summary: Delete social accounts for the authenticated user + - 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 - - openapi: - method: GET - endpoint_url: /user/social_accounts - documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user - summary: List social accounts for the authenticated user + - 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 - - openapi: - method: POST - endpoint_url: /user/social_accounts - documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user - summary: Add social accounts for the authenticated user + - 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 - - openapi: - method: GET - endpoint_url: /user/ssh_signing_keys - documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user - summary: List SSH signing keys for the authenticated user + - 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 - go_methods: - - UsersService.ListSSHSigningKeys - - openapi: - method: POST - endpoint_url: /user/ssh_signing_keys - documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user - summary: Create a SSH signing key for the authenticated user + - 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 - go_methods: - - UsersService.CreateSSHSigningKey - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete an SSH signing key for the authenticated user + - 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 - go_methods: - - UsersService.DeleteSSHSigningKey - - openapi: - method: GET - endpoint_url: /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 - summary: Get an SSH signing key for the authenticated user + - 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 - go_methods: - - UsersService.GetSSHSigningKey - - openapi: - method: GET - endpoint_url: /user/starred - documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user - summary: List repositories starred by the authenticated user + - 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 - go_methods: - - ActivityService.ListStarred - - openapi: - method: DELETE - endpoint_url: /user/starred/{owner}/{repo} - documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user - summary: Unstar a repository for the authenticated user + - 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 - go_methods: - - ActivityService.Unstar - - openapi: - method: GET - endpoint_url: /user/starred/{owner}/{repo} - documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user - summary: Check if a repository is starred by the authenticated user + - 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 - go_methods: - - ActivityService.IsStarred - - openapi: - method: PUT - endpoint_url: /user/starred/{owner}/{repo} - documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user - summary: Star a repository for the authenticated user + - 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 - go_methods: - - ActivityService.Star - - openapi: - method: GET - endpoint_url: /user/subscriptions - documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user - summary: List repositories watched by the authenticated user + - 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 - go_methods: - - ActivityService.ListWatched - - openapi: - method: GET - endpoint_url: /user/teams - documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user - summary: List teams for the authenticated user + - 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 - go_methods: - - TeamsService.ListUserTeams - - openapi: - method: GET - endpoint_url: /users - documentation_url: https://docs.github.com/rest/users/users#list-users - summary: List users + - 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 - go_methods: - - UsersService.ListAll - - openapi: - method: GET - endpoint_url: /users/{username} - documentation_url: https://docs.github.com/rest/users/users#get-a-user - summary: Get a user + - 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 - go_methods: - - UsersService.Get - - openapi: - method: GET - endpoint_url: /users/{username}/docker/conflicts - documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user - summary: Get list of conflicting packages during Docker migration for user + - 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 - - openapi: - method: GET - endpoint_url: /users/{username}/events - documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user - summary: List events for the authenticated user + - 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 - go_methods: - - ActivityService.ListEventsPerformedByUser - - openapi: - method: GET - endpoint_url: /users/{username}/events/orgs/{org} - documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user - summary: List organization events for the authenticated user + - 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 - go_methods: - - ActivityService.ListUserEventsForOrganization - - openapi: - method: GET - endpoint_url: /users/{username}/events/public - documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user - summary: List public events for a user + - 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 - go_methods: - - ActivityService.ListEventsPerformedByUser - - openapi: - method: GET - endpoint_url: /users/{username}/followers - documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user - summary: List followers of a user + - 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 - go_methods: - - UsersService.ListFollowers - - openapi: - method: GET - endpoint_url: /users/{username}/following - documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows - summary: List the people a user follows + - 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 - go_methods: - - UsersService.ListFollowing - - openapi: - method: GET - endpoint_url: /users/{username}/following/{target_user} - documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user - summary: Check if a user follows another user + - 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 - go_methods: - - UsersService.IsFollowing - - openapi: - method: GET - endpoint_url: /users/{username}/gists - documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user - summary: List gists for a user + - 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 - go_methods: - - GistsService.List - - openapi: - method: GET - endpoint_url: /users/{username}/gpg_keys - documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user - summary: List GPG keys for a user + - 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 - go_methods: - - UsersService.ListGPGKeys - - openapi: - method: GET - endpoint_url: /users/{username}/hovercard - documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user - summary: Get contextual information for a user + - 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 - go_methods: - - UsersService.GetHovercard - - openapi: - method: GET - endpoint_url: /users/{username}/installation - documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app - summary: Get a user installation for the authenticated app + - 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 - go_methods: - - AppsService.FindUserInstallation - - openapi: - method: GET - endpoint_url: /users/{username}/keys - documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user - summary: List public keys for a user + - 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 - go_methods: - - UsersService.ListKeys - - openapi: - method: GET - endpoint_url: /users/{username}/orgs - documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user - summary: List organizations for a user + - 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 - go_methods: - - OrganizationsService.List - - openapi: - method: GET - endpoint_url: /users/{username}/packages - documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user - summary: List packages for a user + - 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 - go_methods: - - UsersService.ListPackages - - openapi: - method: DELETE - endpoint_url: /users/{username}/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user - summary: Delete a package for a user + - 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 - go_methods: - - UsersService.DeletePackage - - openapi: - method: GET - endpoint_url: /users/{username}/packages/{package_type}/{package_name} - documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user - summary: Get a package for a user + - 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 - go_methods: - - UsersService.GetPackage - - openapi: - method: POST - endpoint_url: /users/{username}/packages/{package_type}/{package_name}/restore - documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user - summary: Restore a package for a user + - 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 - go_methods: - - UsersService.RestorePackage - - openapi: - method: GET - endpoint_url: /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 - summary: List package versions for a package owned by a user + - 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 - go_methods: - - UsersService.PackageGetAllVersions - - openapi: - method: DELETE - endpoint_url: /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 - summary: Delete package version for a user + - 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 - go_methods: - - UsersService.PackageDeleteVersion - - openapi: - method: GET - endpoint_url: /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 - summary: Get a package version for a user + - 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 - go_methods: - - UsersService.PackageGetVersion - - openapi: - method: POST - endpoint_url: /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 - summary: Restore package version for a user + - 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 - go_methods: - - UsersService.PackageRestoreVersion - - openapi: - method: GET - endpoint_url: /users/{username}/projects - documentation_url: https://docs.github.com/rest/projects/projects#list-user-projects - summary: List user projects + - 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 - go_methods: - - UsersService.ListProjects - - openapi: - method: GET - endpoint_url: /users/{username}/received_events - documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user - summary: List events received by the authenticated user + - 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 - go_methods: - - ActivityService.ListEventsReceivedByUser - - openapi: - method: GET - endpoint_url: /users/{username}/received_events/public - documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user - summary: List public events received by a user + - 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 - go_methods: - - ActivityService.ListEventsReceivedByUser - - openapi: - method: GET - endpoint_url: /users/{username}/repos - documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user - summary: List repositories for a user + - 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 - go_methods: - - RepositoriesService.List - - openapi: - method: GET - endpoint_url: /users/{username}/settings/billing/actions - documentation_url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user - summary: Get GitHub Actions billing for a user + - 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: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetActionsBillingUser - - openapi: - method: GET - endpoint_url: /users/{username}/settings/billing/packages - documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user - summary: Get GitHub Packages billing for a user + - name: GET /users/{username}/settings/billing/packages + documentation_url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetPackagesBillingUser - - openapi: - method: GET - endpoint_url: /users/{username}/settings/billing/shared-storage - documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user - summary: Get shared storage billing for a user + - name: GET /users/{username}/settings/billing/shared-storage + documentation_url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - go_methods: - - BillingService.GetStorageBillingUser - - openapi: - method: DELETE - endpoint_url: /users/{username}/site_admin - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator - summary: Demote a site administrator + - name: DELETE /users/{username}/site_admin + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#demote-a-site-administrator openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - UsersService.DemoteSiteAdmin - - openapi: - method: PUT - endpoint_url: /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 - summary: Promote a user to be a site administrator + - 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 openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - UsersService.PromoteSiteAdmin - - openapi: - method: GET - endpoint_url: /users/{username}/social_accounts - documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user - summary: List social accounts for a user + - 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 - - openapi: - method: GET - endpoint_url: /users/{username}/ssh_signing_keys - documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user - summary: List SSH signing keys for a user + - 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 - go_methods: - - UsersService.ListSSHSigningKeys - - openapi: - method: GET - endpoint_url: /users/{username}/starred - documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user - summary: List repositories starred by a user + - 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 - go_methods: - - ActivityService.ListStarred - - openapi: - method: GET - endpoint_url: /users/{username}/subscriptions - documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user - summary: List repositories watched by a user + - 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 - go_methods: - - ActivityService.ListWatched - - openapi: - method: DELETE - endpoint_url: /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user - summary: Unsuspend a user + - name: DELETE /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#unsuspend-a-user openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - UsersService.Unsuspend - - openapi: - method: PUT - endpoint_url: /users/{username}/suspended - documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user - summary: Suspend a user + - name: PUT /users/{username}/suspended + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/users#suspend-a-user openapi_files: - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - UsersService.Suspend - - openapi: - method: GET - endpoint_url: /versions - documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions - summary: Get all API versions + - name: GET /versions + documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - openapi: - method: GET - endpoint_url: /zen - documentation_url: https://docs.github.com/rest/meta/meta#get-the-zen-of-github - summary: Get the Zen of GitHub + - name: GET /zen + documentation_url: https://docs.github.com/rest/meta/meta#get-the-zen-of-github openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - descriptions/ghes-3.10/ghes-3.10.json - go_methods: - - Client.Zen diff --git a/script/lint.sh b/script/lint.sh index af5ae991006..d3d1c764ad2 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -1,5 +1,7 @@ #!/bin/sh -#/ script/lint.sh runs linters and validates generated files. +#/ [ CHECK_GITHUB_OPENAPI=1 ] script/lint.sh runs linters and validates generated files. +#/ When CHECK_GITHUB is set, it validates that metadata.yaml is consistent with the +#/ descriptions from github.com/github/rest-api-description. set -e @@ -31,6 +33,14 @@ for dir in $MOD_DIRS; do ) || FAILED=1 done +echo validating metadata.yaml +if [ -n "$CHECK_GITHUB_OPENAPI" ]; then + script/metadata.sh validate --check-github || FAILED=1 +else + script/metadata.sh validate || FAILED=1 +fi + +echo validating generated files script/generate.sh --check || FAILED=1 if [ -n "$FAILED" ]; then diff --git a/script/metadata.sh b/script/metadata.sh new file mode 100755 index 00000000000..f2b9fc5f407 --- /dev/null +++ b/script/metadata.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#/ script/metadata.sh runs ./tools/cmd/metadata in the repository root with the given arguments + +set -e + +CDPATH="" cd -- "$(dirname -- "$0")/.." +REPO_DIR="$(pwd)" + +( + cd tools/metadata + go build -o "$REPO_DIR"/bin/metadata +) + +exec bin/metadata "$@" diff --git a/tools/go.mod b/tools/go.mod index ea4bd46a989..8085d1a1ce9 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,20 +3,15 @@ module tools go 1.20 require ( - github.com/alecthomas/kong v0.8.0 - github.com/getkin/kin-openapi v0.119.0 - github.com/google/go-github/v55 v55.0.0 - github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/mod v0.12.0 - golang.org/x/sync v0.3.0 + 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 + golang.org/x/sync v0.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/cloudflare/circl v1.3.3 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/swag v0.22.4 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -24,8 +19,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/perimeterx/marshmallow v1.1.4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/stretchr/testify v1.8.4 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 4b0b4f21b92..46bc40af389 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,19 +1,13 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= -github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s= -github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= +github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= +github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.119.0 h1:FIn6hYX3huTFV28GS1hotceX8MAsGGf/c+jFta5XRaE= -github.com/getkin/kin-openapi v0.119.0/go.mod h1:Kc71dQTNCxy/6sBdhR5dbKoSHwzLCcgygpCzizUy4XA= +github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= +github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= @@ -21,9 +15,10 @@ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogB github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= 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.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= -github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= +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= @@ -41,8 +36,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw= -github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -54,24 +49,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/tools/internal/internal.go b/tools/internal/internal.go deleted file mode 100644 index d9a506195aa..00000000000 --- a/tools/internal/internal.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "fmt" - "go/ast" - "go/parser" - "go/token" - "os" - "path/filepath" - "sort" - "strings" - - "golang.org/x/mod/modfile" - "golang.org/x/mod/module" -) - -// ProjRootDir returns the go-github root directory that contains dir. -// Returns an error if dir is not in a go-github root. -func ProjRootDir(dir string) (string, error) { - dir, err := filepath.Abs(dir) - if err != nil { - return "", err - } - ok, err := isGoGithubRoot(dir) - if err != nil { - return "", err - } - if ok { - return dir, nil - } - parent := filepath.Dir(dir) - if parent == dir { - return "", fmt.Errorf("not in a go-github root") - } - return ProjRootDir(parent) -} - -// isGoGithubRoot determines whether dir is the repo root of go-github. It does -// this by checking whether go.mod exists and contains a module directive with -// the path "github.com/google/go-github/vNN". -func isGoGithubRoot(dir string) (bool, error) { - filename := filepath.Join(dir, "go.mod") - b, err := os.ReadFile(filename) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - mf, err := modfile.ParseLax(filename, b, nil) - if err != nil { - // an invalid go.mod file is not a go-github root, so we don't care about the error - return false, nil - } - if mf.Module == nil { - return false, nil - } - // This gets rid of the /vN suffix if it exists. - base, _, ok := module.SplitPathVersion(mf.Module.Mod.Path) - if !ok { - return false, nil - } - return base == "github.com/google/go-github", nil -} - -type serviceMethod struct { - receiverName string - methodName string - filename string -} - -func (m *serviceMethod) name() string { - return fmt.Sprintf("%s.%s", m.receiverName, m.methodName) -} - -func getServiceMethods(dir string) ([]*serviceMethod, error) { - dirEntries, err := os.ReadDir(dir) - if err != nil { - return nil, err - } - var serviceMethods []*serviceMethod - for _, filename := range dirEntries { - m, err := getServiceMethodsFromFile(filepath.Join(dir, filename.Name())) - if err != nil { - return nil, err - } - serviceMethods = append(serviceMethods, m...) - } - sort.Slice(serviceMethods, func(i, j int) bool { - if serviceMethods[i].filename != serviceMethods[j].filename { - return serviceMethods[i].filename < serviceMethods[j].filename - } - return serviceMethods[i].name() < serviceMethods[j].name() - }) - return serviceMethods, nil -} - -// getServiceMethodsFromFile is like getServiceMethodsFromFileDST, but uses -// the AST package instead of the DST package. -func getServiceMethodsFromFile(filename string) ([]*serviceMethod, error) { - if !strings.HasSuffix(filename, ".go") || - strings.HasSuffix(filename, "_test.go") { - return nil, nil - } - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) - if err != nil { - return nil, err - } - - // Only look at the github package - if f.Name.Name != "github" { - return nil, nil - } - var serviceMethods []*serviceMethod - ast.Inspect(f, func(n ast.Node) bool { - decl, ok := n.(*ast.FuncDecl) - if !ok { - return true - } - if decl.Recv == nil || len(decl.Recv.List) != 1 { - return true - } - se, ok := decl.Recv.List[0].Type.(*ast.StarExpr) - if !ok { - return true - } - id, ok := se.X.(*ast.Ident) - if !ok { - return true - } - receiverName := id.Name - methodName := decl.Name.Name - - // We only want exported methods on exported types. - // The receiver must either end with Service or be named Client. - // The exception is github.go, which contains Client methods we want to skip. - - if !ast.IsExported(methodName) || !ast.IsExported(receiverName) { - return true - } - if receiverName != "Client" && !strings.HasSuffix(receiverName, "Service") { - return true - } - if receiverName == "Client" && filepath.Base(filename) == "github.go" { - return true - } - serviceMethods = append(serviceMethods, &serviceMethod{ - receiverName: receiverName, - methodName: methodName, - filename: filename, - }) - return true - }) - return serviceMethods, nil -} diff --git a/tools/internal/metadata.go b/tools/internal/metadata.go deleted file mode 100644 index 2b9abdf7c5e..00000000000 --- a/tools/internal/metadata.go +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "bytes" - "context" - "encoding/json" - "go/ast" - "go/format" - "go/parser" - "go/printer" - "go/token" - "io/fs" - "net/url" - "os" - "path/filepath" - "regexp" - "sort" - "strings" - "sync" - - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" - "gopkg.in/yaml.v3" -) - -type OperationDesc struct { - Method string `yaml:"method,omitempty" json:"method,omitempty"` - EndpointURL string `yaml:"endpoint_url,omitempty" json:"endpoint_url,omitempty"` - DocumentationURL string `yaml:"documentation_url,omitempty" json:"documentation_url,omitempty"` - Summary string `yaml:"summary,omitempty" json:"summary,omitempty"` -} - -type Operation struct { - OpenAPI OperationDesc `yaml:"openapi,omitempty" json:"openapi,omitempty"` - Override OperationDesc `yaml:"override,omitempty" json:"override,omitempty"` - OpenAPIFiles []string `yaml:"openapi_files,omitempty" json:"openapi_files,omitempty"` - GoMethods []string `yaml:"go_methods,omitempty" json:"go_methods,omitempty"` -} - -type operationJSON struct { - Method string `json:"method,omitempty"` - EndpointURL string `json:"endpoint_url,omitempty"` - Summary string `json:"summary,omitempty"` - DocumentURL string `json:"documentation_url,omitempty"` - Plans []string `json:"plans,omitempty"` - GoMethods []string `json:"go_methods,omitempty"` -} - -func (o *Operation) MarshalJSON() ([]byte, error) { - return json.Marshal(&operationJSON{ - Method: o.Method(), - EndpointURL: o.EndpointURL(), - Summary: o.Summary(), - Plans: o.Plans(), - DocumentURL: o.DocumentationURL(), - GoMethods: o.GoMethods, - }) -} - -func (o *Operation) Plans() []string { - var plans []string - if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { - return strings.HasSuffix(s, "api.github.com.json") - }) { - plans = append(plans, "public") - } - if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { - return strings.HasSuffix(s, "ghec.json") - }) { - plans = append(plans, "ghec") - } - if slices.ContainsFunc(o.OpenAPIFiles, func(s string) bool { - return strings.Contains(s, "/ghes") - }) { - plans = append(plans, "ghes") - } - return plans -} - -func (o *Operation) Method() string { - if o.Override.Method != "" { - return o.Override.Method - } - return o.OpenAPI.Method -} - -func (o *Operation) EndpointURL() string { - if o.Override.EndpointURL != "" { - return o.Override.EndpointURL - } - return o.OpenAPI.EndpointURL -} - -func (o *Operation) DocumentationURL() string { - if o.Override.DocumentationURL != "" { - return o.Override.DocumentationURL - } - return o.OpenAPI.DocumentationURL -} - -func (o *Operation) Summary() string { - if o.Override.Summary != "" { - return o.Override.Summary - } - return o.OpenAPI.Summary -} - -func (o *Operation) Less(other *Operation) bool { - if o.EndpointURL() != other.EndpointURL() { - return o.EndpointURL() < other.EndpointURL() - } - return o.Method() < other.Method() -} - -// matchesOpenAPIDesc returns true if this is describing the same operation as desc -// based on endpoint and method. -func (o *Operation) matchesOpenAPIDesc(desc OperationDesc) bool { - if o.Method() != desc.Method { - return false - } - return normalizedURL(o.EndpointURL()) == normalizedURL(desc.EndpointURL) -} - -var normalizedURLs = map[string]string{} -var normalizedURLsMu sync.Mutex - -// normalizedURL returns an endpoint with all templated path parameters replaced with *. -func normalizedURL(u string) string { - normalizedURLsMu.Lock() - defer normalizedURLsMu.Unlock() - n, ok := normalizedURLs[u] - if ok { - return n - } - parts := strings.Split(u, "/") - for i, p := range parts { - if len(p) > 0 && p[0] == '{' { - parts[i] = "*" - } - } - n = strings.Join(parts, "/") - normalizedURLs[u] = n - return n -} - -type Metadata struct { - UndocumentedMethods []string `yaml:"undocumented_methods,omitempty"` - Operations []*Operation `yaml:"operations,omitempty"` -} - -func LoadMetadataFile(filename string, opFile *Metadata) (errOut error) { - f, err := os.Open(filename) - if err != nil { - return err - } - defer func() { - e := f.Close() - if errOut == nil { - errOut = e - } - }() - return yaml.NewDecoder(f).Decode(opFile) -} - -func (m *Metadata) SaveFile(filename string) (errOut error) { - f, err := os.Create(filename) - if err != nil { - panic(err) - } - defer func() { - e := f.Close() - if errOut == nil { - errOut = e - } - }() - enc := yaml.NewEncoder(f) - enc.SetIndent(2) - return enc.Encode(m) -} - -func (m *Metadata) addOperation(filename string, desc OperationDesc) { - for _, op := range m.Operations { - if !op.matchesOpenAPIDesc(desc) { - continue - } - if len(op.OpenAPIFiles) == 0 { - op.OpenAPIFiles = append(op.OpenAPIFiles, filename) - op.OpenAPI = desc - return - } - // just append to files, but only add the first ghes file - if !strings.Contains(filename, "/ghes") { - op.OpenAPIFiles = append(op.OpenAPIFiles, filename) - return - } - for _, f := range op.OpenAPIFiles { - if strings.Contains(f, "/ghes") { - return - } - } - op.OpenAPIFiles = append(op.OpenAPIFiles, filename) - return - } - m.Operations = append(m.Operations, &Operation{ - OpenAPIFiles: []string{filename}, - OpenAPI: desc, - }) -} - -func (m *Metadata) operationsForMethod(method string) []*Operation { - var operations []*Operation - for _, op := range m.Operations { - if !slices.Contains(op.GoMethods, method) { - continue - } - operations = append(operations, op) - } - sort.Slice(operations, func(i, j int) bool { - return operations[i].Less(operations[j]) - }) - return operations -} - -func (m *Metadata) UpdateFromGithub(ctx context.Context, client contentsClient, ref string) error { - descs, err := getDescriptions(ctx, client, ref) - if err != nil { - return err - } - for _, op := range m.Operations { - op.OpenAPIFiles = op.OpenAPIFiles[:0] - } - for _, desc := range descs { - for p, pathItem := range desc.description.Paths { - for method, op := range pathItem.Operations() { - docURL := "" - if op.ExternalDocs != nil { - docURL = op.ExternalDocs.URL - } - m.addOperation(desc.filename, OperationDesc{ - Method: method, - EndpointURL: p, - DocumentationURL: docURL, - Summary: op.Summary, - }) - } - } - } - sort.Slice(m.Operations, func(i, j int) bool { - return m.Operations[i].Less(m.Operations[j]) - }) - return nil -} - -// UpdateDocLinks updates the code comments in dir with doc urls from metadata. -func UpdateDocLinks(meta *Metadata, dir string) error { - return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { - if err != nil { - return err - } - if d.IsDir() || - !strings.HasSuffix(path, ".go") || - strings.HasSuffix(path, "_test.go") { - return nil - } - content, err := os.ReadFile(path) - if err != nil { - return err - } - updatedContent, err := updateDocsLinksInFile(meta, content) - if err != nil { - return err - } - if bytes.Equal(content, updatedContent) { - return nil - } - f, err := os.Create(path) - if err != nil { - return err - } - _, err = f.Write(updatedContent) - if err != nil { - return err - } - return f.Close() - }) -} - -// updateDocsLinksInFile updates in the code comments in content with doc urls from metadata. -func updateDocsLinksInFile(metadata *Metadata, content []byte) ([]byte, error) { - fset := token.NewFileSet() - node, err := parser.ParseFile(fset, "", content, parser.ParseComments) - if err != nil { - return nil, err - } - - // ignore files where package is not github - if node.Name.Name != "github" { - return content, nil - } - - ast.Inspect(node, func(n ast.Node) bool { - return updateDocsLinksForNode(metadata, n) - }) - - var buf bytes.Buffer - err = printer.Fprint(&buf, fset, node) - if err != nil { - return nil, err - } - return format.Source(buf.Bytes()) -} - -var ( - docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s*(https?://\S+)`) - emptyLineRE = regexp.MustCompile(`^\s*(//\s*)$`) -) - -func updateDocsLinksForNode(metadata *Metadata, n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok || !fn.Name.IsExported() { - return true - } - methodName := fn.Name.Name - - // Get the method's receiver. It can be either an identifier or a pointer to an identifier. - // This assumes all receivers are named and we don't have something like: `func (Client) Foo()`. - receiverType := "" - if fn.Recv != nil { - switch x := fn.Recv.List[0].Type.(type) { - case *ast.Ident: - receiverType = x.Name - case *ast.StarExpr: - receiverType = x.X.(*ast.Ident).Name - } - } - if !ast.IsExported(receiverType) { - return true - } - - linksMap := map[string]struct{}{} - ops := metadata.operationsForMethod(strings.Join([]string{receiverType, methodName}, ".")) - for _, op := range ops { - linksMap[op.DocumentationURL()] = struct{}{} - } - - // create copy of comment group with non-matching doc links removed - if fn.Doc == nil { - fn.Doc = &ast.CommentGroup{} - } - fnComments := make([]*ast.Comment, 0, len(fn.Doc.List)) - for _, comment := range fn.Doc.List { - match := docLineRE.FindStringSubmatch(comment.Text) - if match == nil { - fnComments = append(fnComments, comment) - continue - } - matchesLink := false - for link := range linksMap { - if sameDocLink(match[2], link) { - matchesLink = true - delete(linksMap, link) - break - } - } - if matchesLink { - fnComments = append(fnComments, comment) - } - } - - // remove trailing empty lines - for len(fnComments) > 0 { - if !emptyLineRE.MatchString(fnComments[len(fnComments)-1].Text) { - break - } - fnComments = fnComments[:len(fnComments)-1] - } - - // add an empty line before adding doc links - if len(linksMap) > 0 && - len(fnComments) > 0 && - !emptyLineRE.MatchString(fnComments[len(fnComments)-1].Text) { - fnComments = append(fnComments, &ast.Comment{Text: "//"}) - } - - docLinks := maps.Keys(linksMap) - sort.Strings(docLinks) - - for _, dl := range docLinks { - fnComments = append( - fnComments, - &ast.Comment{ - Text: "// GitHub API docs: " + normalizeDocURLPath(dl), - }, - ) - } - fn.Doc.List = fnComments - return true -} - -const docURLPrefix = "https://docs.github.com/rest/" - -var docURLPrefixRE = regexp.MustCompile(`^https://docs\.github\.com.*/rest/`) - -func normalizeDocURLPath(u string) string { - u = strings.Replace(u, "/en/", "/", 1) - pre := docURLPrefixRE.FindString(u) - if pre == "" { - return u - } - if strings.Contains(u, "docs.github.com/enterprise-cloud@latest/") { - // remove unsightly double slash - // https://docs.github.com/enterprise-cloud@latest/ - return strings.ReplaceAll( - u, - "docs.github.com/enterprise-cloud@latest//", - "docs.github.com/enterprise-cloud@latest/", - ) - } - if strings.Contains(u, "docs.github.com/enterprise-server") { - return u - } - return docURLPrefix + strings.TrimPrefix(u, pre) -} - -// sameDocLink returns true if the two doc links are going to end up rendering the same page pointed -// to the same section. -// -// If a url path starts with *./rest/ it ignores query parameters and everything before /rest/ when -// making the comparison. -func sameDocLink(left, right string) bool { - if !docURLPrefixRE.MatchString(left) || - !docURLPrefixRE.MatchString(right) { - return left == right - } - left = stripURLQuery(normalizeDocURLPath(left)) - right = stripURLQuery(normalizeDocURLPath(right)) - return left == right -} - -func stripURLQuery(u string) string { - p, err := url.Parse(u) - if err != nil { - return u - } - p.RawQuery = "" - return p.String() -} diff --git a/tools/internal/openapi_test.go b/tools/internal/openapi_test.go deleted file mode 100644 index 905c58be56e..00000000000 --- a/tools/internal/openapi_test.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "context" - "io" - "net/http" - "strings" - "testing" - - "github.com/google/go-github/v55/github" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type dummyContentsClient struct { - t *testing.T - downloadContents func(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) - getContents func(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) -} - -func (d dummyContentsClient) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) { - d.t.Helper() - return d.downloadContents(ctx, owner, repo, filepath, opts) -} - -func (d dummyContentsClient) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) { - d.t.Helper() - return d.getContents(ctx, owner, repo, path, opts) -} - -func TestGetDescriptions(t *testing.T) { - ctx := context.Background() - client := dummyContentsClient{ - t: t, - getContents: func(_ context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) { - t.Helper() - assert.Equal(t, descriptionsOwnerName, owner) - assert.Equal(t, descriptionsRepoName, repo) - assert.Equal(t, "descriptions", path) - assert.Equal(t, &github.RepositoryContentGetOptions{Ref: "main"}, opts) - dir := []*github.RepositoryContent{ - {Name: github.String("ghes-3.1")}, - {Name: github.String("ghes-3.2")}, - {Name: github.String("ignore_me")}, - {Name: github.String("api.github.com")}, - {Name: github.String("ghec")}, - } - return nil, dir, &github.Response{Response: &http.Response{StatusCode: 200}}, nil - }, - downloadContents: func(_ context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) { - assert.Equal(t, descriptionsOwnerName, owner) - assert.Equal(t, descriptionsRepoName, repo) - assert.Equal(t, &github.RepositoryContentGetOptions{Ref: "main"}, opts) - contents := `{"info": {"version": "1.2.3"}}` - switch filepath { - case "descriptions/api.github.com/api.github.com.json": - case "descriptions/ghes-3.1/ghes-3.1.json": - case "descriptions/ghes-3.2/ghes-3.2.json": - case "descriptions/ghec/ghec.json": - default: - t.Errorf("unexpected filepath: %s", filepath) - } - return io.NopCloser(strings.NewReader(contents)), &github.Response{Response: &http.Response{StatusCode: 200}}, nil - }, - } - wantFiles := []string{ - "descriptions/api.github.com/api.github.com.json", - "descriptions/ghec/ghec.json", - "descriptions/ghes-3.2/ghes-3.2.json", - "descriptions/ghes-3.1/ghes-3.1.json", - } - got, err := getDescriptions(ctx, client, "main") - require.NoError(t, err) - require.Equal(t, len(wantFiles), len(got)) - for i := range wantFiles { - require.Equal(t, wantFiles[i], got[i].filename) - require.Equal(t, "1.2.3", got[i].description.Info.Version) - } -} diff --git a/tools/internal/validate.go b/tools/internal/validate.go deleted file mode 100644 index ab22316deca..00000000000 --- a/tools/internal/validate.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "fmt" - "sort" - "strings" - - "golang.org/x/exp/slices" -) - -// ValidateMetadata returns a list of issues with the metadata file. An error means -// there was an error validating the file, not that there are issues with the file. -func ValidateMetadata(dir string, meta *Metadata) ([]string, error) { - undocumentedMethods, err := getUndocumentedMethods(dir, meta) - if err != nil { - return nil, err - } - var result []string - for _, m := range undocumentedMethods { - msg := fmt.Sprintf("Undocumented method %s. Please add it to metadata.", m.name()) - result = append(result, msg) - } - metaMethodMap := map[string]bool{} - for _, m := range meta.UndocumentedMethods { - metaMethodMap[m] = true - } - methodOperations := map[string][]*Operation{} - for _, op := range meta.Operations { - for _, m := range op.GoMethods { - metaMethodMap[m] = true - methodOperations[m] = append(methodOperations[m], op) - } - } - var metaMethods []string - for m := range metaMethodMap { - metaMethods = append(metaMethods, m) - } - sort.Strings(metaMethods) - missing, err := missingMethods(dir, metaMethods) - if err != nil { - return nil, err - } - for _, m := range missing { - msg := fmt.Sprintf("Method %s in metadata does not exist in github package.", m) - result = append(result, msg) - } - for _, m := range meta.UndocumentedMethods { - if len(methodOperations[m]) == 0 { - continue - } - var ops []string - for _, op := range methodOperations[m] { - ops = append(ops, fmt.Sprintf("%s %s", op.Method(), op.EndpointURL())) - } - msg := fmt.Sprintf("Method %s is listed as undocumented in metadata and also in these operations: %s", m, strings.Join(ops, ", ")) - result = append(result, msg) - } - return result, nil -} - -// getUndocumentedMethods returns a list of methods that are not mapped to any operation in metadata.yaml -func getUndocumentedMethods(dir string, metadata *Metadata) ([]*serviceMethod, error) { - var result []*serviceMethod - methods, err := getServiceMethods(dir) - if err != nil { - return nil, err - } - for _, method := range methods { - ops := metadata.operationsForMethod(method.name()) - if len(ops) > 0 { - continue - } - if slices.Contains(metadata.UndocumentedMethods, method.name()) { - continue - } - result = append(result, method) - } - return result, nil -} - -// missingMethods returns the set from methods that do not exist in the github package. -func missingMethods(dir string, methods []string) ([]string, error) { - var result []string - existingMap := map[string]bool{} - sm, err := getServiceMethods(dir) - if err != nil { - return nil, err - } - for _, method := range sm { - existingMap[method.name()] = true - } - for _, m := range methods { - if !existingMap[m] { - result = append(result, m) - } - } - return result, nil -} diff --git a/tools/cmd/metadata/metadata.go b/tools/metadata/main.go similarity index 52% rename from tools/cmd/metadata/metadata.go rename to tools/metadata/main.go index 7563218b05f..e91ab130244 100644 --- a/tools/cmd/metadata/metadata.go +++ b/tools/metadata/main.go @@ -11,13 +11,9 @@ import ( "fmt" "os" "path/filepath" - "sort" - "strings" - - "tools/internal" "github.com/alecthomas/kong" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" ) var helpVars = kong.Vars{ @@ -25,50 +21,44 @@ var helpVars = kong.Vars{ "format_help": `Format metadata.yaml.`, "validate_help": `Validate that metadata.yaml is consistent with source code.`, "unused_ops_help": `List operations in metadata.yaml that don't have any associated go methods'.`, + "canonize_help": `Update metadata.yaml to use canonical operation names.`, } type rootCmd struct { - WorkingDir string `kong:"short=C,default='.',help='Working directory. Must be within a go-github root.'"` + WorkingDir string `kong:"short=C,default=.,help='Working directory. Must be within a go-github root.'"` Filename string `kong:"help='Path to metadata.yaml. Defaults to /metadata.yaml.'"` GithubDir string `kong:"help='Path to the github package. Defaults to /github.'"` + GithubURL string `kong:"hidden,default='https://api.github.com'"` UpdateMetadata updateMetadataCmd `kong:"cmd,help=${update_help}"` UpdateUrls updateUrlsCmd `kong:"cmd,help='Update documentation URLs in the Go source files in the github directory to match the urls in the metadata file.'"` Format formatCmd `kong:"cmd,help=${format_help}"` Validate validateCmd `kong:"cmd,help=${validate_help}"` UnusedOps unusedOpsCmd `kong:"cmd,help=${unused_ops_help}"` + Canonize canonizeCmd `kong:"cmd,help=${canonize_help}"` } -func (c *rootCmd) metadata() (string, *internal.Metadata, error) { +func (c *rootCmd) metadata() (string, *metadata, error) { filename := c.Filename if filename == "" { - dir, err := internal.ProjRootDir(c.WorkingDir) - if err != nil { - return "", nil, err - } - filename = filepath.Join(dir, "metadata.yaml") + filename = filepath.Join(c.WorkingDir, "metadata.yaml") } - var meta internal.Metadata - err := internal.LoadMetadataFile(filename, &meta) + meta, err := loadMetadataFile(filename) if err != nil { return "", nil, err } - return filename, &meta, nil + return filename, meta, nil } -func (c *rootCmd) githubDir() (string, error) { - dir := c.GithubDir - if dir == "" { - githubDir, err := internal.ProjRootDir(c.WorkingDir) - if err != nil { - return "", err - } - dir = filepath.Join(githubDir, "github") +func githubClient(apiURL string) (*github.Client, error) { + token := os.Getenv("GITHUB_TOKEN") + if token == "" { + return nil, fmt.Errorf("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") } - return dir, nil + return github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, "") } type updateMetadataCmd struct { - Ref string `kong:"default='main',help='git ref to pull OpenAPI descriptions from'"` + Ref string `kong:"default=main,help='git ref to pull OpenAPI descriptions from'"` } func (c *updateMetadataCmd) Run(root *rootCmd) error { @@ -77,16 +67,16 @@ func (c *updateMetadataCmd) Run(root *rootCmd) error { if err != nil { return err } - token := os.Getenv("GITHUB_TOKEN") - if token == "" { - return fmt.Errorf("GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope") + client, err := githubClient(root.GithubURL) + if err != nil { + return err } - client := github.NewClient(nil).WithAuthToken(token).Repositories - err = meta.UpdateFromGithub(ctx, client, c.Ref) + + err = meta.updateFromGithub(ctx, client, c.Ref) if err != nil { return err } - return meta.SaveFile(filename) + return meta.saveFile(filename) } type formatCmd struct{} @@ -96,32 +86,43 @@ func (c *formatCmd) Run(root *rootCmd) error { if err != nil { return err } - sort.Slice(meta.Operations, func(i, j int) bool { - return meta.Operations[i].Less(meta.Operations[j]) - }) - return meta.SaveFile(filename) + return meta.saveFile(filename) } -type validateCmd struct{} +type validateCmd struct { + CheckGithub bool `kong:"help='Check that metadata.yaml is consistent with the OpenAPI descriptions in github.com/github/rest-api-description.'"` +} -func (c *validateCmd) Run(root *rootCmd) error { - githubDir, err := root.githubDir() - if err != nil { - return err - } +func (c *validateCmd) Run(k *kong.Context, root *rootCmd) error { + ctx := context.Background() + githubDir := filepath.Join(root.WorkingDir, "github") filename, meta, err := root.metadata() if err != nil { return err } - issues, err := internal.ValidateMetadata(githubDir, meta) + issues, err := validateMetadata(githubDir, meta) if err != nil { return err } + // don't waste time checking github if there are already issues + if c.CheckGithub && len(issues) == 0 { + client, err := githubClient(root.GithubURL) + if err != nil { + return err + } + msg, err := validateGitCommit(ctx, client, meta) + if err != nil { + return err + } + if msg != "" { + issues = append(issues, msg) + } + } if len(issues) == 0 { return nil } for _, issue := range issues { - fmt.Fprintln(os.Stderr, issue) + fmt.Fprintln(k.Stderr, issue) } return fmt.Errorf("found %d issues in %s", len(issues), filename) } @@ -129,15 +130,12 @@ func (c *validateCmd) Run(root *rootCmd) error { type updateUrlsCmd struct{} func (c *updateUrlsCmd) Run(root *rootCmd) error { - githubDir, err := root.githubDir() - if err != nil { - return err - } + githubDir := filepath.Join(root.WorkingDir, "github") _, meta, err := root.metadata() if err != nil { return err } - err = internal.UpdateDocLinks(meta, githubDir) + err = updateDocLinks(meta, githubDir) return err } @@ -150,9 +148,10 @@ func (c *unusedOpsCmd) Run(root *rootCmd) error { if err != nil { return err } - var unused []*internal.Operation - for _, op := range meta.Operations { - if len(op.GoMethods) == 0 { + var unused []*operation + for _, op := range meta.operations() { + goMethods := meta.operationMethods(op.Name) + if len(goMethods) == 0 { unused = append(unused, op) } } @@ -167,18 +166,44 @@ func (c *unusedOpsCmd) Run(root *rootCmd) error { } fmt.Println("") for _, op := range unused { - fmt.Printf("%s %s\n", op.Method(), op.EndpointURL()) - fmt.Printf("summary: %s\n", op.Summary()) - fmt.Printf("plans: %s\n", strings.Join(op.Plans(), ", ")) - fmt.Printf("doc: %s\n", op.DocumentationURL()) + fmt.Println(op.Name) + fmt.Printf("doc: %s\n", op.DocumentationURL) fmt.Println("") } return nil } +type canonizeCmd struct{} + +func (c *canonizeCmd) Run(root *rootCmd) error { + filename, meta, err := root.metadata() + if err != nil { + return err + } + err = meta.canonizeMethodOperations() + if err != nil { + return err + } + return meta.saveFile(filename) +} + func main() { + err := run(os.Args[1:], nil) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func run(args []string, opts []kong.Option) error { var cmd rootCmd - k := kong.Parse(&cmd, helpVars) - err := k.Run() - k.FatalIfErrorf(err) + parser, err := kong.New(&cmd, append(opts, helpVars)...) + if err != nil { + return err + } + k, err := parser.Parse(args) + if err != nil { + return err + } + return k.Run() } diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go new file mode 100644 index 00000000000..09886770f81 --- /dev/null +++ b/tools/metadata/main_test.go @@ -0,0 +1,407 @@ +// 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 main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/fs" + "net/http" + "net/http/httptest" + "net/url" + "os" + "path" + "path/filepath" + "strings" + "testing" + + "github.com/alecthomas/kong" + "github.com/getkin/kin-openapi/openapi3" + "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v56/github" +) + +func TestUpdateURLs(t *testing.T) { + res := runTest(t, "testdata/update-urls", "update-urls") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func TestValidate(t *testing.T) { + t.Run("invalid", func(t *testing.T) { + res := runTest(t, "testdata/validate_invalid", "validate") + res.assertErr("found 4 issues in") + res.assertOutput("", ` +Method AService.MissingFromMetadata does not exist in metadata.yaml. Please add it. +Method AService.Get has operation which is does not use the canonical name. You may be able to automatically fix this by running 'script/metadata.sh canonize': GET /a/{a_id_noncanonical}. +Name in override_operations does not exist in operations or openapi_operations: GET /a/{a_id_noncanonical2} +Name in override_operations does not exist in operations or openapi_operations: GET /fake/{a_id} +`) + res.checkGolden() + }) + + t.Run("valid", func(t *testing.T) { + res := runTest(t, "testdata/validate_valid", "validate") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() + }) +} + +func TestUpdateMetadata(t *testing.T) { + testServer := newTestServer(t, "main", map[string]interface{}{ + "api.github.com/api.github.com.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghec/ghec.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-3.9/ghes-3.9.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-3.10/ghes-3.10.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + "ghes-2.22/ghes-2.22.json": openapi3.T{ + Paths: openapi3.Paths{ + "/a/b/{a_id}": &openapi3.PathItem{ + Get: &openapi3.Operation{ + ExternalDocs: &openapi3.ExternalDocs{ + URL: "https://docs.github.com/rest/reference/a", + }, + }, + }, + }, + }, + }) + + res := runTest(t, "testdata/update-metadata", "update-metadata", "--github-url", testServer.URL) + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func TestCanonize(t *testing.T) { + res := runTest(t, "testdata/canonize", "canonize") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func TestFormat(t *testing.T) { + res := runTest(t, "testdata/format", "format") + res.assertOutput("", "") + res.assertNoErr() + res.checkGolden() +} + +func updateGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { + t.Helper() + assertNilError(t, os.RemoveAll(goldenDir)) + assertNilError(t, filepath.WalkDir(resultDir, func(path string, d fs.DirEntry, err error) error { + if err != nil || d.IsDir() { + return err + } + relName := mustRel(t, resultDir, path) + origName := filepath.Join(origDir, relName) + _, err = os.Stat(origName) + if err != nil { + if os.IsNotExist(err) { + err = os.MkdirAll(filepath.Dir(filepath.Join(goldenDir, relName)), d.Type()) + if err != nil { + return err + } + return copyFile(path, filepath.Join(goldenDir, relName)) + } + return err + } + resContent, err := os.ReadFile(path) + if err != nil { + return err + } + origContent, err := os.ReadFile(origName) + if err != nil { + return err + } + if bytes.Equal(resContent, origContent) { + return nil + } + return copyFile(path, filepath.Join(goldenDir, relName)) + })) +} + +func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { + t.Helper() + if os.Getenv("UPDATE_GOLDEN") != "" { + updateGoldenDir(t, origDir, resultDir, goldenDir) + return + } + checked := map[string]bool{} + _, err := os.Stat(goldenDir) + if err == nil { + assertNilError(t, filepath.Walk(goldenDir, func(wantPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, goldenDir, wantPath) + if err != nil || info.IsDir() { + return err + } + assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) + checked[relPath] = true + return nil + })) + } + assertNilError(t, filepath.Walk(origDir, func(wantPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, origDir, wantPath) + if err != nil || info.IsDir() || checked[relPath] { + return err + } + assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) + checked[relPath] = true + return nil + })) + assertNilError(t, filepath.Walk(resultDir, func(resultPath string, info fs.FileInfo, err error) error { + relPath := mustRel(t, resultDir, resultPath) + if err != nil || info.IsDir() || checked[relPath] { + return err + } + return fmt.Errorf("found unexpected file:\n%s", relPath) + })) +} + +func mustRel(t *testing.T, base, target string) string { + t.Helper() + rel, err := filepath.Rel(base, target) + assertNilError(t, err) + return rel +} + +func copyDir(t *testing.T, dst, src string) error { + fmt.Println("dst", dst) + dst, err := filepath.Abs(dst) + if err != nil { + return err + } + return filepath.Walk(src, func(srcPath string, info fs.FileInfo, err error) error { + if err != nil || info.IsDir() { + return err + } + dstPath := filepath.Join(dst, mustRel(t, src, srcPath)) + err = copyFile(srcPath, dstPath) + return err + }) +} + +func copyFile(src, dst string) (errOut error) { + srcDirStat, err := os.Stat(filepath.Dir(src)) + if err != nil { + return err + } + err = os.MkdirAll(filepath.Dir(dst), srcDirStat.Mode()) + if err != nil { + return err + } + dstFile, err := os.Create(dst) + if err != nil { + return err + } + defer func() { + e := dstFile.Close() + if errOut == nil { + errOut = e + } + }() + srcFile, err := os.Open(src) + if err != nil { + return err + } + defer func() { + e := srcFile.Close() + if errOut == nil { + errOut = e + } + }() + _, err = io.Copy(dstFile, srcFile) + return err +} + +type testRun struct { + t *testing.T + workDir string + srcDir string + stdOut bytes.Buffer + stdErr bytes.Buffer + err error +} + +func (r testRun) checkGolden() { + r.t.Helper() + checkGoldenDir(r.t, r.srcDir, r.workDir, filepath.Join("testdata", "golden", r.t.Name())) +} + +func (r testRun) assertOutput(stdout, stderr string) { + r.t.Helper() + assertEqualStrings(r.t, strings.TrimSpace(stdout), strings.TrimSpace(r.stdOut.String())) + assertEqualStrings(r.t, strings.TrimSpace(stderr), strings.TrimSpace(r.stdErr.String())) +} + +func (r testRun) assertNoErr() { + r.t.Helper() + assertNilError(r.t, r.err) +} + +func (r testRun) assertErr(want string) { + r.t.Helper() + if r.err == nil { + r.t.Error("expected error") + return + } + if !strings.Contains(r.err.Error(), want) { + r.t.Errorf("expected error to contain %q, got %q", want, r.err.Error()) + } +} + +func runTest(t *testing.T, srcDir string, args ...string) testRun { + t.Helper() + srcDir = filepath.FromSlash(srcDir) + res := testRun{ + t: t, + workDir: t.TempDir(), + srcDir: srcDir, + } + err := copyDir(t, res.workDir, srcDir) + if err != nil { + t.Error(err) + return res + } + res.err = run( + append(args, "-C", res.workDir), + []kong.Option{kong.Writers(&res.stdOut, &res.stdErr)}, + ) + return res +} + +func newTestServer(t *testing.T, ref string, files map[string]interface{}) *httptest.Server { + t.Helper() + jsonHandler := func(wantQuery url.Values, val interface{}) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + gotQuery := r.URL.Query() + queryDiff := cmp.Diff(wantQuery, gotQuery) + if queryDiff != "" { + t.Errorf("query mismatch for %s (-want +got):\n%s", r.URL.Path, queryDiff) + } + w.WriteHeader(200) + err := json.NewEncoder(w).Encode(val) + if err != nil { + panic(err) + } + } + } + repoPath := "/api/v3/repos/github/rest-api-description" + emptyQuery := url.Values{} + refQuery := url.Values{"ref": []string{ref}} + mux := http.NewServeMux() + server := httptest.NewServer(mux) + mux.HandleFunc( + path.Join(repoPath, "commits", ref), + jsonHandler(emptyQuery, &github.RepositoryCommit{SHA: github.String("s")}), + ) + var descriptionsContent []*github.RepositoryContent + for name, content := range files { + descriptionsContent = append(descriptionsContent, &github.RepositoryContent{ + Name: github.String(path.Base(path.Dir(name))), + }) + mux.HandleFunc( + path.Join(repoPath, "contents/descriptions", path.Dir(name)), + jsonHandler(refQuery, []*github.RepositoryContent{ + { + Name: github.String(path.Base(name)), + DownloadURL: github.String(server.URL + "/dl/" + name), + }, + }), + ) + mux.HandleFunc( + path.Join("/dl", name), + jsonHandler(emptyQuery, content), + ) + } + mux.HandleFunc( + path.Join(repoPath, "contents/descriptions"), + jsonHandler(refQuery, descriptionsContent), + ) + t.Cleanup(server.Close) + t.Setenv("GITHUB_TOKEN", "fake token") + return server +} + +func assertEqualStrings(t *testing.T, want, got string) { + t.Helper() + diff := cmp.Diff(want, got) + if diff != "" { + t.Error(diff) + } +} + +func assertEqualFiles(t *testing.T, want, got string) { + t.Helper() + wantBytes, err := os.ReadFile(want) + if !assertNilError(t, err) { + return + } + wantBytes = bytes.ReplaceAll(wantBytes, []byte("\r\n"), []byte("\n")) + gotBytes, err := os.ReadFile(got) + if !assertNilError(t, err) { + return + } + gotBytes = bytes.ReplaceAll(gotBytes, []byte("\r\n"), []byte("\n")) + if bytes.Equal(wantBytes, gotBytes) { + return + } + diff := cmp.Diff(string(wantBytes), string(gotBytes)) + t.Errorf("files %q and %q differ: %s", want, got, diff) +} + +func assertNilError(t *testing.T, err error) bool { + t.Helper() + if err != nil { + t.Error(err) + return false + } + return true +} diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go new file mode 100644 index 00000000000..2e0e467e972 --- /dev/null +++ b/tools/metadata/metadata.go @@ -0,0 +1,573 @@ +// 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 main + +import ( + "bytes" + "context" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" + "io/fs" + "net/url" + "os" + "path/filepath" + "regexp" + "sort" + "strings" + "sync" + + "github.com/google/go-github/v56/github" + "gopkg.in/yaml.v3" +) + +type operation struct { + Name string `yaml:"name,omitempty" json:"name,omitempty"` + DocumentationURL string `yaml:"documentation_url,omitempty" json:"documentation_url,omitempty"` + OpenAPIFiles []string `yaml:"openapi_files,omitempty" json:"openapi_files,omitempty"` +} + +func (o *operation) equal(other *operation) bool { + if o.Name != other.Name || o.DocumentationURL != other.DocumentationURL { + return false + } + if len(o.OpenAPIFiles) != len(other.OpenAPIFiles) { + return false + } + for i := range o.OpenAPIFiles { + if o.OpenAPIFiles[i] != other.OpenAPIFiles[i] { + return false + } + } + return true +} + +func (o *operation) clone() *operation { + return &operation{ + Name: o.Name, + DocumentationURL: o.DocumentationURL, + OpenAPIFiles: append([]string{}, o.OpenAPIFiles...), + } +} + +func operationsEqual(a, b []*operation) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if !a[i].equal(b[i]) { + return false + } + } + return true +} + +func sortOperations(ops []*operation) { + sort.Slice(ops, func(i, j int) bool { + leftVerb, leftURL := parseOpName(ops[i].Name) + rightVerb, rightURL := parseOpName(ops[j].Name) + if leftURL != rightURL { + return leftURL < rightURL + } + return leftVerb < rightVerb + }) +} + +var normalizedURLs = map[string]string{} +var normalizedURLsMu sync.Mutex + +// normalizedURL returns an endpoint with all templated path parameters replaced with *. +func normalizedURL(u string) string { + normalizedURLsMu.Lock() + defer normalizedURLsMu.Unlock() + n, ok := normalizedURLs[u] + if ok { + return n + } + parts := strings.Split(u, "/") + for i, p := range parts { + if len(p) > 0 && p[0] == '{' { + parts[i] = "*" + } + } + n = strings.Join(parts, "/") + normalizedURLs[u] = n + return n +} + +func normalizedOpName(name string) string { + verb, u := parseOpName(name) + return verb + " " + normalizedURL(u) +} + +func parseOpName(id string) (verb, url string) { + verb, url, _ = strings.Cut(id, " ") + return verb, url +} + +type method struct { + Name string `yaml:"name" json:"name"` + OpNames []string `yaml:"operations,omitempty" json:"operations,omitempty"` +} + +type metadata struct { + Methods []*method `yaml:"methods,omitempty"` + ManualOps []*operation `yaml:"operations,omitempty"` + OverrideOps []*operation `yaml:"operation_overrides,omitempty"` + GitCommit string `yaml:"openapi_commit,omitempty"` + OpenapiOps []*operation `yaml:"openapi_operations,omitempty"` + + mu sync.Mutex + resolvedOps map[string]*operation +} + +func (m *metadata) resolve() { + m.mu.Lock() + defer m.mu.Unlock() + if m.resolvedOps != nil { + return + } + m.resolvedOps = map[string]*operation{} + for _, op := range m.OpenapiOps { + m.resolvedOps[op.Name] = op.clone() + } + for _, op := range m.ManualOps { + m.resolvedOps[op.Name] = op.clone() + } + for _, override := range m.OverrideOps { + _, ok := m.resolvedOps[override.Name] + if !ok { + continue + } + override = override.clone() + if override.DocumentationURL != "" { + m.resolvedOps[override.Name].DocumentationURL = override.DocumentationURL + } + if len(override.OpenAPIFiles) > 0 { + m.resolvedOps[override.Name].OpenAPIFiles = override.OpenAPIFiles + } + } +} + +func (m *metadata) operations() []*operation { + m.resolve() + ops := make([]*operation, 0, len(m.resolvedOps)) + for _, op := range m.resolvedOps { + ops = append(ops, op) + } + sortOperations(ops) + return ops +} + +func loadMetadataFile(filename string) (*metadata, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + var meta metadata + err = yaml.Unmarshal(b, &meta) + if err != nil { + return nil, err + } + return &meta, nil +} + +func (m *metadata) saveFile(filename string) (errOut error) { + sortOperations(m.ManualOps) + sortOperations(m.OverrideOps) + sortOperations(m.OpenapiOps) + sort.Slice(m.Methods, func(i, j int) bool { + return m.Methods[i].Name < m.Methods[j].Name + }) + for _, method := range m.Methods { + sort.Strings(method.OpNames) + } + f, err := os.Create(filename) + if err != nil { + panic(err) + } + defer func() { + e := f.Close() + if errOut == nil { + errOut = e + } + }() + enc := yaml.NewEncoder(f) + enc.SetIndent(2) + return enc.Encode(m) +} + +func addOperation(ops []*operation, filename, opName, docURL string) []*operation { + for _, op := range ops { + if opName != op.Name { + continue + } + if len(op.OpenAPIFiles) == 0 { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + op.DocumentationURL = docURL + return ops + } + // just append to files, but only add the first ghes file + if !strings.Contains(filename, "/ghes") { + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + return ops + } + for _, f := range op.OpenAPIFiles { + if strings.Contains(f, "/ghes") { + return ops + } + } + op.OpenAPIFiles = append(op.OpenAPIFiles, filename) + return ops + } + return append(ops, &operation{ + Name: opName, + OpenAPIFiles: []string{filename}, + DocumentationURL: docURL, + }) +} + +// operationMethods returns a list methods that are mapped to the given operation id. +func (m *metadata) operationMethods(opName string) []string { + var methods []string + for _, method := range m.Methods { + for _, methodOpName := range method.OpNames { + if methodOpName == opName { + methods = append(methods, method.Name) + } + } + } + return methods +} + +func (m *metadata) getOperation(name string) *operation { + m.resolve() + return m.resolvedOps[name] +} + +func (m *metadata) getOperationsWithNormalizedName(name string) []*operation { + m.resolve() + var result []*operation + norm := normalizedOpName(name) + for n := range m.resolvedOps { + if normalizedOpName(n) == norm { + result = append(result, m.resolvedOps[n]) + } + } + sortOperations(result) + return result +} + +func (m *metadata) getMethod(name string) *method { + for _, method := range m.Methods { + if method.Name == name { + return method + } + } + return nil +} + +func (m *metadata) operationsForMethod(methodName string) []*operation { + method := m.getMethod(methodName) + if method == nil { + return nil + } + var operations []*operation + for _, name := range method.OpNames { + op := m.getOperation(name) + if op != nil { + operations = append(operations, op) + } + } + sortOperations(operations) + return operations +} + +func (m *metadata) canonizeMethodOperations() error { + for _, method := range m.Methods { + for i := range method.OpNames { + opName := method.OpNames[i] + if m.getOperation(opName) != nil { + continue + } + ops := m.getOperationsWithNormalizedName(opName) + switch len(ops) { + case 0: + return fmt.Errorf("method %q has an operation that can not be canonized to any defined name: %s", method.Name, opName) + case 1: + method.OpNames[i] = ops[0].Name + default: + candidateList := "" + for _, op := range ops { + candidateList += "\n " + op.Name + } + return fmt.Errorf("method %q has an operation that can be canonized to multiple defined names:\n operation: %s\n matches: %s", method.Name, opName, candidateList) + } + } + } + return nil +} + +func (m *metadata) updateFromGithub(ctx context.Context, client *github.Client, ref string) error { + commit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil) + if err != nil { + return err + } + if resp.StatusCode != 200 { + return fmt.Errorf("unexpected status code: %s", resp.Status) + } + ops, err := getOpsFromGithub(ctx, client, ref) + if err != nil { + return err + } + if !operationsEqual(m.OpenapiOps, ops) { + m.OpenapiOps = ops + m.GitCommit = commit.GetSHA() + } + return nil +} + +// updateDocLinks updates the code comments in dir with doc urls from metadata. +func updateDocLinks(meta *metadata, dir string) error { + return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + if d.IsDir() || + !strings.HasSuffix(path, ".go") || + strings.HasSuffix(path, "_test.go") { + return nil + } + content, err := os.ReadFile(path) + if err != nil { + return err + } + content = bytes.ReplaceAll(content, []byte("\r\n"), []byte("\n")) + updatedContent, err := updateDocsLinksInFile(meta, content) + if err != nil { + return err + } + if bytes.Equal(content, updatedContent) { + return nil + } + f, err := os.Create(path) + if err != nil { + return err + } + _, err = f.Write(updatedContent) + if err != nil { + return err + } + return f.Close() + }) +} + +// updateDocsLinksInFile updates in the code comments in content with doc urls from metadata. +func updateDocsLinksInFile(metadata *metadata, content []byte) ([]byte, error) { + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, "", content, parser.ParseComments) + if err != nil { + return nil, err + } + cmap := ast.NewCommentMap(fset, file, file.Comments) + + // ignore files where package is not github + if file.Name.Name != "github" { + return content, nil + } + + ast.Inspect(file, func(n ast.Node) bool { + return updateDocsLinksForNode(metadata, cmap, n) + }) + + file.Comments = cmap.Filter(file).Comments() + + var buf bytes.Buffer + err = printer.Fprint(&buf, fset, file) + if err != nil { + return nil, err + } + return format.Source(buf.Bytes()) +} + +var ( + docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s*(https?://\S+)`) +) + +func updateDocsLinksForNode(metadata *metadata, cmap ast.CommentMap, n ast.Node) bool { + fn, ok := n.(*ast.FuncDecl) + if !ok { + return true + } + sm := serviceMethodFromNode(n) + if sm == "" { + return true + } + + linksMap := map[string]struct{}{} + undocMap := map[string]bool{} + ops := metadata.operationsForMethod(sm) + for _, op := range ops { + if op.DocumentationURL == "" { + undocMap[op.Name] = true + continue + } + linksMap[op.DocumentationURL] = struct{}{} + } + var undocumentedOps []string + for op := range undocMap { + undocumentedOps = append(undocumentedOps, op) + } + sort.Strings(undocumentedOps) + + // Find the group that comes before the function + var group *ast.CommentGroup + for _, g := range cmap[fn] { + if g.End() == fn.Pos()-1 { + group = g + } + } + + // If there is no group, create one + if group == nil { + group = &ast.CommentGroup{ + List: []*ast.Comment{{Text: "//", Slash: fn.Pos() - 1}}, + } + cmap[fn] = append(cmap[fn], group) + } + + skipSpacer := false + var newList []*ast.Comment + for _, comment := range group.List { + if strings.Contains(comment.Text, "uses the undocumented GitHub API endpoint") { + skipSpacer = true + continue + } + match := docLineRE.FindStringSubmatch(comment.Text) + if match == nil { + newList = append(newList, comment) + continue + } + matchesLink := false + for link := range linksMap { + if sameDocLink(match[2], link) { + matchesLink = true + skipSpacer = true + delete(linksMap, link) + break + } + } + if matchesLink { + newList = append(newList, comment) + } + } + group.List = newList + + // add an empty line before adding doc links + if !skipSpacer { + group.List = append(group.List, &ast.Comment{Text: "//"}) + } + + var docLinks []string + for link := range linksMap { + docLinks = append(docLinks, link) + } + sort.Strings(docLinks) + + for _, dl := range docLinks { + group.List = append( + group.List, + &ast.Comment{ + Text: "// GitHub API docs: " + normalizeDocURLPath(dl), + }, + ) + } + _, methodName, _ := strings.Cut(sm, ".") + for _, opName := range undocumentedOps { + line := fmt.Sprintf("// Note: %s uses the undocumented GitHub API endpoint %q.", methodName, opName) + group.List = append(group.List, &ast.Comment{Text: line}) + } + group.List[0].Slash = fn.Pos() - 1 + for i := 1; i < len(group.List); i++ { + group.List[i].Slash = token.NoPos + } + return true +} + +const docURLPrefix = "https://docs.github.com/rest/" + +var docURLPrefixRE = regexp.MustCompile(`^https://docs\.github\.com.*/rest/`) + +func normalizeDocURLPath(u string) string { + u = strings.Replace(u, "/en/", "/", 1) + pre := docURLPrefixRE.FindString(u) + if pre == "" { + return u + } + if strings.Contains(u, "docs.github.com/enterprise-cloud@latest/") { + // remove unsightly double slash + // https://docs.github.com/enterprise-cloud@latest/ + return strings.ReplaceAll( + u, + "docs.github.com/enterprise-cloud@latest//", + "docs.github.com/enterprise-cloud@latest/", + ) + } + if strings.Contains(u, "docs.github.com/enterprise-server") { + return u + } + return docURLPrefix + strings.TrimPrefix(u, pre) +} + +// sameDocLink returns true if the two doc links are going to end up rendering the same page pointed +// to the same section. +// +// If a url path starts with *./rest/ it ignores query parameters and everything before /rest/ when +// making the comparison. +func sameDocLink(left, right string) bool { + if !docURLPrefixRE.MatchString(left) || + !docURLPrefixRE.MatchString(right) { + return left == right + } + left = stripURLQuery(normalizeDocURLPath(left)) + right = stripURLQuery(normalizeDocURLPath(right)) + return left == right +} + +func stripURLQuery(u string) string { + p, err := url.Parse(u) + if err != nil { + return u + } + p.RawQuery = "" + return p.String() +} + +func serviceMethodFromNode(node ast.Node) string { + decl, ok := node.(*ast.FuncDecl) + if !ok || decl.Recv == nil || len(decl.Recv.List) != 1 { + return "" + } + recv := decl.Recv.List[0] + se, ok := recv.Type.(*ast.StarExpr) + if !ok { + return "" + } + id, ok := se.X.(*ast.Ident) + if !ok { + return "" + } + + // We only want exported methods on exported types where the type name ends in "Service". + if !id.IsExported() || !decl.Name.IsExported() || !strings.HasSuffix(id.Name, "Service") { + return "" + } + + return id.Name + "." + decl.Name.Name +} diff --git a/tools/internal/openapi.go b/tools/metadata/openapi.go similarity index 81% rename from tools/internal/openapi.go rename to tools/metadata/openapi.go index 905c965746c..1b0c26c96cb 100644 --- a/tools/internal/openapi.go +++ b/tools/metadata/openapi.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package internal +package main import ( "context" @@ -14,7 +14,7 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v55/github" + "github.com/google/go-github/v56/github" "golang.org/x/sync/errgroup" ) @@ -33,13 +33,29 @@ type openapiFile struct { releaseMinor int } -type contentsClient interface { - DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) - GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) +func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) ([]*operation, error) { + descs, err := getDescriptions(ctx, client, gitRef) + if err != nil { + return nil, err + } + var ops []*operation + for _, desc := range descs { + for p, pathItem := range desc.description.Paths { + for method, op := range pathItem.Operations() { + docURL := "" + if op.ExternalDocs != nil { + docURL = op.ExternalDocs.URL + } + ops = addOperation(ops, desc.filename, method+" "+p, docURL) + } + } + } + sortOperations(ops) + return ops, nil } -func (o *openapiFile) loadDescription(ctx context.Context, client contentsClient, gitRef string) error { - contents, resp, err := client.DownloadContents( +func (o *openapiFile) loadDescription(ctx context.Context, client *github.Client, gitRef string) error { + contents, resp, err := client.Repositories.DownloadContents( ctx, descriptionsOwnerName, descriptionsRepoName, @@ -91,8 +107,8 @@ var dirPatterns = []*regexp.Regexp{ // - Directories that don't match any of the patterns in dirPatterns are removed. // - Directories are sorted by the pattern that matched in the same order they appear in dirPatterns. // - Directories are then sorted by major and minor version in descending order. -func getDescriptions(ctx context.Context, client contentsClient, gitRef string) ([]*openapiFile, error) { - _, dir, resp, err := client.GetContents( +func getDescriptions(ctx context.Context, client *github.Client, gitRef string) ([]*openapiFile, error) { + _, dir, resp, err := client.Repositories.GetContents( ctx, descriptionsOwnerName, descriptionsRepoName, diff --git a/tools/metadata/testdata/canonize/metadata.yaml b/tools/metadata/testdata/canonize/metadata.yaml new file mode 100644 index 00000000000..fdfbdb89ba8 --- /dev/null +++ b/tools/metadata/testdata/canonize/metadata.yaml @@ -0,0 +1,7 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id_noncanonical} +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a diff --git a/tools/metadata/testdata/format/metadata.yaml b/tools/metadata/testdata/format/metadata.yaml new file mode 100644 index 00000000000..36f27d86d5e --- /dev/null +++ b/tools/metadata/testdata/format/metadata.yaml @@ -0,0 +1,33 @@ + +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id_noncanonical2} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + + +methods: + - name: AService.Get + operations: + - GET /a/{a_id_noncanonical} + - name: AService.Undocumented + operations: + - GET /undocumented/{undocumented_id} + - name: AService.OutdatedLinks + operations: + - POST /a/{a_id} + - name: AService.AcceptableLinks + operations: + - POST /a/{a_id} + - GET /a/{a_id} + - name: AService.Uncommented + operations: + - GET /a/{a_id} +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d diff --git a/tools/metadata/testdata/golden/TestCanonize/metadata.yaml b/tools/metadata/testdata/golden/TestCanonize/metadata.yaml new file mode 100644 index 00000000000..b86428c0771 --- /dev/null +++ b/tools/metadata/testdata/golden/TestCanonize/metadata.yaml @@ -0,0 +1,7 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id} +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a diff --git a/tools/metadata/testdata/golden/TestFormat/metadata.yaml b/tools/metadata/testdata/golden/TestFormat/metadata.yaml new file mode 100644 index 00000000000..f09099654ae --- /dev/null +++ b/tools/metadata/testdata/golden/TestFormat/metadata.yaml @@ -0,0 +1,30 @@ +methods: + - name: AService.AcceptableLinks + operations: + - GET /a/{a_id} + - POST /a/{a_id} + - name: AService.Get + operations: + - GET /a/{a_id_noncanonical} + - name: AService.OutdatedLinks + operations: + - POST /a/{a_id} + - name: AService.Uncommented + operations: + - GET /a/{a_id} + - name: AService.Undocumented + operations: + - GET /undocumented/{undocumented_id} +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +operation_overrides: + - name: GET /a/{a_id_noncanonical2} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} diff --git a/tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml b/tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml new file mode 100644 index 00000000000..6c58990cdb5 --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml @@ -0,0 +1,18 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id} +operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +openapi_commit: s +openapi_operations: + - name: GET /a/b/{a_id} + documentation_url: https://docs.github.com/rest/reference/a + openapi_files: + - descriptions/ghec/ghec.json + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/reference/a + openapi_files: + - descriptions/api.github.com/api.github.com.json diff --git a/tools/metadata/testdata/golden/TestUpdateURLs/github/a.go b/tools/metadata/testdata/golden/TestUpdateURLs/github/a.go new file mode 100644 index 00000000000..fd481d4b3ff --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateURLs/github/a.go @@ -0,0 +1,32 @@ +package github + +type AService struct{} + +// Get gets an A +// +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Get() {} + +// MissingFromMetadata isn't mentioned in metadata.yaml +func (s *AService) MissingFromMetadata() {} + +// Undocumented uses an undocumented operation +// +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#update-a +func (s *AService) OutdatedLinks() {} + +// AcceptableLinks has links that resolve to the same link as the metadata +// +// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a +// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a +func (s *AService) AcceptableLinks() {} + +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Uncommented() { + // has no pre-existing comment +} diff --git a/tools/metadata/testdata/update-metadata/metadata.yaml b/tools/metadata/testdata/update-metadata/metadata.yaml new file mode 100644 index 00000000000..f96b22445a2 --- /dev/null +++ b/tools/metadata/testdata/update-metadata/metadata.yaml @@ -0,0 +1,8 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id} +operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +openapi_commit: s diff --git a/tools/metadata/testdata/update-urls/github/a.go b/tools/metadata/testdata/update-urls/github/a.go new file mode 100644 index 00000000000..bb1721e9ede --- /dev/null +++ b/tools/metadata/testdata/update-urls/github/a.go @@ -0,0 +1,29 @@ +package github + +type AService struct{} + +// Get gets an A +func (s *AService) Get() {} + +// MissingFromMetadata isn't mentioned in metadata.yaml +func (s *AService) MissingFromMetadata() {} + +// Undocumented uses an undocumented operation +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#get-a +// GitHub API docs: https://example.com +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +func (s *AService) OutdatedLinks() {} + +// AcceptableLinks has links that resolve to the same link as the metadata +// +// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a +// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a +func (s *AService) AcceptableLinks() {} + +func (s *AService) Uncommented() { + // has no pre-existing comment +} diff --git a/tools/metadata/testdata/update-urls/metadata.yaml b/tools/metadata/testdata/update-urls/metadata.yaml new file mode 100644 index 00000000000..a3a15879d86 --- /dev/null +++ b/tools/metadata/testdata/update-urls/metadata.yaml @@ -0,0 +1,30 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id} + - name: AService.Undocumented + operations: + - GET /undocumented/{undocumented_id} + - name: AService.OutdatedLinks + operations: + - POST /a/{a_id} + - name: AService.AcceptableLinks + operations: + - POST /a/{a_id} + - GET /a/{a_id} + - name: AService.Uncommented + operations: + - GET /a/{a_id} +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/validate_invalid/github/a.go b/tools/metadata/testdata/validate_invalid/github/a.go new file mode 100644 index 00000000000..fd481d4b3ff --- /dev/null +++ b/tools/metadata/testdata/validate_invalid/github/a.go @@ -0,0 +1,32 @@ +package github + +type AService struct{} + +// Get gets an A +// +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Get() {} + +// MissingFromMetadata isn't mentioned in metadata.yaml +func (s *AService) MissingFromMetadata() {} + +// Undocumented uses an undocumented operation +// +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#update-a +func (s *AService) OutdatedLinks() {} + +// AcceptableLinks has links that resolve to the same link as the metadata +// +// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a +// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a +func (s *AService) AcceptableLinks() {} + +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Uncommented() { + // has no pre-existing comment +} diff --git a/tools/metadata/testdata/validate_invalid/metadata.yaml b/tools/metadata/testdata/validate_invalid/metadata.yaml new file mode 100644 index 00000000000..71ccd120b78 --- /dev/null +++ b/tools/metadata/testdata/validate_invalid/metadata.yaml @@ -0,0 +1,30 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id_noncanonical} + - name: AService.Undocumented + operations: + - GET /undocumented/{undocumented_id} + - name: AService.OutdatedLinks + operations: + - POST /a/{a_id} + - name: AService.AcceptableLinks + operations: + - POST /a/{a_id} + - GET /a/{a_id} + - name: AService.Uncommented + operations: + - GET /a/{a_id} +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id_noncanonical2} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/validate_valid/github/a.go b/tools/metadata/testdata/validate_valid/github/a.go new file mode 100644 index 00000000000..608c6548b05 --- /dev/null +++ b/tools/metadata/testdata/validate_valid/github/a.go @@ -0,0 +1,29 @@ +package github + +type AService struct{} + +// Get gets an A +// +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Get() {} + +// Undocumented uses an undocumented operation +// +// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +func (s *AService) Undocumented() {} + +// OutdatedLinks has links that are outdated or wrong +// +// GitHub API docs: https://docs.github.com/rest/a/a#update-a +func (s *AService) OutdatedLinks() {} + +// AcceptableLinks has links that resolve to the same link as the metadata +// +// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a +// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a +func (s *AService) AcceptableLinks() {} + +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +func (s *AService) Uncommented() { + // has no pre-existing comment +} diff --git a/tools/metadata/testdata/validate_valid/metadata.yaml b/tools/metadata/testdata/validate_valid/metadata.yaml new file mode 100644 index 00000000000..7f5baa60708 --- /dev/null +++ b/tools/metadata/testdata/validate_valid/metadata.yaml @@ -0,0 +1,28 @@ +methods: + - name: AService.Get + operations: + - GET /a/{a_id} + - name: AService.Undocumented + operations: + - GET /undocumented/{undocumented_id} + - name: AService.OutdatedLinks + operations: + - POST /a/{a_id} + - name: AService.AcceptableLinks + operations: + - POST /a/{a_id} + - GET /a/{a_id} + - name: AService.Uncommented + operations: + - GET /a/{a_id} +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /undocumented/{undocumented_id} +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/validate.go b/tools/metadata/validate.go new file mode 100644 index 00000000000..e8937f63806 --- /dev/null +++ b/tools/metadata/validate.go @@ -0,0 +1,201 @@ +// 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 main + +import ( + "context" + "fmt" + "go/ast" + "go/parser" + "go/token" + "os" + "path/filepath" + "sort" + "strings" + + "github.com/google/go-github/v56/github" +) + +// validateMetadata returns a list of issues with the metadata file. An error means +// there was an error validating the file, not that there are issues with the file. +// +// validations: +// - Methods in the github package must exist in metadata.yaml +// - Methods in metadata.yaml must exist in github package +// - Methods in metadata.yaml must have unique names +// - Methods in metadata.yaml must have at least one operation +// - Methods in metadata.yaml may not have duplicate operations +// - Methods in metadata.yaml must use the canonical operation name +// - All operations mapped from a method must exist in either ManualOps or OpenAPIOps +// - No operations are duplicated between ManualOps and OpenAPIOps +// - All operations in OverrideOps must exist in either ManualOps or OpenAPIOps +func validateMetadata(dir string, meta *metadata) ([]string, error) { + serviceMethods, err := getServiceMethods(dir) + if err != nil { + return nil, err + } + var result []string + result = validateServiceMethodsExist(result, meta, serviceMethods) + result = validateMetadataMethods(result, meta, serviceMethods) + result = validateOperations(result, meta) + return result, nil +} + +// validateGitCommit validates that building meta.OpenapiOps from the commit at meta.GitCommit +// results in the same operations as meta.OpenapiOps. +func validateGitCommit(ctx context.Context, client *github.Client, meta *metadata) (string, error) { + ops, err := getOpsFromGithub(ctx, client, meta.GitCommit) + if err != nil { + return "", err + } + if !operationsEqual(ops, meta.OpenapiOps) { + msg := fmt.Sprintf("openapi_operations does not match operations from git commit %s", meta.GitCommit) + return msg, nil + } + return "", nil +} + +func validateMetadataMethods(result []string, meta *metadata, serviceMethods []string) []string { + smLookup := map[string]bool{} + for _, method := range serviceMethods { + smLookup[method] = true + } + seenMethods := map[string]bool{} + for _, method := range meta.Methods { + if seenMethods[method.Name] { + msg := fmt.Sprintf("Method %s is duplicated in metadata.yaml.", method.Name) + result = append(result, msg) + continue + } + seenMethods[method.Name] = true + if !smLookup[method.Name] { + msg := fmt.Sprintf("Method %s in metadata.yaml does not exist in github package.", method.Name) + result = append(result, msg) + } + result = validateMetaMethodOperations(result, meta, method) + } + return result +} + +func validateMetaMethodOperations(result []string, meta *metadata, method *method) []string { + if len(method.OpNames) == 0 { + msg := fmt.Sprintf("Method %s in metadata.yaml does not have any operations.", method.Name) + result = append(result, msg) + } + seenOps := map[string]bool{} + for _, opName := range method.OpNames { + if seenOps[opName] { + msg := fmt.Sprintf("Method %s in metadata.yaml has duplicate operation: %s.", method.Name, opName) + result = append(result, msg) + } + seenOps[opName] = true + if meta.getOperation(opName) != nil { + continue + } + normalizedMatch := meta.getOperationsWithNormalizedName(opName) + if len(normalizedMatch) > 0 { + msg := fmt.Sprintf("Method %s has operation which is does not use the canonical name. You may be able to automatically fix this by running 'script/metadata.sh canonize': %s.", method.Name, opName) + result = append(result, msg) + continue + } + msg := fmt.Sprintf("Method %s has operation which is not defined in metadata.yaml: %s.", method.Name, opName) + result = append(result, msg) + } + return result +} + +func validateServiceMethodsExist(result []string, meta *metadata, serviceMethods []string) []string { + for _, method := range serviceMethods { + if meta.getMethod(method) == nil { + msg := fmt.Sprintf("Method %s does not exist in metadata.yaml. Please add it.", method) + result = append(result, msg) + } + } + return result +} + +func validateOperations(result []string, meta *metadata) []string { + names := map[string]bool{} + openapiNames := map[string]bool{} + overrideNames := map[string]bool{} + for _, op := range meta.OpenapiOps { + if openapiNames[op.Name] { + msg := fmt.Sprintf("Name duplicated in openapi_operations: %s", op.Name) + result = append(result, msg) + } + openapiNames[op.Name] = true + } + for _, op := range meta.ManualOps { + if names[op.Name] { + msg := fmt.Sprintf("Name duplicated in operations: %s", op.Name) + result = append(result, msg) + } + names[op.Name] = true + if openapiNames[op.Name] { + msg := fmt.Sprintf("Name exists in both operations and openapi_operations: %s", op.Name) + result = append(result, msg) + } + } + for _, op := range meta.OverrideOps { + if overrideNames[op.Name] { + msg := fmt.Sprintf("Name duplicated in override_operations: %s", op.Name) + result = append(result, msg) + } + overrideNames[op.Name] = true + if !names[op.Name] && !openapiNames[op.Name] { + msg := fmt.Sprintf("Name in override_operations does not exist in operations or openapi_operations: %s", op.Name) + result = append(result, msg) + } + } + return result +} + +func getServiceMethods(dir string) ([]string, error) { + dirEntries, err := os.ReadDir(dir) + if err != nil { + return nil, err + } + var serviceMethods []string + for _, filename := range dirEntries { + var sm []string + sm, err = getServiceMethodsFromFile(filepath.Join(dir, filename.Name())) + if err != nil { + return nil, err + } + serviceMethods = append(serviceMethods, sm...) + } + sort.Strings(serviceMethods) + return serviceMethods, nil +} + +// getServiceMethodsFromFile returns the service methods in filename. +func getServiceMethodsFromFile(filename string) ([]string, error) { + if !strings.HasSuffix(filename, ".go") || + strings.HasSuffix(filename, "_test.go") { + return nil, nil + } + + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) + if err != nil { + return nil, err + } + + // Only look at the github package + if f.Name.Name != "github" { + return nil, nil + } + var serviceMethods []string + ast.Inspect(f, func(n ast.Node) bool { + sm := serviceMethodFromNode(n) + if sm == "" { + return true + } + serviceMethods = append(serviceMethods, sm) + return false + }) + return serviceMethods, nil +} From fcd94b397d4d4dc08b72ac9156e11aa7832c883d Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sat, 14 Oct 2023 14:43:10 -0500 Subject: [PATCH 23/34] fix comment --- script/metadata.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/metadata.sh b/script/metadata.sh index f2b9fc5f407..3b7c7fbeb8b 100755 --- a/script/metadata.sh +++ b/script/metadata.sh @@ -1,5 +1,5 @@ #!/bin/sh -#/ script/metadata.sh runs ./tools/cmd/metadata in the repository root with the given arguments +#/ script/metadata.sh runs ./tools/metadata in the repository root with the given arguments set -e From cf4795bfc51b3328db0974ef0a500e8190a6571e Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 15 Oct 2023 09:21:52 -0500 Subject: [PATCH 24/34] start on CONTRIBUTING.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 451924ce4c3..bbc8a188184 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,6 +73,16 @@ are more sensitive, emailed to . [pull request]: https://help.github.com/articles/creating-a-pull-request [monitored by codecov.io]: https://codecov.io/gh/google/go-github +## Metadata ## + +`metadata.yaml` contains metadata about go-github's code and GitHub's OpenAPI +specification. We use this metadata to keep documentation links up to date and +to keep tabs on coverage of the GitHub API. + +All exported methods on `*Service` structs need to have an entry in the +"methods" section of `metadata.yaml` that maps it to the corresponding +OpenAPI operation. + ## Scripts ## The `script` directory has shell scripts that help with common development From 8e8cef8ed890f64b19f5f9cf3d9829101774fa4a Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 15 Oct 2023 10:15:45 -0500 Subject: [PATCH 25/34] rename metadata sub-commands --- github/github.go | 2 +- tools/metadata/main.go | 53 +++++++++++-------- tools/metadata/main_test.go | 8 +-- .../github/a.go | 0 .../metadata.yaml | 0 .../github/a.go | 0 .../metadata.yaml | 0 .../metadata.yaml | 0 8 files changed, 36 insertions(+), 27 deletions(-) rename tools/metadata/testdata/golden/{TestUpdateURLs => TestUpdateDocURLs}/github/a.go (100%) rename tools/metadata/testdata/golden/{TestUpdateMetadata => TestUpdateOpenAPI}/metadata.yaml (100%) rename tools/metadata/testdata/{update-urls => update-doc-urls}/github/a.go (100%) rename tools/metadata/testdata/{update-urls => update-doc-urls}/metadata.yaml (100%) rename tools/metadata/testdata/{update-metadata => update-openapi}/metadata.yaml (100%) diff --git a/github/github.go b/github/github.go index f07cc61b8b6..32e5fe2499f 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate ../script/metadata.sh update-urls +//go:generate ../script/metadata.sh update-doc-urls package github diff --git a/tools/metadata/main.go b/tools/metadata/main.go index e91ab130244..ca9538e4e8f 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -17,24 +17,33 @@ import ( ) var helpVars = kong.Vars{ - "update_help": `Update metadata.yaml from OpenAPI descriptions in github.com/github/rest-api-description.`, - "format_help": `Format metadata.yaml.`, - "validate_help": `Validate that metadata.yaml is consistent with source code.`, - "unused_ops_help": `List operations in metadata.yaml that don't have any associated go methods'.`, - "canonize_help": `Update metadata.yaml to use canonical operation names.`, + "update_openapi_help": `Update metadata.yaml from OpenAPI descriptions in github.com/github/rest-api-description.`, + "update_doc_urls_help": `Update documentation urls in the Go source files in the github directory to match the urls in the metadata file.`, + "format_help": `Format metadata.yaml.`, + "validate_help": `Validate that metadata.yaml is consistent with source code.`, + "unused_ops_help": `List operations in metadata.yaml that don't have any associated go methods'.`, + "canonize_help": `Update metadata.yaml to use canonical operation names.`, + "working_dir_help": `Working directory. Should be the root of the go-github repository.`, + "filename_help": `Path to metadata.yaml. Defaults to /metadata.yaml.`, + "github_dir_help": `Path to the github package. Defaults to /github.`, + "openapi_ref_help": `Git ref to pull OpenAPI descriptions from.`, + "output_json_help": `Output JSON.`, + "validate_github_help": `Check that metadata.yaml is consistent with the OpenAPI descriptions in github.com/github/rest-api-description.`, } type rootCmd struct { - WorkingDir string `kong:"short=C,default=.,help='Working directory. Must be within a go-github root.'"` - Filename string `kong:"help='Path to metadata.yaml. Defaults to /metadata.yaml.'"` - GithubDir string `kong:"help='Path to the github package. Defaults to /github.'"` - GithubURL string `kong:"hidden,default='https://api.github.com'"` - UpdateMetadata updateMetadataCmd `kong:"cmd,help=${update_help}"` - UpdateUrls updateUrlsCmd `kong:"cmd,help='Update documentation URLs in the Go source files in the github directory to match the urls in the metadata file.'"` - Format formatCmd `kong:"cmd,help=${format_help}"` - Validate validateCmd `kong:"cmd,help=${validate_help}"` - UnusedOps unusedOpsCmd `kong:"cmd,help=${unused_ops_help}"` - Canonize canonizeCmd `kong:"cmd,help=${canonize_help}"` + WorkingDir string `kong:"short=C,default=.,help=${working_dir_help}"` + Filename string `kong:"help=${filename_help}"` + GithubDir string `kong:"help=${github_dir_help}"` + UpdateOpenAPI updateOpenAPICmd `kong:"cmd,name=update-openapi,help=${update_openapi_help}"` + UpdateDocURLs updateDocURLsCmd `kong:"cmd,name=update-doc-urls,help=${update_doc_urls_help}"` + Format formatCmd `kong:"cmd,help=${format_help}"` + Validate validateCmd `kong:"cmd,help=${validate_help}"` + UnusedOps unusedOpsCmd `kong:"cmd,help=${unused_ops_help}"` + Canonize canonizeCmd `kong:"cmd,help=${canonize_help}"` + + // for testing + GithubURL string `kong:"hidden,default='https://api.github.com'"` } func (c *rootCmd) metadata() (string, *metadata, error) { @@ -57,11 +66,11 @@ func githubClient(apiURL string) (*github.Client, error) { return github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, "") } -type updateMetadataCmd struct { - Ref string `kong:"default=main,help='git ref to pull OpenAPI descriptions from'"` +type updateOpenAPICmd struct { + Ref string `kong:"default=main,help=${openapi_ref_help}"` } -func (c *updateMetadataCmd) Run(root *rootCmd) error { +func (c *updateOpenAPICmd) Run(root *rootCmd) error { ctx := context.Background() filename, meta, err := root.metadata() if err != nil { @@ -90,7 +99,7 @@ func (c *formatCmd) Run(root *rootCmd) error { } type validateCmd struct { - CheckGithub bool `kong:"help='Check that metadata.yaml is consistent with the OpenAPI descriptions in github.com/github/rest-api-description.'"` + CheckGithub bool `kong:"help=${validate_github_help}"` } func (c *validateCmd) Run(k *kong.Context, root *rootCmd) error { @@ -127,9 +136,9 @@ func (c *validateCmd) Run(k *kong.Context, root *rootCmd) error { return fmt.Errorf("found %d issues in %s", len(issues), filename) } -type updateUrlsCmd struct{} +type updateDocURLsCmd struct{} -func (c *updateUrlsCmd) Run(root *rootCmd) error { +func (c *updateDocURLsCmd) Run(root *rootCmd) error { githubDir := filepath.Join(root.WorkingDir, "github") _, meta, err := root.metadata() if err != nil { @@ -140,7 +149,7 @@ func (c *updateUrlsCmd) Run(root *rootCmd) error { } type unusedOpsCmd struct { - JSON bool `kong:"help='Output JSON.'"` + JSON bool `kong:"help=${output_json_help}"` } func (c *unusedOpsCmd) Run(root *rootCmd) error { diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 09886770f81..27ba2bc279d 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -26,8 +26,8 @@ import ( "github.com/google/go-github/v56/github" ) -func TestUpdateURLs(t *testing.T) { - res := runTest(t, "testdata/update-urls", "update-urls") +func TestUpdateDocURLs(t *testing.T) { + res := runTest(t, "testdata/update-doc-urls", "update-doc-urls") res.assertOutput("", "") res.assertNoErr() res.checkGolden() @@ -54,7 +54,7 @@ Name in override_operations does not exist in operations or openapi_operations: }) } -func TestUpdateMetadata(t *testing.T) { +func TestUpdateOpenAPI(t *testing.T) { testServer := newTestServer(t, "main", map[string]interface{}{ "api.github.com/api.github.com.json": openapi3.T{ Paths: openapi3.Paths{ @@ -113,7 +113,7 @@ func TestUpdateMetadata(t *testing.T) { }, }) - res := runTest(t, "testdata/update-metadata", "update-metadata", "--github-url", testServer.URL) + res := runTest(t, "testdata/update-openapi", "update-openapi", "--github-url", testServer.URL) res.assertOutput("", "") res.assertNoErr() res.checkGolden() diff --git a/tools/metadata/testdata/golden/TestUpdateURLs/github/a.go b/tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go similarity index 100% rename from tools/metadata/testdata/golden/TestUpdateURLs/github/a.go rename to tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go diff --git a/tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml b/tools/metadata/testdata/golden/TestUpdateOpenAPI/metadata.yaml similarity index 100% rename from tools/metadata/testdata/golden/TestUpdateMetadata/metadata.yaml rename to tools/metadata/testdata/golden/TestUpdateOpenAPI/metadata.yaml diff --git a/tools/metadata/testdata/update-urls/github/a.go b/tools/metadata/testdata/update-doc-urls/github/a.go similarity index 100% rename from tools/metadata/testdata/update-urls/github/a.go rename to tools/metadata/testdata/update-doc-urls/github/a.go diff --git a/tools/metadata/testdata/update-urls/metadata.yaml b/tools/metadata/testdata/update-doc-urls/metadata.yaml similarity index 100% rename from tools/metadata/testdata/update-urls/metadata.yaml rename to tools/metadata/testdata/update-doc-urls/metadata.yaml diff --git a/tools/metadata/testdata/update-metadata/metadata.yaml b/tools/metadata/testdata/update-openapi/metadata.yaml similarity index 100% rename from tools/metadata/testdata/update-metadata/metadata.yaml rename to tools/metadata/testdata/update-openapi/metadata.yaml From b9b5e6f1acf8e72503d8bb5e06a9b0e9924a249a Mon Sep 17 00:00:00 2001 From: Will Roden Date: Sun, 15 Oct 2023 11:01:17 -0500 Subject: [PATCH 26/34] make canonize more flexible --- tools/metadata/metadata.go | 25 ++++++++++++------- .../metadata/testdata/canonize/metadata.yaml | 6 +++++ .../golden/TestCanonize/metadata.yaml | 5 ++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 2e0e467e972..718e010c0de 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -92,7 +92,10 @@ func normalizedURL(u string) string { } parts := strings.Split(u, "/") for i, p := range parts { - if len(p) > 0 && p[0] == '{' { + if len(p) == 0 { + continue + } + if p[0] == '{' || p[0] == '%' { parts[i] = "*" } } @@ -107,8 +110,12 @@ func normalizedOpName(name string) string { } func parseOpName(id string) (verb, url string) { - verb, url, _ = strings.Cut(id, " ") - return verb, url + fields := strings.Fields(id) + verb = fields[0] + if len(fields) > 1 { + url = fields[1] + } + return strings.ToUpper(verb), url } type method struct { @@ -290,24 +297,24 @@ func (m *metadata) operationsForMethod(methodName string) []*operation { } func (m *metadata) canonizeMethodOperations() error { - for _, method := range m.Methods { - for i := range method.OpNames { - opName := method.OpNames[i] + for _, mm := range m.Methods { + for i := range mm.OpNames { + opName := mm.OpNames[i] if m.getOperation(opName) != nil { continue } ops := m.getOperationsWithNormalizedName(opName) switch len(ops) { case 0: - return fmt.Errorf("method %q has an operation that can not be canonized to any defined name: %s", method.Name, opName) + return fmt.Errorf("method %q has an operation that can not be canonized to any defined name: %s", mm.Name, opName) case 1: - method.OpNames[i] = ops[0].Name + mm.OpNames[i] = ops[0].Name default: candidateList := "" for _, op := range ops { candidateList += "\n " + op.Name } - return fmt.Errorf("method %q has an operation that can be canonized to multiple defined names:\n operation: %s\n matches: %s", method.Name, opName, candidateList) + return fmt.Errorf("method %q has an operation that can be canonized to multiple defined names:\n operation: %s\n matches: %s", mm.Name, opName, candidateList) } } } diff --git a/tools/metadata/testdata/canonize/metadata.yaml b/tools/metadata/testdata/canonize/metadata.yaml index fdfbdb89ba8..85ff691b046 100644 --- a/tools/metadata/testdata/canonize/metadata.yaml +++ b/tools/metadata/testdata/canonize/metadata.yaml @@ -2,6 +2,12 @@ methods: - name: AService.Get operations: - GET /a/{a_id_noncanonical} + - name: BService.GetC + operations: + - get + /b/%s/c/%s openapi_operations: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /b/{b_id}/c/{c_id} + documentation_url: https://docs.github.com/rest/b/b#get-c diff --git a/tools/metadata/testdata/golden/TestCanonize/metadata.yaml b/tools/metadata/testdata/golden/TestCanonize/metadata.yaml index b86428c0771..d83accde60e 100644 --- a/tools/metadata/testdata/golden/TestCanonize/metadata.yaml +++ b/tools/metadata/testdata/golden/TestCanonize/metadata.yaml @@ -2,6 +2,11 @@ methods: - name: AService.Get operations: - GET /a/{a_id} + - name: BService.GetC + operations: + - GET /b/{b_id}/c/{c_id} openapi_operations: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a + - name: GET /b/{b_id}/c/{c_id} + documentation_url: https://docs.github.com/rest/b/b#get-c From b2b2e718ebd534152e7f70c83836ad3cae4d17d4 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Thu, 19 Oct 2023 13:26:32 -0500 Subject: [PATCH 27/34] use //meta:operation directives --- CONTRIBUTING.md | 132 +- github/actions.go | 2 +- github/actions_artifacts.go | 26 +- github/actions_cache.go | 38 +- github/actions_oidc.go | 16 +- github/actions_permissions_enterprise.go | 16 + github/actions_permissions_orgs.go | 36 +- github/actions_required_workflows.go | 20 + github/actions_runner_groups.go | 26 + github/actions_runners.go | 56 +- github/actions_secrets.go | 76 +- github/actions_variables.go | 74 +- github/actions_workflow_jobs.go | 12 +- github/actions_workflow_runs.go | 56 +- github/actions_workflows.go | 44 +- github/activity.go | 4 +- github/activity_events.go | 38 +- github/activity_notifications.go | 36 +- github/activity_star.go | 23 +- github/activity_watching.go | 23 +- github/admin.go | 6 +- github/admin_orgs.go | 6 + github/admin_stats.go | 2 + github/admin_users.go | 8 + github/admin_users_test.go | 4 +- github/apps.go | 61 +- github/apps_hooks.go | 4 + github/apps_hooks_deliveries.go | 12 +- github/apps_installation.go | 20 +- github/apps_manifest.go | 4 +- github/apps_marketplace.go | 20 +- github/authorizations.go | 26 +- github/billing.go | 16 +- github/checks.go | 50 +- github/code-scanning.go | 68 +- github/codesofconduct.go | 4 + github/codespaces.go | 28 +- github/codespaces_secrets.go | 90 +- github/dependabot.go | 2 +- github/dependabot_alerts.go | 12 +- github/dependabot_secrets.go | 56 +- github/dependency_graph.go | 2 + github/doc.go | 6 +- github/emojis.go | 2 + github/enterprise.go | 2 +- github/enterprise_actions_runner_groups.go | 52 +- github/enterprise_actions_runners.go | 12 +- github/enterprise_audit_log.go | 2 + .../enterprise_code_security_and_analysis.go | 8 +- github/event_types.go | 124 +- github/gists.go | 61 +- github/gists_comments.go | 20 +- github/git.go | 2 +- github/git_blobs.go | 12 +- github/git_commits.go | 6 +- github/git_refs.go | 20 +- github/git_tags.go | 8 +- github/git_trees.go | 8 +- github/github.go | 32 +- github/github_test.go | 16 +- github/gitignore.go | 6 +- github/interactions.go | 2 +- github/interactions_orgs.go | 12 +- github/interactions_repos.go | 12 +- github/issue_import.go | 6 + github/issues.go | 43 +- github/issues_assignees.go | 16 +- github/issues_comments.go | 23 +- github/issues_events.go | 12 +- github/issues_labels.go | 44 +- github/issues_milestones.go | 20 +- github/issues_timeline.go | 6 +- github/licenses.go | 6 +- github/markdown.go | 2 + github/messages.go | 4 +- github/meta.go | 6 + github/migrations.go | 26 +- github/migrations_source_import.go | 36 +- github/migrations_user.go | 24 +- github/orgs.go | 31 +- github/orgs_actions_allowed.go | 10 +- github/orgs_actions_permissions.go | 10 +- github/orgs_audit_log.go | 4 +- github/orgs_credential_authorizations.go | 8 +- github/orgs_custom_roles.go | 10 +- github/orgs_hooks.go | 24 +- github/orgs_hooks_configuration.go | 8 +- github/orgs_hooks_deliveries.go | 12 +- github/orgs_members.go | 65 +- github/orgs_outside_collaborators.go | 12 +- github/orgs_packages.go | 16 + github/orgs_personal_access_tokens.go | 4 +- github/orgs_projects.go | 8 +- github/orgs_rules.go | 20 +- github/orgs_security_managers.go | 12 +- github/orgs_users_blocking.go | 16 +- github/projects.go | 82 +- github/pulls.go | 48 +- github/pulls_comments.go | 29 +- github/pulls_reviewers.go | 10 +- github/pulls_reviews.go | 34 +- github/reactions.go | 52 +- github/repos.go | 256 +- github/repos_actions_access.go | 10 +- github/repos_actions_allowed.go | 8 +- github/repos_actions_permissions.go | 10 +- github/repos_autolinks.go | 16 +- github/repos_codeowners.go | 4 +- github/repos_collaborators.go | 22 +- github/repos_comments.go | 24 +- github/repos_commits.go | 28 +- github/repos_community_health.go | 4 +- github/repos_contents.go | 29 +- github/repos_deployment_branch_policies.go | 20 +- github/repos_deployments.go | 28 +- github/repos_environments.go | 16 +- github/repos_forks.go | 8 +- github/repos_hooks.go | 32 +- github/repos_hooks_configuration.go | 8 +- github/repos_hooks_deliveries.go | 16 +- github/repos_invitations.go | 12 +- github/repos_keys.go | 8 + github/repos_lfs.go | 4 + github/repos_merging.go | 8 +- github/repos_pages.go | 18 + github/repos_prereceive_hooks.go | 8 + github/repos_projects.go | 8 +- github/repos_releases.go | 56 +- github/repos_rules.go | 24 +- github/repos_stats.go | 20 +- github/repos_statuses.go | 12 +- github/repos_tags.go | 12 +- github/repos_traffic.go | 16 +- github/scim.go | 20 +- github/search.go | 20 +- github/secret_scanning.go | 16 +- github/security_advisories.go | 10 +- github/teams.go | 141 +- github/teams_discussion_comments.go | 40 +- github/teams_discussions.go | 40 +- github/teams_members.go | 40 +- github/users.go | 37 +- github/users_administration.go | 8 + github/users_blocking.go | 16 +- github/users_emails.go | 16 +- github/users_followers.go | 29 +- github/users_gpg_keys.go | 17 +- github/users_keys.go | 19 +- github/users_packages.go | 24 + github/users_projects.go | 8 +- github/users_ssh_signing_keys.go | 19 +- metadata.yaml => openapi_operations.yaml | 2706 ----------------- script/lint.sh | 25 +- script/test.sh | 6 + tools/metadata/main.go | 184 +- tools/metadata/main_test.go | 99 +- tools/metadata/metadata.go | 602 ++-- tools/metadata/metadata_test.go | 23 + .../metadata/testdata/canonize/metadata.yaml | 13 - tools/metadata/testdata/format/metadata.yaml | 33 - .../openapi_operations.yaml} | 24 +- .../golden/TestCanonize/metadata.yaml | 12 - ...{metadata.yaml => openapi_operations.yaml} | 17 - .../golden/TestUpdateDocURLs/github/a.go | 32 - .../TestUpdateGo/valid}/github/a.go | 24 +- ...{metadata.yaml => openapi_operations.yaml} | 4 - tools/metadata/testdata/unused/github/a.go | 8 + .../openapi_operations.yaml} | 19 +- .../testdata/update-go/invalid/github/a.go | 24 + .../update-go/invalid/openapi_operations.yaml | 16 + .../valid}/github/a.go | 24 +- .../update-go/valid/github/ignoreme.txt | 0 .../valid/openapi_operations.yaml} | 19 +- ...{metadata.yaml => openapi_operations.yaml} | 4 - .../testdata/validate_invalid/github/a.go | 32 - tools/metadata/validate.go | 201 -- 176 files changed, 3368 insertions(+), 4527 deletions(-) rename metadata.yaml => openapi_operations.yaml (76%) create mode 100644 tools/metadata/metadata_test.go delete mode 100644 tools/metadata/testdata/canonize/metadata.yaml delete mode 100644 tools/metadata/testdata/format/metadata.yaml rename tools/metadata/testdata/{validate_invalid/metadata.yaml => format/openapi_operations.yaml} (52%) delete mode 100644 tools/metadata/testdata/golden/TestCanonize/metadata.yaml rename tools/metadata/testdata/golden/TestFormat/{metadata.yaml => openapi_operations.yaml} (56%) delete mode 100644 tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go rename tools/metadata/testdata/{validate_valid => golden/TestUpdateGo/valid}/github/a.go (64%) rename tools/metadata/testdata/golden/TestUpdateOpenAPI/{metadata.yaml => openapi_operations.yaml} (87%) create mode 100644 tools/metadata/testdata/unused/github/a.go rename tools/metadata/testdata/{update-doc-urls/metadata.yaml => unused/openapi_operations.yaml} (57%) create mode 100644 tools/metadata/testdata/update-go/invalid/github/a.go create mode 100644 tools/metadata/testdata/update-go/invalid/openapi_operations.yaml rename tools/metadata/testdata/{update-doc-urls => update-go/valid}/github/a.go (53%) create mode 100644 tools/metadata/testdata/update-go/valid/github/ignoreme.txt rename tools/metadata/testdata/{validate_valid/metadata.yaml => update-go/valid/openapi_operations.yaml} (51%) rename tools/metadata/testdata/update-openapi/{metadata.yaml => openapi_operations.yaml} (62%) delete mode 100644 tools/metadata/testdata/validate_invalid/github/a.go delete mode 100644 tools/metadata/validate.go diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bbc8a188184..7f7170ef98c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,9 @@ -# How to contribute # +# How to contribute We'd love to accept your patches and contributions to this project. There are a just a few small guidelines you need to follow. - -## Contributor License Agreement ## +## Contributor License Agreement Contributions to any Google project must be accompanied by a Contributor License Agreement. This is not a copyright **assignment**, it simply gives @@ -17,7 +16,7 @@ You generally only need to submit a CLA once, so if you've already submitted one again. -## Reporting issues ## +## Reporting issues Bugs, feature requests, and development-related questions should be directed to our [GitHub issue tracker](https://github.com/google/go-github/issues). If @@ -29,7 +28,7 @@ how the requested feature would help you do that. Security related bugs can either be reported in the issue tracker, or if they are more sensitive, emailed to . -## Submitting a patch ## +## Submitting a patch 1. It's generally best to start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, @@ -73,17 +72,113 @@ are more sensitive, emailed to . [pull request]: https://help.github.com/articles/creating-a-pull-request [monitored by codecov.io]: https://codecov.io/gh/google/go-github -## Metadata ## - -`metadata.yaml` contains metadata about go-github's code and GitHub's OpenAPI -specification. We use this metadata to keep documentation links up to date and -to keep tabs on coverage of the GitHub API. - -All exported methods on `*Service` structs need to have an entry in the -"methods" section of `metadata.yaml` that maps it to the corresponding -OpenAPI operation. - -## Scripts ## +## Code Comments + +Every exported method needs to have code comments that follow +[Go Doc Comments][]. A typical method's comments will look like this: + +```go +// Get fetches a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} +func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { +u := fmt.Sprintf("repos/%v/%v", owner, repo) +req, err := s.client.NewRequest("GET", u, nil) +... +} +``` + +The first line is the name of the method followed by a short description. This +could also be a longer description if needed, but there is no need to repeat any +details that are documented in GitHub's documentation because users are expected +to follow the documentation links to learn more. + +After the description comes a link to the GitHub API documentation. This is +added or fixed automatically when you run `script/generate.sh`, so you won't +need to set this yourself. + +Finally, the `//meta:operation` comment is a directive to the code generator +that maps the method to the corresponding OpenAPI operation. Once again, there +can be multiple directives for methods that call multiple +endpoints. `script/generate.sh` will normalize these directives for you, so if +you are adding a new method you can use the pattern from the `u := fmt.Sprintf` +line instead of looking up what the url parameters are called in the OpenAPI +description. + +[Go Doc Comments]: https://go.dev/doc/comment + +## Metadata + +GitHub publishes [OpenAPI descriptions of their API][]. We use these +descriptions to keep documentation links up to date and to track of which +methods call which endpoints via the `//meta:operation` comments described +above. GitHub's descriptions are far too large to keep in this repository or to +pull down every time we generate code, so we keep only the metadata we need +in `openapi_operations.yaml`. + +### openapi_operations.yaml + +Most contributors won't need to interact with `openapi_operations.yaml`, but it +may be useful to know what it is. Its sections are: + +- `openapi_operations` - is the metadata that comes from GitHub's OpenAPI + descriptions. It is generated by `script/metadata.sh update-openapi` and + should not be edited by hand. In the rare case where it needs to be + overridden, use the + `operation_overrides` section instead. + + An operation consists of `name`, `documentation_url`, + and `openapi_files`. `openapi_files` is the list of files where the operation + is described. In order or preference, values can be "api.github.com.json" for + operations available on the free plan, "ghec.json" for operations available on + GitHub Enterprise Cloud or "ghes-.json" for operations available on + GitHub Enterprise Server. When an operation is described in multiple ghes + files, only the most recent version is included. `documentation_url` is the + URL that should be linked from godoc. It is the documentation link found in + the first file listed in `openapi_files`. + +- `openapi_commit` - is the git commit that `script/metadata.sh update-openapi` + saw when it last updated `openapi_operations`. It is not necessarily the most + recent commit seen because `update-openapi` doesn't update the file when + there are no changes to `openapi_operations`. + +- `operations` - contains manually added metadata that is not in GitHub's + OpenAPI descriptions. There are only a few of these. Some have + documentation_urls that point to relevant GitHub documentation that is not in + the OpenAPI descriptions. Others have no documentation_url and result in a + note in the generated code that the documentation is missing. + +- `operation_overrides` - is where we override the documentation_url for + operations where the link in the OpenAPI descriptions is wrong. + +### tools/metadata + +The `tools/metadata` package is a command-line tool for working with metadata. +In a typical workflow, you won't use it directly, but you will use it indirectly +through `script/generate.sh` and `script/lint.sh`. + +Its subcommands are: + +- `update-openapi` - updates `openapi_operations.yaml` with the latest + information from GitHub's OpenAPI descriptions. With `--validate` it will + validate that the descriptions are correct as of the commit + in `openapi_commit`. `update-openapi --validate` is called + by `script/lint.sh`. + +- `update-go` - updates go files with documentation urls and formats comments. + It is used by `script/generate.sh`. + +- `format` - formats whitespace in `openapi_operations.yaml` and sorts its + arrays. It is used by `script/fmt.sh`. + +- `unused` - lists operations from `openapi_operations.yaml` that are not mapped + from any methods. + +[OpenAPI descriptions of their API]: https://github.com/github/rest-api-description + +## Scripts The `script` directory has shell scripts that help with common development tasks. @@ -96,6 +191,9 @@ tasks. **script/lint.sh** runs linters on the project and checks generated files are current. +**script/metadata.sh** runs tools/metadata. See the [Metadata](#metadata) +section for more information. + **script/test.sh** runs tests on all modules. ## Other notes on code organization ## @@ -114,7 +212,7 @@ defined at live in [repos_hooks.go]: https://github.com/google/go-github/blob/master/github/repos_hooks.go -## Maintainer's Guide ## +## Maintainer's Guide (These notes are mostly only for people merging in pull requests.) diff --git a/github/actions.go b/github/actions.go index 8d552f2d0db..4b88a1e1145 100644 --- a/github/actions.go +++ b/github/actions.go @@ -8,5 +8,5 @@ package github // ActionsService handles communication with the actions related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/actions/ +// GitHub API docs: https://docs.github.com/rest/actions/ type ActionsService service diff --git a/github/actions_artifacts.go b/github/actions_artifacts.go index 6389268b4ea..f804b809b4a 100644 --- a/github/actions_artifacts.go +++ b/github/actions_artifacts.go @@ -14,7 +14,7 @@ import ( // ArtifactWorkflowRun represents a GitHub artifact's workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts type ArtifactWorkflowRun struct { ID *int64 `json:"id,omitempty"` RepositoryID *int64 `json:"repository_id,omitempty"` @@ -27,7 +27,7 @@ type ArtifactWorkflowRun struct { // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -44,7 +44,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -52,7 +52,9 @@ type ArtifactList struct { // ListArtifacts lists all artifacts that belong to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-artifacts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) @@ -76,7 +78,9 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, // ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/artifacts", owner, repo, runID) u, err := addOptions(u, opts) @@ -100,7 +104,9 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re // GetArtifact gets a specific artifact for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#get-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) @@ -120,7 +126,9 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact +// +//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) @@ -144,7 +152,9 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin // DeleteArtifact deletes a workflow run artifact. // -// GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact +// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID) diff --git a/github/actions_cache.go b/github/actions_cache.go index 5b047edcf3e..271d7d82069 100644 --- a/github/actions_cache.go +++ b/github/actions_cache.go @@ -12,7 +12,7 @@ import ( // ActionsCache represents a GitHub action cache. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#about-the-cache-api +// GitHub API docs: https://docs.github.com/rest/actions/cache#about-the-cache-api type ActionsCache struct { ID *int64 `json:"id,omitempty" url:"-"` Ref *string `json:"ref,omitempty" url:"ref"` @@ -25,7 +25,7 @@ type ActionsCache struct { // ActionsCacheList represents a list of GitHub actions Cache. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository type ActionsCacheList struct { TotalCount int `json:"total_count"` ActionsCaches []*ActionsCache `json:"actions_caches,omitempty"` @@ -33,7 +33,7 @@ type ActionsCacheList struct { // ActionsCacheUsage represents a GitHub Actions Cache Usage object. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsage struct { FullName string `json:"full_name"` ActiveCachesSizeInBytes int64 `json:"active_caches_size_in_bytes"` @@ -42,7 +42,7 @@ type ActionsCacheUsage struct { // ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository type ActionsCacheUsageList struct { TotalCount int `json:"total_count"` RepoCacheUsage []*ActionsCacheUsage `json:"repository_cache_usages,omitempty"` @@ -50,7 +50,7 @@ type ActionsCacheUsageList struct { // TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise type TotalCacheUsage struct { TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"` TotalActiveCachesCount int `json:"total_active_caches_count"` @@ -58,7 +58,7 @@ type TotalCacheUsage struct { // ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository type ActionsCacheListOptions struct { ListOptions // The Git reference for the results you want to list. @@ -77,7 +77,9 @@ type ActionsCacheListOptions struct { // // Permissions: must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/caches func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +109,9 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/caches func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches", owner, repo) u, err := addOptions(u, ActionsCache{Key: &key, Ref: ref}) @@ -127,7 +131,9 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key // // Permissions: You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -144,7 +150,9 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin // Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an // access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/cache/usage func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +175,9 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-repositories-with-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/cache/usage-by-repository func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage-by-repository", org) u, err := addOptions(u, opts) @@ -195,7 +205,9 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. // GitHub Apps must have the organization_admistration:read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/cache/usage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -218,6 +230,8 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin // Permissions: You must authenticate using an access token with the "admin:enterprise" scope to use this endpoint. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/cache/usage func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index b7f2d26ae9c..596aa9d981e 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -18,7 +18,9 @@ type OIDCSubjectClaimCustomTemplate struct { // GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -26,7 +28,9 @@ func (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.getOIDCSubjectClaimCustomTemplate(ctx, u) @@ -49,7 +53,9 @@ func (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, // SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/oidc/customization/sub func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/sub", org) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) @@ -57,7 +63,9 @@ func (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Contex // SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/oidc/customization/sub func (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/oidc/customization/sub", owner, repo) return s.setOIDCSubjectClaimCustomTemplate(ctx, u, template) diff --git a/github/actions_permissions_enterprise.go b/github/actions_permissions_enterprise.go index 8311e729438..41c5faefab3 100644 --- a/github/actions_permissions_enterprise.go +++ b/github/actions_permissions_enterprise.go @@ -32,6 +32,8 @@ func (a ActionsPermissionsEnterprise) String() string { // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) @@ -52,6 +54,8 @@ func (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, // EditActionsPermissionsInEnterprise sets the permissions policy in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions func (s *ActionsService) EditActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions", enterprise) req, err := s.client.NewRequest("PUT", u, actionsPermissionsEnterprise) @@ -71,6 +75,8 @@ func (s *ActionsService) EditActionsPermissionsInEnterprise(ctx context.Context, // ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) u, err := addOptions(u, opts) @@ -95,6 +101,8 @@ func (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner // SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", owner) @@ -116,6 +124,8 @@ func (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner s // AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) @@ -135,6 +145,8 @@ func (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner st // RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", owner, organizationID) @@ -154,6 +166,8 @@ func (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner // GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) @@ -174,6 +188,8 @@ func (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, ente // EditActionsAllowedInEnterprise sets the actions that are allowed in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actions func (s *ActionsService) EditActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", enterprise) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/actions_permissions_orgs.go b/github/actions_permissions_orgs.go index 801f1d97437..17974109e5d 100644 --- a/github/actions_permissions_orgs.go +++ b/github/actions_permissions_orgs.go @@ -12,7 +12,7 @@ import ( // ActionsPermissions represents a policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsPermissions struct { EnabledRepositories *string `json:"enabled_repositories,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -31,7 +31,7 @@ type ActionsEnabledOnOrgRepos struct { // ActionsAllowed represents selected actions that are allowed. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsAllowed struct { GithubOwnedAllowed *bool `json:"github_owned_allowed,omitempty"` VerifiedAllowed *bool `json:"verified_allowed,omitempty"` @@ -44,7 +44,9 @@ func (a ActionsAllowed) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) @@ -64,7 +66,9 @@ func (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions func (s *ActionsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions", org) req, err := s.client.NewRequest("PUT", u, actionsPermissions) @@ -83,7 +87,9 @@ func (s *ActionsService) EditActionsPermissions(ctx context.Context, org string, // ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/repositories func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) u, err := addOptions(u, opts) @@ -107,7 +113,9 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string // SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/repositories func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) @@ -128,7 +136,9 @@ func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, // AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -147,7 +157,9 @@ func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, // RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) @@ -166,7 +178,9 @@ func (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner stri // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) @@ -186,7 +200,9 @@ func (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*Ac // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *ActionsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/permissions/selected-actions", org) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go index 18c29869be8..b89741a82a1 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -68,6 +68,8 @@ type RepoRequiredWorkflows struct { // ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) u, err := addOptions(url, opts) @@ -92,6 +94,8 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin // CreateRequiredWorkflow creates the required workflow in an org. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation POST /orgs/{org}/actions/required_workflows func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) @@ -111,6 +115,8 @@ func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, // GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) @@ -131,6 +137,8 @@ func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner stri // UpdateRequiredWorkflow updates a required workflow in an org. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PATCH /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) @@ -150,6 +158,8 @@ func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, // DeleteRequiredWorkflow deletes a required workflow in an org. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id} func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -162,6 +172,8 @@ func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, // ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) u, err := addOptions(url, opts) @@ -185,6 +197,8 @@ func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, // SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` @@ -201,6 +215,8 @@ func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, o // AddRepoToRequiredWorkflow adds the Repository to a required workflow. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("PUT", url, nil) @@ -213,6 +229,8 @@ func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org stri // RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) req, err := s.client.NewRequest("DELETE", url, nil) @@ -225,6 +243,8 @@ func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org // ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. // // GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows +// +//meta:operation GET /repos/{owner}/{repo}/actions/required_workflows func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) u, err := addOptions(url, opts) diff --git a/github/actions_runner_groups.go b/github/actions_runner_groups.go index 483ba6c4726..a1f453f3c67 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -81,6 +81,8 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) u, err := addOptions(u, opts) @@ -105,6 +107,8 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,6 +128,8 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) @@ -138,6 +144,8 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups", org) req, err := s.client.NewRequest("POST", u, createReq) @@ -157,6 +165,8 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// +//meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v", org, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -176,6 +186,8 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) u, err := addOptions(u, opts) @@ -201,6 +213,8 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // with a new List of repositories. // // GitHub API docs: 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 +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories", org, groupID) @@ -216,6 +230,8 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // The runner group must have visibility set to 'selected'. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -231,6 +247,8 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // The runner group must have visibility set to 'selected'. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/repositories/%v", org, groupID, repoID) @@ -245,6 +263,8 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) u, err := addOptions(u, opts) @@ -270,6 +290,8 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // with a new list of runners. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners", org, groupID) @@ -284,6 +306,8 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) @@ -299,6 +323,8 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // The runner is then returned to the default group. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runner-groups/%v/runners/%v", org, groupID, runnerID) diff --git a/github/actions_runners.go b/github/actions_runners.go index d54d6d41ca2..90cf5804e1e 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -22,7 +22,9 @@ type RunnerApplicationDownload struct { // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners/downloads func (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/downloads", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -58,7 +60,9 @@ type JITRunnerConfig struct { // GenerateOrgJITConfig generate a just-in-time configuration for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) req, err := s.client.NewRequest("POST", u, request) @@ -77,7 +81,9 @@ func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, // GenerateRepoJITConfig generates a just-in-time configuration for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig func (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/generate-jitconfig", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -102,7 +108,9 @@ type RegistrationToken struct { // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/registration-token func (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/registration-token", owner, repo) @@ -145,7 +153,9 @@ type Runners struct { // ListRunners lists all the self-hosted runners for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +179,9 @@ func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, op // GetRunner gets a specific self-hosted runner for a repository using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -194,7 +206,9 @@ type RemoveToken struct { // CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/actions/runners/remove-token func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/remove-token", owner, repo) @@ -214,7 +228,9 @@ func (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo stri // RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners/%v", owner, repo, runnerID) @@ -228,7 +244,9 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners/downloads func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) req, err := s.client.NewRequest("GET", u, nil) @@ -247,7 +265,9 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/registration-token func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) @@ -267,7 +287,9 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // ListOrganizationRunners lists all the self-hosted runners for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners", owner) u, err := addOptions(u, opts) @@ -291,7 +313,9 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) req, err := s.client.NewRequest("GET", u, nil) @@ -310,7 +334,9 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/runners/remove-token func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) @@ -330,7 +356,9 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id. // -// GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) diff --git a/github/actions_secrets.go b/github/actions_secrets.go index 49985e12afa..2d4ba98db30 100644 --- a/github/actions_secrets.go +++ b/github/actions_secrets.go @@ -64,7 +64,9 @@ func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicK // GetRepoPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets/public-key func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -72,7 +74,9 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin // GetOrgPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/actions/secrets/public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -80,7 +84,9 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) return s.getPublicKey(ctx, url) @@ -124,7 +130,9 @@ func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *List // ListRepoSecrets lists all secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -133,7 +141,9 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string // ListOrgSecrets lists all secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/actions/secrets func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets", org) return s.listSecrets(ctx, url, opts) @@ -141,7 +151,9 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) return s.listSecrets(ctx, url, opts) @@ -164,7 +176,9 @@ func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *R // GetRepoSecret gets a single repository secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -172,7 +186,9 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st // GetOrgSecret gets a single organization secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -180,7 +196,9 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.getSecret(ctx, url) @@ -213,7 +231,9 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -221,7 +241,9 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -229,7 +251,9 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +// +//meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -246,7 +270,9 @@ func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Respons // DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -254,7 +280,9 @@ func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name // DeleteOrgSecret deletes a secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -262,7 +290,9 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +// +//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) return s.deleteSecret(ctx, url) @@ -296,7 +326,9 @@ func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url str // ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.listSelectedReposForSecret(ctx, url, opts) @@ -317,7 +349,9 @@ func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url stri // SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) return s.setSelectedReposForSecret(ctx, url, ids) @@ -334,7 +368,9 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) @@ -351,7 +387,9 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) diff --git a/github/actions_variables.go b/github/actions_variables.go index 5cab118804e..244d159079e 100644 --- a/github/actions_variables.go +++ b/github/actions_variables.go @@ -51,7 +51,9 @@ func (s *ActionsService) listVariables(ctx context.Context, url string, opts *Li // ListRepoVariables lists all variables available in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-repository-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables +// +//meta:operation GET /repos/{owner}/{repo}/actions/variables func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.listVariables(ctx, url, opts) @@ -59,7 +61,9 @@ func (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo stri // ListOrgVariables lists all variables available in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-organization-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables +// +//meta:operation GET /orgs/{org}/actions/variables func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.listVariables(ctx, url, opts) @@ -67,7 +71,9 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // ListEnvVariables lists all variables available in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-environment-variables +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.listVariables(ctx, url, opts) @@ -90,7 +96,9 @@ func (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsV // GetRepoVariable gets a single repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable +// +//meta:operation GET /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.getVariable(ctx, url) @@ -98,7 +106,9 @@ func (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name // GetOrgVariable gets a single organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable +// +//meta:operation GET /orgs/{org}/actions/variables/{name} func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.getVariable(ctx, url) @@ -106,7 +116,9 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // GetEnvVariable gets a single environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#get-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable +// +//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.getVariable(ctx, url) @@ -122,7 +134,9 @@ func (s *ActionsService) postVariable(ctx context.Context, url string, variable // CreateRepoVariable creates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable +// +//meta:operation POST /repos/{owner}/{repo}/actions/variables func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables", owner, repo) return s.postVariable(ctx, url, variable) @@ -130,7 +144,9 @@ func (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo str // CreateOrgVariable creates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable +// +//meta:operation POST /orgs/{org}/actions/variables func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables", org) return s.postVariable(ctx, url, variable) @@ -138,7 +154,9 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // CreateEnvVariable creates an environment variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#create-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable +// +//meta:operation POST /repositories/{repository_id}/environments/{environment_name}/variables func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) return s.postVariable(ctx, url, variable) @@ -154,7 +172,9 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // UpdateRepoVariable updates a repository variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable +// +//meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) return s.patchVariable(ctx, url, variable) @@ -162,7 +182,9 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // UpdateOrgVariable updates an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#update-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable +// +//meta:operation PATCH /orgs/{org}/actions/variables/{name} func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) return s.patchVariable(ctx, url, variable) @@ -171,6 +193,8 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // UpdateEnvVariable updates an environment variable. // // GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable +// +//meta:operation PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) return s.patchVariable(ctx, url, variable) @@ -187,7 +211,9 @@ func (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Respo // DeleteRepoVariable deletes a variable in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-a-repository-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, name) return s.deleteVariable(ctx, url) @@ -195,7 +221,9 @@ func (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, na // DeleteOrgVariable deletes a variable in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +// +//meta:operation DELETE /orgs/{org}/actions/variables/{name} func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, name) return s.deleteVariable(ctx, url) @@ -203,7 +231,9 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // DeleteEnvVariable deletes a variable in an environment. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#delete-an-environment-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +// +//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) return s.deleteVariable(ctx, url) @@ -231,7 +261,9 @@ func (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url s // ListSelectedReposForOrgVariable lists all repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +// +//meta:operation GET /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.listSelectedReposForVariable(ctx, url, opts) @@ -252,7 +284,9 @@ func (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url st // SetSelectedReposForOrgVariable sets the repositories that have access to a variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +// +//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories func (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories", org, name) return s.setSelectedReposForVariable(ctx, url, ids) @@ -269,7 +303,9 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // AddSelectedRepoToOrgVariable adds a repository to an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +// +//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToVariable(ctx, url) @@ -286,7 +322,9 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable. // -// GitHub API docs: https://docs.github.com/en/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +// +//meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromVariable(ctx, url) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 87d117ba9a9..0e0eb6e1146 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -70,7 +70,9 @@ type ListWorkflowJobsOptions struct { // ListWorkflowJobs lists all jobs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs/%v/jobs", owner, repo, runID) u, err := addOptions(u, opts) @@ -94,7 +96,9 @@ func (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo strin // GetWorkflowJobByID gets a specific job in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id} func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v", owner, repo, jobID) @@ -114,7 +118,9 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str // GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go index d4a540a138d..d5e28fb45a5 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -127,6 +127,8 @@ func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, // ListWorkflowRunsByID lists all workflow runs by workflow ID. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowID) return s.listWorkflowRuns(ctx, u, opts) @@ -135,6 +137,8 @@ func (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo s // ListWorkflowRunsByFileName lists all workflow runs by workflow file name. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows/%v/runs", owner, repo, workflowFileName) return s.listWorkflowRuns(ctx, u, opts) @@ -142,7 +146,9 @@ func (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, // ListRepositoryWorkflowRuns lists all workflow runs for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/runs", owner, repo) u, err := addOptions(u, opts) @@ -166,7 +172,9 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, // GetWorkflowRunByID gets a specific workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -186,7 +194,9 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str // GetWorkflowRunAttempt gets a specific workflow run attempt. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run-attempt +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v", owner, repo, runID, attemptNumber) u, err := addOptions(u, opts) @@ -210,7 +220,9 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) @@ -230,7 +242,9 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r // RerunWorkflowByID re-runs a workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun", owner, repo, runID) @@ -244,7 +258,9 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/rerun-failed-jobs", owner, repo, runID) @@ -258,7 +274,9 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/rerun", owner, repo, jobID) @@ -272,7 +290,9 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j // CancelWorkflowRunByID cancels a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/cancel", owner, repo, runID) @@ -286,7 +306,9 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -306,7 +328,9 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str // DeleteWorkflowRun deletes a workflow run by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id} func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) @@ -320,7 +344,9 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri // DeleteWorkflowRunLogs deletes all logs for a workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-workflow-run-logs +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +// +//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) @@ -334,7 +360,9 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#get-workflow-run-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/timing", owner, repo, runID) @@ -354,7 +382,9 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) diff --git a/github/actions_workflows.go b/github/actions_workflows.go index c9b47ed4be4..0214e6abff2 100644 --- a/github/actions_workflows.go +++ b/github/actions_workflows.go @@ -58,7 +58,9 @@ type CreateWorkflowDispatchEventRequest struct { // ListWorkflows lists all workflows in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#list-repository-workflows +// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) { u := fmt.Sprintf("repos/%s/%s/actions/workflows", owner, repo) u, err := addOptions(u, opts) @@ -82,7 +84,9 @@ func (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, // GetWorkflowByID gets a specific workflow by ID. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowID) @@ -91,7 +95,9 @@ func (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string // GetWorkflowByFileName gets a specific workflow by file name. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} func (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v", owner, repo, workflowFileName) @@ -115,7 +121,9 @@ func (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow // GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowID) @@ -124,7 +132,9 @@ func (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo s // GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#get-workflow-usage +// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage +// +//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing func (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/timing", owner, repo, workflowFileName) @@ -148,7 +158,9 @@ func (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*Wor // CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowID) @@ -157,7 +169,9 @@ func (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, ow // CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run. // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event +// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches func (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/dispatches", owner, repo, workflowFileName) @@ -175,7 +189,9 @@ func (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url st // EnableWorkflowByID enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -183,7 +199,9 @@ func (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo str // EnableWorkflowByFileName enables a workflow and sets the state of the workflow to "active". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/enable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) @@ -191,7 +209,9 @@ func (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, re // DisableWorkflowByID disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowID) return s.doNewPutRequest(ctx, u) @@ -199,7 +219,9 @@ func (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo st // DisableWorkflowByFileName disables a workflow and sets the state of the workflow to "disabled_manually". // -// GitHub API docs: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow +// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow +// +//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable func (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/workflows/%v/disable", owner, repo, workflowFileName) return s.doNewPutRequest(ctx, u) diff --git a/github/activity.go b/github/activity.go index f92c8e41a31..edf8cc4397c 100644 --- a/github/activity.go +++ b/github/activity.go @@ -10,7 +10,7 @@ import "context" // ActivityService handles communication with the activity related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/activity/ +// GitHub API docs: https://docs.github.com/rest/activity/ type ActivityService service // FeedLink represents a link to a related resource. @@ -59,6 +59,8 @@ type FeedLinks struct { // since current feed URIs use the older, non revocable auth tokens. // // GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds +// +//meta:operation GET /feeds func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) { req, err := s.client.NewRequest("GET", "feeds", nil) if err != nil { diff --git a/github/activity_events.go b/github/activity_events.go index d6f0f043b08..b12baa99e67 100644 --- a/github/activity_events.go +++ b/github/activity_events.go @@ -12,7 +12,9 @@ import ( // ListEvents drinks from the firehose of all public events across GitHub. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events +// +//meta:operation GET /events func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) { u, err := addOptions("events", opts) if err != nil { @@ -35,7 +37,9 @@ func (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([] // ListRepositoryEvents lists events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-repository-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events +// +//meta:operation GET /repos/{owner}/{repo}/events func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("repos/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -59,7 +63,9 @@ func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo // ListIssueEventsForRepository lists issue events for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/events func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -83,7 +89,9 @@ func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owne // ListEventsForRepoNetwork lists public events for a network of repositories. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-network-of-repositories +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +// +//meta:operation GET /networks/{owner}/{repo}/events func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("networks/%v/%v/events", owner, repo) u, err := addOptions(u, opts) @@ -107,7 +115,9 @@ func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, r // ListEventsForOrganization lists public events for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-organization-events +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events +// +//meta:operation GET /orgs/{org}/events func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("orgs/%v/events", org) u, err := addOptions(u, opts) @@ -132,8 +142,11 @@ func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org str // ListEventsPerformedByUser lists the events performed by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-for-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +// +//meta:operation GET /users/{username}/events +//meta:operation GET /users/{username}/events/public func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -163,8 +176,11 @@ func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user st // ListEventsReceivedByUser lists the events received by a user. If publicOnly is // true, only public events will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-events-received-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-public-events-received-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +// +//meta:operation GET /users/{username}/received_events +//meta:operation GET /users/{username}/received_events/public func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) { var u string if publicOnly { @@ -194,7 +210,9 @@ func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user str // ListUserEventsForOrganization provides the user’s organization dashboard. You // must be authenticated as the user to view this. // -// GitHub API docs: https://docs.github.com/en/rest/activity/events#list-organization-events-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +// +//meta:operation GET /users/{username}/events/orgs/{org} func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) { u := fmt.Sprintf("users/%v/events/orgs/%v", user, org) u, err := addOptions(u, opts) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 5c8fe95a2c5..47f22261dd2 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -19,7 +19,7 @@ type Notification struct { // Reason identifies the event that triggered the notification. // - // GitHub API docs: https://docs.github.com/en/rest/activity#notification-reasons + // GitHub API docs: https://docs.github.com/rest/activity#notification-reasons Reason *string `json:"reason,omitempty"` Unread *bool `json:"unread,omitempty"` @@ -49,7 +49,9 @@ type NotificationListOptions struct { // ListNotifications lists all notifications for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +// +//meta:operation GET /notifications func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := "notifications" u, err := addOptions(u, opts) @@ -74,7 +76,9 @@ func (s *ActivityService) ListNotifications(ctx context.Context, opts *Notificat // ListRepositoryNotifications lists all notifications in a given repository // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +// +//meta:operation GET /repos/{owner}/{repo}/notifications func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) { u := fmt.Sprintf("repos/%v/%v/notifications", owner, repo) u, err := addOptions(u, opts) @@ -103,6 +107,8 @@ type markReadOptions struct { // MarkNotificationsRead marks all notifications up to lastRead as read. // // GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read +// +//meta:operation PUT /notifications func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -118,7 +124,9 @@ func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Ti // MarkRepositoryNotificationsRead marks all notifications up to lastRead in // the specified repository as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-repository-notifications-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +// +//meta:operation PUT /repos/{owner}/{repo}/notifications func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) { opts := &markReadOptions{ LastReadAt: lastRead, @@ -134,7 +142,9 @@ func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, o // GetThread gets the specified notification thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread +// +//meta:operation GET /notifications/threads/{thread_id} func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -154,7 +164,9 @@ func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notificati // MarkThreadRead marks the specified thread as read. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +// +//meta:operation PATCH /notifications/threads/{thread_id} func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v", id) @@ -169,7 +181,9 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +// +//meta:operation GET /notifications/threads/{thread_id}/subscription func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -190,7 +204,9 @@ func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) // SetThreadSubscription sets the subscription for the specified thread for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#set-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription +// +//meta:operation PUT /notifications/threads/{thread_id}/subscription func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) @@ -211,7 +227,9 @@ func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, // DeleteThreadSubscription deletes the subscription for the specified thread // for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription +// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription +// +//meta:operation DELETE /notifications/threads/{thread_id}/subscription func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("notifications/threads/%v/subscription", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_star.go b/github/activity_star.go index 65a316f5325..cebdacf76a9 100644 --- a/github/activity_star.go +++ b/github/activity_star.go @@ -25,7 +25,9 @@ type Stargazer struct { // ListStargazers lists people who have starred the specified repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-stargazers +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers +// +//meta:operation GET /repos/{owner}/{repo}/stargazers func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) { u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo) u, err := addOptions(u, opts) @@ -67,8 +69,11 @@ type ActivityListStarredOptions struct { // ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +// +//meta:operation GET /user/starred +//meta:operation GET /users/{username}/starred func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) { var u string if user != "" { @@ -101,7 +106,9 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac // IsStarred checks if a repository is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +// +//meta:operation GET /user/starred/{owner}/{repo} func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +123,9 @@ func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bo // Star a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#star-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +// +//meta:operation PUT /user/starred/{owner}/{repo} func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("PUT", u, nil) @@ -129,7 +138,9 @@ func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Respon // Unstar a repository as the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +// +//meta:operation DELETE /user/starred/{owner}/{repo} func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("user/starred/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/activity_watching.go b/github/activity_watching.go index 2d6fafcc793..348590057b9 100644 --- a/github/activity_watching.go +++ b/github/activity_watching.go @@ -27,7 +27,9 @@ type Subscription struct { // ListWatchers lists watchers of a particular repo. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-watchers +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers +// +//meta:operation GET /repos/{owner}/{repo}/subscribers func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscribers", owner, repo) u, err := addOptions(u, opts) @@ -52,8 +54,11 @@ func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, // ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +// +//meta:operation GET /user/subscriptions +//meta:operation GET /users/{username}/subscriptions func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -84,7 +89,9 @@ func (s *ActivityService) ListWatched(ctx context.Context, user string, opts *Li // repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#get-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +// +//meta:operation GET /repos/{owner}/{repo}/subscription func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -111,7 +118,9 @@ func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, // To ignore notifications made within a repository, set subscription.Ignored to true. // To stop watching a repository, use DeleteRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#set-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +// +//meta:operation PUT /repos/{owner}/{repo}/subscription func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) @@ -135,7 +144,9 @@ func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, // This is used to stop watching a repository. To control whether or not to // receive notifications from a repository, use SetRepositorySubscription. // -// GitHub API docs: https://docs.github.com/en/rest/activity/watching#delete-a-repository-subscription +// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +// +//meta:operation DELETE /repos/{owner}/{repo}/subscription func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/subscription", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/admin.go b/github/admin.go index f9d85d2b75e..8eee9854c11 100644 --- a/github/admin.go +++ b/github/admin.go @@ -14,7 +14,7 @@ import ( // GitHub API. These API routes are normally only accessible for GitHub // Enterprise installations. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin +// GitHub API docs: https://docs.github.com/rest/enterprise-admin type AdminService service // TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group. @@ -83,6 +83,8 @@ 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 +// +//meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/users/%v/mapping", user) req, err := s.client.NewRequest("PATCH", u, mapping) @@ -102,6 +104,8 @@ 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 +// +//meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { u := fmt.Sprintf("admin/ldap/teams/%v/mapping", team) req, err := s.client.NewRequest("PATCH", u, mapping) diff --git a/github/admin_orgs.go b/github/admin_orgs.go index 4a22deb8c98..c734d4de12f 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -23,6 +23,8 @@ type createOrgRequest struct { // not be nil. // // GitHub API docs: https://docs.github.com/enterprise-server@3.10/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) { u := "admin/organizations" @@ -60,6 +62,8 @@ 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 +// +//meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { return s.RenameOrgByName(ctx, *org.Login, newName) } @@ -67,6 +71,8 @@ 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 +// +//meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { u := fmt.Sprintf("admin/organizations/%v", org) diff --git a/github/admin_stats.go b/github/admin_stats.go index 9e0bbf77f6f..aa23f5d1995 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -153,6 +153,8 @@ func (s RepoStats) String() string { // 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 +// +//meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/admin_users.go b/github/admin_users.go index 5a7c0e8a099..3916a470b04 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -20,6 +20,8 @@ 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 +// +//meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -45,6 +47,8 @@ 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 +// +//meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -96,6 +100,8 @@ 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 +// +//meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) @@ -116,6 +122,8 @@ 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 +// +//meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%s/authorizations", username) diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 2dac611709e..4c2af156305 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -90,7 +90,7 @@ func TestUserImpersonation_Create(t *testing.T) { "url": "https://git.company.com/api/v3/authorizations/1234", "app": { "name": "GitHub Site Administrator", - "url": "https://docs.github.com/en/rest/enterprise/users/", + "url": "https://docs.github.com/rest/enterprise/users/", "client_id": "1234" }, "token": "1234", @@ -119,7 +119,7 @@ func TestUserImpersonation_Create(t *testing.T) { URL: String("https://git.company.com/api/v3/authorizations/1234"), App: &OAuthAPP{ Name: String("GitHub Site Administrator"), - URL: String("https://docs.github.com/en/rest/enterprise/users/"), + URL: String("https://docs.github.com/rest/enterprise/users/"), ClientID: String("1234"), }, Token: String("1234"), diff --git a/github/apps.go b/github/apps.go index dd9378116cd..f0392f2d706 100644 --- a/github/apps.go +++ b/github/apps.go @@ -13,7 +13,7 @@ import ( // AppsService provides access to the installation related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/apps/ +// GitHub API docs: https://docs.github.com/rest/apps/ type AppsService service // App represents a GitHub App. @@ -60,8 +60,8 @@ type InstallationTokenOptions struct { // // Permission names taken from: // -// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` Administration *string `json:"administration,omitempty"` @@ -160,8 +160,11 @@ func (i Installation) String() string { // You can find this on the settings page for your GitHub App // (e.g., https://github.com/settings/apps/:app_slug). // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +// +//meta:operation GET /app +//meta:operation GET /apps/{app_slug} func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) { var u string if appSlug != "" { @@ -186,7 +189,9 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, // ListInstallationRequests lists the pending installation requests that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app +// +//meta:operation GET /app/installation-requests func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) { u, err := addOptions("app/installation-requests", opts) if err != nil { @@ -209,7 +214,9 @@ func (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOp // ListInstallations lists the installations that the current GitHub App has. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +// +//meta:operation GET /app/installations func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("app/installations", opts) if err != nil { @@ -232,14 +239,18 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) // GetInstallation returns the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app +// +//meta:operation GET /app/installations/{installation_id} func (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("app/installations/%v", id)) } // ListUserInstallations lists installations that are accessible to the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +// +//meta:operation GET /user/installations func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) { u, err := addOptions("user/installations", opts) if err != nil { @@ -264,7 +275,9 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio // SuspendInstallation suspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#suspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +// +//meta:operation PUT /app/installations/{installation_id}/suspended func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -278,7 +291,9 @@ func (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Respo // UnsuspendInstallation unsuspends the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#unsuspend-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +// +//meta:operation DELETE /app/installations/{installation_id}/suspended func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v/suspended", id) @@ -292,7 +307,9 @@ func (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Res // DeleteInstallation deletes the specified installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +// +//meta:operation DELETE /app/installations/{installation_id} func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("app/installations/%v", id) @@ -306,7 +323,9 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon // CreateInstallationToken creates a new installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// +//meta:operation POST /app/installations/{installation_id}/access_tokens func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) { u := fmt.Sprintf("app/installations/%v/access_tokens", id) @@ -327,6 +346,8 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt // CreateAttachment creates a new attachment on user comment containing a url. // // GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment +// +//meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) payload := &Attachment{Title: String(title), Body: String(body)} @@ -349,14 +370,18 @@ func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID i // FindOrganizationInstallation finds the organization's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +// +//meta:operation GET /orgs/{org}/installation func (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org)) } // FindRepositoryInstallation finds the repository's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +// +//meta:operation GET /repos/{owner}/{repo}/installation func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repos/%v/%v/installation", owner, repo)) } @@ -364,13 +389,17 @@ func (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, rep // FindRepositoryInstallationByID finds the repository's installation information. // // Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}/installation". +// +//meta:operation GET /repositories/{repository_id}/installation func (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("repositories/%d/installation", id)) } // FindUserInstallation finds the user's installation information. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +// +//meta:operation GET /users/{username}/installation func (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) { return s.getInstallation(ctx, fmt.Sprintf("users/%v/installation", user)) } diff --git a/github/apps_hooks.go b/github/apps_hooks.go index a11f688b2a5..6046827ef06 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -13,6 +13,8 @@ import ( // The underlying transport must be authenticated as an app. // // GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +// +//meta:operation GET /app/hook/config func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("GET", "app/hook/config", nil) if err != nil { @@ -32,6 +34,8 @@ func (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response // The underlying transport must be authenticated as an app. // // GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +// +//meta:operation PATCH /app/hook/config func (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) { req, err := s.client.NewRequest("PATCH", "app/hook/config", config) if err != nil { diff --git a/github/apps_hooks_deliveries.go b/github/apps_hooks_deliveries.go index 33102f36d2b..59800a0ae43 100644 --- a/github/apps_hooks_deliveries.go +++ b/github/apps_hooks_deliveries.go @@ -12,7 +12,9 @@ import ( // ListHookDeliveries lists deliveries of an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +// +//meta:operation GET /app/hook/deliveries func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u, err := addOptions("app/hook/deliveries", opts) if err != nil { @@ -35,7 +37,9 @@ func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOp // GetHookDelivery returns the App webhook delivery with the specified ID. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +// +//meta:operation GET /app/hook/deliveries/{delivery_id} func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v", deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +58,9 @@ func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*H // RedeliverHookDelivery redelivers a delivery for an App webhook. // -// GitHub API docs: https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +// +//meta:operation POST /app/hook/deliveries/{delivery_id}/attempts func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_installation.go b/github/apps_installation.go index b619080713f..d430511d074 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -19,7 +19,9 @@ type ListRepositories struct { // ListRepos lists the repositories that are accessible to the authenticated installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation +// +//meta:operation GET /installation/repositories func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) { u, err := addOptions("installation/repositories", opts) if err != nil { @@ -52,7 +54,9 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe // ListUserRepos lists repositories that are accessible // to the authenticated user for an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +// +//meta:operation GET /user/installations/{installation_id}/repositories func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories", id) u, err := addOptions(u, opts) @@ -84,7 +88,9 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt // AddRepository adds a single repository to an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +// +//meta:operation PUT /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("PUT", u, nil) @@ -103,7 +109,9 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( // RemoveRepository removes a single repository from an installation. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation +// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +// +//meta:operation DELETE /user/installations/{installation_id}/repositories/{repository_id} func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) { u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -116,7 +124,9 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 // RevokeInstallationToken revokes an installation token. // -// GitHub API docs: https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token +// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +// +//meta:operation DELETE /installation/token func (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) { u := "installation/token" req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/apps_manifest.go b/github/apps_manifest.go index fa4c85379ca..5b6ff9af414 100644 --- a/github/apps_manifest.go +++ b/github/apps_manifest.go @@ -31,7 +31,9 @@ type AppConfig struct { // CompleteAppManifest completes the App manifest handshake flow for the given // code. // -// GitHub API docs: https://docs.github.com/en/rest/apps/apps#create-a-github-app-from-a-manifest +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +// +//meta:operation POST /app-manifests/{code}/conversions func (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) { u := fmt.Sprintf("app-manifests/%s/conversions", code) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index c1f60977319..976775a79a0 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -13,7 +13,7 @@ import ( // MarketplaceService handles communication with the marketplace related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/apps#marketplace +// GitHub API docs: https://docs.github.com/rest/apps#marketplace type MarketplaceService struct { client *Client // Stubbed controls whether endpoints that return stubbed data are used @@ -21,7 +21,7 @@ type MarketplaceService struct { // for testing your GitHub Apps. Stubbed data is hard-coded and will not // change based on actual subscriptions. // - // GitHub API docs: https://docs.github.com/en/rest/apps#testing-with-stubbed-endpoints + // GitHub API docs: https://docs.github.com/rest/apps#testing-with-stubbed-endpoints Stubbed bool } @@ -91,6 +91,9 @@ type MarketplacePurchaseAccount struct { // // GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans // GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +// +//meta:operation GET /marketplace_listing/plans +//meta:operation GET /marketplace_listing/stubbed/plans func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) { uri := s.marketplaceURI("plans") u, err := addOptions(uri, opts) @@ -116,6 +119,9 @@ func (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ( // // GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan // GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +// +//meta:operation GET /marketplace_listing/plans/{plan_id}/accounts +//meta:operation GET /marketplace_listing/stubbed/plans/{plan_id}/accounts func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID)) u, err := addOptions(uri, opts) @@ -141,6 +147,9 @@ func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID // // GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account // GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +// +//meta:operation GET /marketplace_listing/accounts/{account_id} +//meta:operation GET /marketplace_listing/stubbed/accounts/{account_id} func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) { uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID)) @@ -160,8 +169,11 @@ func (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accou // ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed -// GitHub API docs: https://docs.github.com/en/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +// +//meta:operation GET /user/marketplace_purchases +//meta:operation GET /user/marketplace_purchases/stubbed func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) { uri := "user/marketplace_purchases" if s.Stubbed { diff --git a/github/authorizations.go b/github/authorizations.go index 9c821827958..7adc5323678 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -12,7 +12,7 @@ import ( // Scope models a GitHub authorization scope. // -// GitHub API docs: https://docs.github.com/en/rest/oauth/#scopes +// GitHub API docs: https://docs.github.com/rest/oauth/#scopes type Scope string // This is the set of scopes for GitHub API V3 @@ -50,7 +50,7 @@ const ( // This service requires HTTP Basic Authentication; it cannot be accessed using // an OAuth token. // -// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations type AuthorizationsService service // Authorization represents an individual GitHub authorization. @@ -121,7 +121,7 @@ func (a AuthorizationRequest) String() string { // fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // -// GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations#update-an-existing-authorization +// GitHub API docs: https://docs.github.com/rest/oauth-authorizations#update-an-existing-authorization type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` @@ -143,7 +143,9 @@ func (a AuthorizationUpdateRequest) String() string { // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#check-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token +// +//meta:operation POST /applications/{client_id}/token func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -176,7 +178,9 @@ func (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken // // The returned Authorization.User field will be populated. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#reset-a-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +// +//meta:operation PATCH /applications/{client_id}/token func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -205,7 +209,9 @@ func (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken // username is the OAuth application clientID, and the password is its // clientSecret. Invalid tokens will return a 404 Not Found. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +// +//meta:operation DELETE /applications/{client_id}/token func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/token", clientID) @@ -226,7 +232,9 @@ func (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToke // grant will also delete all OAuth tokens associated with the application for // the user. // -// GitHub API docs: https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-authorization +// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +// +//meta:operation DELETE /applications/{client_id}/grant func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) { u := fmt.Sprintf("applications/%v/grant", clientID) @@ -250,6 +258,8 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // 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 +// +//meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("POST", u, authReq) @@ -270,6 +280,8 @@ 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 +// +//meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { u := fmt.Sprintf("admin/users/%v/authorizations", username) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/billing.go b/github/billing.go index 748295ff5fd..6d7579b884d 100644 --- a/github/billing.go +++ b/github/billing.go @@ -13,7 +13,7 @@ import ( // BillingService provides access to the billing related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/billing +// GitHub API docs: https://docs.github.com/rest/billing type BillingService service // ActionBilling represents a GitHub Action billing. @@ -63,6 +63,8 @@ type AdvancedSecurityCommittersBreakdown struct { // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/actions func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/actions", org) req, err := s.client.NewRequest("GET", u, nil) @@ -82,6 +84,8 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( // GetPackagesBillingOrg returns the free and paid storage used for GitHub Packages in gigabytes for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/packages func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/packages", org) req, err := s.client.NewRequest("GET", u, nil) @@ -102,6 +106,8 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) // and GitHub Packages in gigabytes for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/shared-storage func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org) req, err := s.client.NewRequest("GET", u, nil) @@ -121,6 +127,8 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( // GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/billing/advanced-security func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string, opts *ListOptions) (*ActiveCommitters, *Response, error) { u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) u, err := addOptions(u, opts) @@ -145,6 +153,8 @@ func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Cont // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/actions func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) (*ActionBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/actions", user) req, err := s.client.NewRequest("GET", u, nil) @@ -164,6 +174,8 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) // GetPackagesBillingUser returns the free and paid storage used for GitHub Packages in gigabytes for a user. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/packages func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string) (*PackageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/packages", user) req, err := s.client.NewRequest("GET", u, nil) @@ -184,6 +196,8 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string // and GitHub Packages in gigabytes for a user. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/shared-storage func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) (*StorageBilling, *Response, error) { u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/checks.go b/github/checks.go index 12d08530ca0..a8618944532 100644 --- a/github/checks.go +++ b/github/checks.go @@ -13,7 +13,7 @@ import ( // ChecksService provides access to the Checks API in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/checks/ +// GitHub API docs: https://docs.github.com/rest/checks/ type ChecksService service // CheckRun represents a GitHub check run on a repository associated with a GitHub app. @@ -98,7 +98,9 @@ func (c CheckSuite) String() string { // GetCheckRun gets a check-run for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#get-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run +// +//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +121,9 @@ func (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, che // GetCheckSuite gets a single check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#get-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite +// +//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id} func (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v", owner, repo, checkSuiteID) req, err := s.client.NewRequest("GET", u, nil) @@ -161,7 +165,9 @@ type CheckRunAction struct { // CreateCheckRun creates a check run for repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run +// +//meta:operation POST /repos/{owner}/{repo}/check-runs func (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -194,7 +200,9 @@ type UpdateCheckRunOptions struct { // UpdateCheckRun updates a check run for a specific commit in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#update-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run +// +//meta:operation PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v", owner, repo, checkRunID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -215,7 +223,9 @@ func (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, // ListCheckRunAnnotations lists the annotations for a check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-run-annotations +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations +// +//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations func (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/annotations", owner, repo, checkRunID) u, err := addOptions(u, opts) @@ -257,7 +267,9 @@ type ListCheckRunsResults struct { // ListCheckRunsForRef lists check runs for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -283,7 +295,9 @@ func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, re // ListCheckRunsCheckSuite lists check runs for a check suite. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#list-check-runs-in-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +// +//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/check-runs", owner, repo, checkSuiteID) u, err := addOptions(u, opts) @@ -309,7 +323,9 @@ func (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo // ReRequestCheckRun triggers GitHub to rerequest an existing check run. // -// GitHub API docs: https://docs.github.com/en/rest/checks/runs#rerequest-a-check-run +// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +// +//meta:operation POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-runs/%v/rerequest", owner, repo, checkRunID) @@ -339,7 +355,9 @@ type ListCheckSuiteResults struct { // ListCheckSuitesForRef lists check suite for a specific ref. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#list-check-suites-for-a-git-reference +// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-suites func (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/check-suites", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -387,7 +405,9 @@ type PreferenceList struct { // SetCheckSuitePreferences changes the default automatic flow when creating check suites. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#update-repository-preferences-for-check-suites +// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +// +//meta:operation PATCH /repos/{owner}/{repo}/check-suites/preferences func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/preferences", owner, repo) req, err := s.client.NewRequest("PATCH", u, opts) @@ -414,7 +434,9 @@ type CreateCheckSuiteOptions struct { // CreateCheckSuite manually creates a check suite for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#create-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite +// +//meta:operation POST /repos/{owner}/{repo}/check-suites func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -435,7 +457,9 @@ func (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string // ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. // -// GitHub API docs: https://docs.github.com/en/rest/checks/suites#rerequest-a-check-suite +// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +// +//meta:operation POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest func (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/check-suites/%v/rerequest", owner, repo, checkSuiteID) diff --git a/github/code-scanning.go b/github/code-scanning.go index 5fd2d60b786..74a7b6c9b47 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -15,7 +15,7 @@ import ( // CodeScanningService handles communication with the code scanning related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeScanningService service // Rule represents the complete details of GitHub Code Scanning alert type. @@ -67,7 +67,7 @@ type Tool struct { // Alert represents an individual GitHub Code Scanning Alert on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type Alert struct { Number *int `json:"number,omitempty"` Repository *Repository `json:"repository,omitempty"` @@ -160,7 +160,7 @@ type AnalysesListOptions struct { // CodeQLDatabase represents a metadata about the CodeQL database. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeQLDatabase struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -175,7 +175,7 @@ type CodeQLDatabase struct { // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type ScanningAnalysis struct { ID *int64 `json:"id,omitempty"` Ref *string `json:"ref,omitempty"` @@ -196,7 +196,7 @@ type ScanningAnalysis struct { // SarifAnalysis specifies the results of a code scanning job. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type SarifAnalysis struct { CommitSHA *string `json:"commit_sha,omitempty"` Ref *string `json:"ref,omitempty"` @@ -208,7 +208,7 @@ type SarifAnalysis struct { // CodeScanningAlertState specifies the state of a code scanning alert. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type CodeScanningAlertState struct { // State sets the state of the code scanning alert and is a required field. // You must also provide DismissedReason when you set the state to "dismissed". @@ -224,7 +224,7 @@ type CodeScanningAlertState struct { // SarifID identifies a sarif analysis upload. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning +// GitHub API docs: https://docs.github.com/rest/code-scanning type SarifID struct { ID *string `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -235,7 +235,9 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -263,7 +265,9 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -292,7 +296,9 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -318,6 +324,8 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, // The security alert_id is the number at the end of the security alert's URL. // // GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +// +//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -340,7 +348,9 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) u, err := addOptions(u, opts) @@ -368,7 +378,9 @@ func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, rep // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +// +//meta:operation POST /repos/{owner}/{repo}/code-scanning/sarifs func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -400,7 +412,9 @@ type SARIFUpload struct { // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) @@ -424,7 +438,9 @@ func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -453,7 +469,9 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -486,7 +504,9 @@ type DeleteAnalysis struct { // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -509,7 +529,9 @@ func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo st // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) @@ -532,7 +554,9 @@ func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, re // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the contents read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) @@ -564,7 +588,9 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +// +//meta:operation GET /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -605,7 +631,9 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +// +//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/default-setup func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/github/codesofconduct.go b/github/codesofconduct.go index 4318ba56d2c..e7a712726f8 100644 --- a/github/codesofconduct.go +++ b/github/codesofconduct.go @@ -28,6 +28,8 @@ func (c *CodeOfConduct) String() string { // List returns all codes of conduct. // // GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +// +//meta:operation GET /codes_of_conduct func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) { req, err := s.client.NewRequest("GET", "codes_of_conduct", nil) if err != nil { @@ -55,6 +57,8 @@ func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Res // Get returns an individual code of conduct. // // GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +// +//meta:operation GET /codes_of_conduct/{key} func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("codes_of_conduct/%s", key) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/codespaces.go b/github/codespaces.go index cd8b0e5bee5..7b716121771 100644 --- a/github/codespaces.go +++ b/github/codespaces.go @@ -13,12 +13,12 @@ import ( // CodespacesService handles communication with the Codespaces related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/ +// GitHub API docs: https://docs.github.com/rest/codespaces/ type CodespacesService service // Codespace represents a codespace. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces +// GitHub API docs: https://docs.github.com/rest/codespaces type Codespace struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -90,7 +90,9 @@ type ListCodespaces struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-in-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +// +//meta:operation GET /repos/{owner}/{repo}/codespaces func (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) u, err := addOptions(u, opts) @@ -124,7 +126,9 @@ type ListCodespacesOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have read access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +// +//meta:operation GET /user/codespaces func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { u := "user/codespaces" u, err := addOptions(u, opts) @@ -172,7 +176,9 @@ type CreateCodespaceOptions struct { // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#create-a-codespace-in-a-repository +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/codespaces func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces", owner, repo) @@ -195,7 +201,9 @@ func (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#start-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +// +//meta:operation POST /user/codespaces/{codespace_name}/start func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/start", codespaceName) @@ -218,7 +226,9 @@ func (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*C // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#stop-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +// +//meta:operation POST /user/codespaces/{codespace_name}/stop func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) @@ -241,7 +251,9 @@ func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Co // You must authenticate using an access token with the codespace scope to use this endpoint. // GitHub Apps must have write access to the codespaces repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#delete-a-codespace-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +// +//meta:operation DELETE /user/codespaces/{codespace_name} func (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) { u := fmt.Sprintf("user/codespaces/%v", codespaceName) diff --git a/github/codespaces_secrets.go b/github/codespaces_secrets.go index 7bed741858b..438c27f8ffe 100644 --- a/github/codespaces_secrets.go +++ b/github/codespaces_secrets.go @@ -16,7 +16,9 @@ import ( // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-secrets-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) { u, err := addOptions("user/codespaces/secrets", opts) if err != nil { @@ -29,7 +31,9 @@ func (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptio // // Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/codespaces/secrets func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets", org) u, err := addOptions(u, opts) @@ -43,7 +47,9 @@ func (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts // // Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets func (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets", owner, repo) u, err := addOptions(u, opts) @@ -74,7 +80,9 @@ func (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secre // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-public-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets/public-key func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, "user/codespaces/secrets/public-key") } @@ -83,7 +91,9 @@ func (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, * // // Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/codespaces/secrets/public-key func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("orgs/%v/codespaces/secrets/public-key", org)) } @@ -92,7 +102,9 @@ func (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*P // // Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/public-key func (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { return s.getPublicKey(ctx, fmt.Sprintf("repos/%v/%v/codespaces/secrets/public-key", owner, repo)) } @@ -118,7 +130,9 @@ func (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*Publ // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#get-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +// +//meta:operation GET /user/codespaces/secrets/{secret_name} func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.getSecret(ctx, u) @@ -128,7 +142,9 @@ func (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Se // // Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.getSecret(ctx, u) @@ -138,7 +154,9 @@ func (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) // // Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.getSecret(ctx, u) @@ -165,7 +183,9 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#create-or-update-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +// +//meta:operation PUT /user/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -175,7 +195,9 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // // Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -185,7 +207,9 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // // Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) @@ -211,7 +235,9 @@ func (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#delete-a-secret-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +// +//meta:operation DELETE /user/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v", name) return s.deleteSecret(ctx, u) @@ -221,7 +247,9 @@ func (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) ( // // Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, name) return s.deleteSecret(ctx, u) @@ -231,7 +259,9 @@ func (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name strin // // Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets repository permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, u) @@ -256,7 +286,9 @@ func (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Resp // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#list-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +// +//meta:operation GET /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) u, err := addOptions(u, opts) @@ -271,7 +303,9 @@ func (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, // // Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) u, err := addOptions(u, opts) @@ -302,7 +336,9 @@ func (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url // You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. // GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on all referenced repositories to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#set-selected-repositories-for-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +// +//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories", name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -313,6 +349,8 @@ func (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, n // Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // // GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories func (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories", org, name) return s.setSelectedRepoForSecret(ctx, u, ids) @@ -340,7 +378,9 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // // Adds a repository to the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespaces_secrets repository permission on the referenced repository to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#add-a-selected-repository-to-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +// +//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -350,7 +390,9 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // // Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) @@ -374,7 +416,9 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // // Removes a repository from the selected repositories for a user's codespace secret. You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint. GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/secrets?apiVersion=2022-11-28#remove-a-selected-repository-from-a-user-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +// +//meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) @@ -384,7 +428,9 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // // Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. // -// Github API docs: https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) diff --git a/github/dependabot.go b/github/dependabot.go index 07e68b506af..2a11a9c9563 100644 --- a/github/dependabot.go +++ b/github/dependabot.go @@ -8,5 +8,5 @@ package github // DependabotService handles communication with the Dependabot related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/ +// GitHub API docs: https://docs.github.com/rest/dependabot/ type DependabotService service diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index 177316b1dc8..94be610c53d 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -104,7 +104,9 @@ func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *Li // ListRepoAlerts lists all Dependabot alerts of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo) return s.listAlerts(ctx, url, opts) @@ -112,7 +114,9 @@ func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo stri // ListOrgAlerts lists all Dependabot alerts of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/dependabot/alerts func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/alerts", org) return s.listAlerts(ctx, url, opts) @@ -120,7 +124,9 @@ func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts // GetRepoAlert gets a single repository Dependabot alert. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert +// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number) req, err := s.client.NewRequest("GET", url, nil) diff --git a/github/dependabot_secrets.go b/github/dependabot_secrets.go index 685f7bea8ea..e85c805a63f 100644 --- a/github/dependabot_secrets.go +++ b/github/dependabot_secrets.go @@ -27,7 +27,9 @@ func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*Publ // GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/public-key func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) return s.getPublicKey(ctx, url) @@ -35,7 +37,9 @@ func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo st // GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-public-key +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +// +//meta:operation GET /orgs/{org}/dependabot/secrets/public-key func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) return s.getPublicKey(ctx, url) @@ -64,7 +68,9 @@ func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *L // ListRepoSecrets lists all Dependabot secrets available in a repository // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-repository-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) return s.listSecrets(ctx, url, opts) @@ -73,7 +79,9 @@ func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo str // ListOrgSecrets lists all Dependabot secrets available in an organization // without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-organization-secrets +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +// +//meta:operation GET /orgs/{org}/dependabot/secrets func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) return s.listSecrets(ctx, url, opts) @@ -96,7 +104,9 @@ func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, // GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +// +//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.getSecret(ctx, url) @@ -104,7 +114,9 @@ func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name // GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#get-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +// +//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.getSecret(ctx, url) @@ -134,7 +146,9 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +// +//meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) @@ -142,7 +156,9 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) for i, secret := range eSecret.SelectedRepositoryIDs { @@ -176,7 +192,9 @@ func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Resp // DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-a-repository-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +// +//meta:operation DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) return s.deleteSecret(ctx, url) @@ -184,7 +202,9 @@ func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, n // DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#delete-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) return s.deleteSecret(ctx, url) @@ -192,7 +212,9 @@ func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name strin // ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +// +//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) u, err := addOptions(url, opts) @@ -219,7 +241,9 @@ type DependabotSecretsSelectedRepoIDs []int64 // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { @@ -236,7 +260,9 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +// +//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) @@ -249,7 +275,9 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. // -// GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +// +//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) diff --git a/github/dependency_graph.go b/github/dependency_graph.go index ba95bd3d5e3..86a1fe48b98 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -62,6 +62,8 @@ func (s SBOM) String() string { // GetSBOM fetches the software bill of materials for a repository. // // GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) diff --git a/github/doc.go b/github/doc.go index 4a9aa95c3af..b10810d5338 100644 --- a/github/doc.go +++ b/github/doc.go @@ -29,7 +29,7 @@ Some API methods have optional parameters that can be passed. For example: The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at -https://docs.github.com/en/rest . +https://docs.github.com/rest . NOTE: Using the https://godoc.org/context package, one can easily pass cancelation signals and deadlines to various services of the client for @@ -119,7 +119,7 @@ For secondary rate limits, you can check if its type is *github.AbuseRateLimitEr } Learn more about GitHub rate limiting at -https://docs.github.com/en/rest/rate-limit . +https://docs.github.com/rest/rate-limit . # Accepted Status @@ -145,7 +145,7 @@ instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at -https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. +https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests. # Creating and Updating Resources diff --git a/github/emojis.go b/github/emojis.go index 15b57130b3b..8f834daf1ba 100644 --- a/github/emojis.go +++ b/github/emojis.go @@ -15,6 +15,8 @@ type EmojisService service // List returns the emojis available to use on GitHub. // // GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis +// +//meta:operation GET /emojis func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) { req, err := s.client.NewRequest("GET", "emojis", nil) if err != nil { diff --git a/github/enterprise.go b/github/enterprise.go index 1c9b0695669..2036f8bc75d 100644 --- a/github/enterprise.go +++ b/github/enterprise.go @@ -8,5 +8,5 @@ package github // EnterpriseService provides access to the enterprise related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/ +// GitHub API docs: https://docs.github.com/rest/enterprise-admin/ type EnterpriseService service diff --git a/github/enterprise_actions_runner_groups.go b/github/enterprise_actions_runner_groups.go index b6bb70dae40..f171df75734 100644 --- a/github/enterprise_actions_runner_groups.go +++ b/github/enterprise_actions_runner_groups.go @@ -79,7 +79,9 @@ type ListEnterpriseRunnerGroupOptions struct { // ListRunnerGroups lists all self-hosted runner groups configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runner-groups-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) u, err := addOptions(u, opts) @@ -103,7 +105,9 @@ func (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise str // GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#get-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +126,9 @@ func (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterp // DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#delete-a-self-hosted-runner-group-from-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) @@ -136,7 +142,9 @@ func (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, ent // CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#create-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runner-groups func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups", enterprise) req, err := s.client.NewRequest("POST", u, createReq) @@ -155,7 +163,9 @@ func (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, ent // UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#update-a-self-hosted-runner-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v", enterprise, groupID) req, err := s.client.NewRequest("PATCH", u, updateReq) @@ -174,7 +184,9 @@ func (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, ent // ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) u, err := addOptions(u, opts) @@ -199,7 +211,9 @@ func (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Contex // SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise // with a new List of organizations. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations", enterprise, groupID) @@ -214,7 +228,9 @@ func (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context // AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -229,7 +245,9 @@ func (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context // RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/organizations/%v", enterprise, groupID, orgID) @@ -243,7 +261,9 @@ func (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Cont // ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#list-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) u, err := addOptions(u, opts) @@ -268,7 +288,9 @@ func (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterpri // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#set-self-hosted-runners-in-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners", enterprise, groupID) @@ -282,7 +304,9 @@ func (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterpris // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) @@ -297,7 +321,9 @@ func (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterpris // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups?apiVersion=2022-11-28#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runner-groups/%v/runners/%v", enterprise, groupID, runnerID) diff --git a/github/enterprise_actions_runners.go b/github/enterprise_actions_runners.go index bdb91fb2b9d..4a6e6b52c10 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -13,6 +13,8 @@ import ( // ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners/downloads func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/downloads", enterprise) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, // GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runners/generate-jitconfig func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/generate-jitconfig", enterprise) @@ -52,6 +56,8 @@ func (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, ent // CreateRegistrationToken creates a token that can be used to add a self-hosted runner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/runners/registration-token func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/registration-token", enterprise) @@ -72,6 +78,8 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // ListRunners lists all the self-hosted runners for a enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) @@ -96,6 +104,8 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/runners/{runner_id} func (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) diff --git a/github/enterprise_audit_log.go b/github/enterprise_audit_log.go index ae3a62b5acd..058a7d17786 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -13,6 +13,8 @@ import ( // GetAuditLog gets the audit-log entries for an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/audit-log func (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("enterprises/%v/audit-log", enterprise) u, err := addOptions(u, opts) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index aa918400703..af8eb0ffb2f 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -21,6 +21,8 @@ type EnterpriseSecurityAnalysisSettings struct { // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) @@ -41,6 +43,8 @@ func (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, ente // UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) { u := fmt.Sprintf("enterprises/%v/code_security_and_analysis", enterprise) req, err := s.client.NewRequest("PATCH", u, settings) @@ -61,7 +65,9 @@ func (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, e // Valid values for securityProduct: "advanced_security", "secret_scanning", "secret_scanning_push_protection". // Valid values for enablement: "enable_all", "disable_all". // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis?apiVersion=2022-11-28#enable-or-disable-a-security-feature +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +// +//meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement} func (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) { u := fmt.Sprintf("enterprises/%v/%v/%v", enterprise, securityProduct, enablement) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/event_types.go b/github/event_types.go index e91d22686ff..97d56384865 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -18,7 +18,7 @@ type RequestedAction struct { // BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted". // The Webhook event name is "branch_protection_rule". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule type BranchProtectionRuleEvent struct { Action *string `json:"action,omitempty"` Rule *BranchProtectionRule `json:"rule,omitempty"` @@ -32,7 +32,7 @@ type BranchProtectionRuleEvent struct { // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run type CheckRunEvent struct { CheckRun *CheckRun `json:"check_run,omitempty"` // The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action". @@ -51,7 +51,7 @@ type CheckRunEvent struct { // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested". // The Webhook event name is "check_suite". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_suite +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite type CheckSuiteEvent struct { CheckSuite *CheckSuite `json:"check_suite,omitempty"` // The action performed. Possible values are: "completed", "requested" or "rerequested". @@ -67,7 +67,7 @@ type CheckSuiteEvent struct { // CommitCommentEvent is triggered when a commit comment is created. // The Webhook event name is "commit_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment type CommitCommentEvent struct { Comment *RepositoryComment `json:"comment,omitempty"` @@ -103,7 +103,7 @@ type ContentReferenceEvent struct { // Additionally, webhooks will not receive this event for tags if more // than three tags are pushed at once. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#createevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#createevent type CreateEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was created. Possible values are: "repository", "branch", "tag". @@ -125,7 +125,7 @@ type CreateEvent struct { // Note: webhooks will not receive this event for tags if more than three tags // are deleted at once. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#deleteevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#deleteevent type DeleteEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was deleted. Possible values are: "branch", "tag". @@ -145,7 +145,7 @@ type DeleteEvent struct { // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. // The Webhook event name is "dependabot_alert". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert type DependabotAlertEvent struct { Action *string `json:"action,omitempty"` Alert *DependabotAlert `json:"alert,omitempty"` @@ -164,7 +164,7 @@ type DependabotAlertEvent struct { // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. // The Webhook event name is "deploy_key". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key type DeployKeyEvent struct { // Action is the action that was performed. Possible values are: // "created" or "deleted". @@ -190,7 +190,7 @@ type DeployKeyEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment type DeploymentEvent struct { Deployment *Deployment `json:"deployment,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -230,7 +230,7 @@ type DeploymentProtectionRuleEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status type DeploymentStatusEvent struct { Deployment *Deployment `json:"deployment,omitempty"` DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` @@ -281,7 +281,7 @@ type CommentDiscussion struct { // DiscussionEvent represents a webhook event for a discussion. // The Webhook event name is "discussion". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion type DiscussionEvent struct { // Action is the action that was performed. Possible values are: // created, edited, deleted, pinned, unpinned, locked, unlocked, @@ -334,7 +334,7 @@ type DiscussionCategory struct { // ForkEvent is triggered when a user forks a repository. // The Webhook event name is "fork". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#fork +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#fork type ForkEvent struct { // Forkee is the created repository. Forkee *Repository `json:"forkee,omitempty"` @@ -348,7 +348,7 @@ type ForkEvent struct { // GitHubAppAuthorizationEvent is triggered when a user's authorization for a // GitHub Application is revoked. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization type GitHubAppAuthorizationEvent struct { // The action performed. Possible value is: "revoked". Action *string `json:"action,omitempty"` @@ -371,7 +371,7 @@ type Page struct { // GollumEvent is triggered when a Wiki page is created or updated. // The Webhook event name is "gollum". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#gollum +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#gollum type GollumEvent struct { Pages []*Page `json:"pages,omitempty"` @@ -522,7 +522,7 @@ type TeamPermissionsFrom struct { // or new permissions have been accepted. // The Webhook event name is "installation". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation type InstallationEvent struct { // The action that was performed. Can be either "created", "deleted", "suspend", "unsuspend" or "new_permissions_accepted". Action *string `json:"action,omitempty"` @@ -539,7 +539,7 @@ type InstallationEvent struct { // InstallationRepositoriesEvent is triggered when a repository is added or // removed from an installation. The Webhook event name is "installation_repositories". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories type InstallationRepositoriesEvent struct { // The action that was performed. Can be either "added" or "removed". Action *string `json:"action,omitempty"` @@ -573,7 +573,7 @@ type InstallationChanges struct { // InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account. // The Webhook event name is "installation_target". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target type InstallationTargetEvent struct { Account *User `json:"account,omitempty"` Action *string `json:"action,omitempty"` @@ -590,7 +590,7 @@ type InstallationTargetEvent struct { // or pull request. // The Webhook event name is "issue_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment type IssueCommentEvent struct { // Action is the action that was performed on the comment. // Possible values are: "created", "edited", "deleted". @@ -614,7 +614,7 @@ type IssueCommentEvent struct { // locked, unlocked, milestoned, or demilestoned. // The Webhook event name is "issues". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues type IssuesEvent struct { // Action is the action that was performed. Possible values are: "opened", // "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", @@ -640,7 +640,7 @@ type IssuesEvent struct { // LabelEvent is triggered when a repository's label is created, edited, or deleted. // The Webhook event name is "label" // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#label +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label type LabelEvent struct { // Action is the action that was performed. Possible values are: // "created", "edited", "deleted" @@ -659,7 +659,7 @@ type LabelEvent struct { // their GitHub Marketplace plan. // Webhook event name "marketplace_purchase". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase type MarketplacePurchaseEvent struct { // Action is the action that was performed. Possible values are: // "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed". @@ -680,7 +680,7 @@ type MarketplacePurchaseEvent struct { // MemberEvent is triggered when a user is added as a collaborator to a repository. // The Webhook event name is "member". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#member +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { // Action is the action that was performed. Possible value is: "added". Action *string `json:"action,omitempty"` @@ -702,7 +702,7 @@ type MemberEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger organization webhooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#membership +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership type MembershipEvent struct { // Action is the action that was performed. Possible values are: "added", "removed". Action *string `json:"action,omitempty"` @@ -734,7 +734,7 @@ type MergeGroup struct { // MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified // in the action property of the payload object. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#merge_group +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { // The action that was performed. Currently, can only be checks_requested. Action *string `json:"action,omitempty"` @@ -753,7 +753,7 @@ type MergeGroupEvent struct { // Therefore, it must be selected for each hook that you'd like to receive meta events for. // The Webhook event name is "meta". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#meta +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta type MetaEvent struct { // Action is the action that was performed. Possible value is: "deleted". Action *string `json:"action,omitempty"` @@ -774,7 +774,7 @@ type MetaEvent struct { // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. // The Webhook event name is "milestone". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#milestone +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone type MilestoneEvent struct { // Action is the action that was performed. Possible values are: // "created", "closed", "opened", "edited", "deleted" @@ -794,7 +794,7 @@ type MilestoneEvent struct { // Events of this type are not visible in timelines. These events are only used to trigger organization hooks. // Webhook event name is "organization". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#organization +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization type OrganizationEvent struct { // Action is the action that was performed. // Possible values are: "deleted", "renamed", "member_added", "member_removed", or "member_invited". @@ -815,7 +815,7 @@ type OrganizationEvent struct { // OrgBlockEvent is triggered when an organization blocks or unblocks a user. // The Webhook event name is "org_block". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#org_block +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block type OrgBlockEvent struct { // Action is the action that was performed. // Can be "blocked" or "unblocked". @@ -856,7 +856,7 @@ type PackageEvent struct { // // Events of this type are not visible in timelines, they are only used to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#page_build +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#page_build type PageBuildEvent struct { Build *PagesBuild `json:"build,omitempty"` @@ -876,7 +876,7 @@ type PageBuildEvent struct { // belong to a resource owner that requires approval for token access. // The webhook event name is "personal_access_token_request". // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request type PersonalAccessTokenRequestEvent struct { // Action is the action that was performed. Possible values are: // "approved", "cancelled", "created" or "denied" @@ -964,7 +964,7 @@ type PingEvent struct { // ProjectEvent is triggered when project is created, modified or deleted. // The webhook event name is "project". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project type ProjectEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectChange `json:"changes,omitempty"` @@ -980,7 +980,7 @@ type ProjectEvent struct { // ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted. // The webhook event name is "project_card". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project_card +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card type ProjectCardEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectCardChange `json:"changes,omitempty"` @@ -997,7 +997,7 @@ type ProjectCardEvent struct { // ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted. // The webhook event name is "project_column". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#project_column +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column type ProjectColumnEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectColumnChange `json:"changes,omitempty"` @@ -1014,7 +1014,7 @@ type ProjectColumnEvent struct { // ProjectV2Event is triggered when there is activity relating to an organization-level project. // The Webhook event name is "projects_v2". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 type ProjectV2Event struct { Action *string `json:"action,omitempty"` ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` @@ -1046,7 +1046,7 @@ type ProjectsV2 struct { // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. // The Webhook event name is "projects_v2_item". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item type ProjectV2ItemEvent struct { Action *string `json:"action,omitempty"` Changes *ProjectV2ItemChange `json:"changes,omitempty"` @@ -1086,7 +1086,7 @@ type ProjectV2Item struct { // According to GitHub: "Without a doubt: the best GitHub event." // The Webhook event name is "public". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#public +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#public type PublicEvent struct { // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1103,7 +1103,7 @@ type PublicEvent struct { // locked, unlocked, a pull request review is requested, or a review request is removed. // The Webhook event name is "pull_request". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent type PullRequestEvent struct { // Action is the action that was performed. Possible values are: // "assigned", "unassigned", "review_requested", "review_request_removed", "labeled", "unlabeled", @@ -1147,7 +1147,7 @@ type PullRequestEvent struct { // request. // The Webhook event name is "pull_request_review". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review type PullRequestReviewEvent struct { // Action is always "submitted". Action *string `json:"action,omitempty"` @@ -1168,7 +1168,7 @@ type PullRequestReviewEvent struct { // portion of the unified diff of a pull request. // The Webhook event name is "pull_request_review_comment". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment type PullRequestReviewCommentEvent struct { // Action is the action that was performed on the comment. // Possible values are: "created", "edited", "deleted". @@ -1191,7 +1191,7 @@ type PullRequestReviewCommentEvent struct { // review of a pull request is marked resolved or unresolved. // The Webhook event name is "pull_request_review_thread". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread type PullRequestReviewThreadEvent struct { // Action is the action that was performed on the comment. // Possible values are: "resolved", "unresolved". @@ -1214,7 +1214,7 @@ type PullRequestReviewThreadEvent struct { // locked, unlocked, a pull request review is requested, or a review request is removed. // The Webhook event name is "pull_request_target". // -// GitHub API docs: https://docs.github.com/en/actions/events-that-trigger-workflows#pull_request_target +// GitHub API docs: https://docs.github.com/actions/events-that-trigger-workflows#pull_request_target type PullRequestTargetEvent struct { // Action is the action that was performed. Possible values are: // "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", "reopened", @@ -1256,7 +1256,7 @@ type PullRequestTargetEvent struct { // PushEvent represents a git push to a GitHub repository. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#push +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push type PushEvent struct { PushID *int64 `json:"push_id,omitempty"` Head *string `json:"head,omitempty"` @@ -1364,7 +1364,7 @@ type PushEventRepoOwner struct { // edited, deleted, or prereleased. // The Webhook event name is "release". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#release +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release type ReleaseEvent struct { // Action is the action that was performed. Possible values are: "published", "unpublished", // "created", "edited", "deleted", or "prereleased". @@ -1389,7 +1389,7 @@ type ReleaseEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger organization webhooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository type RepositoryEvent struct { // Action is the action that was performed. Possible values are: "created", // "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed", @@ -1406,7 +1406,7 @@ type RepositoryEvent struct { // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch type RepositoryDispatchEvent struct { // Action is the event_type that submitted with the repository dispatch payload. Value can be any string. Action *string `json:"action,omitempty"` @@ -1422,7 +1422,7 @@ type RepositoryDispatchEvent struct { // RepositoryImportEvent represents the activity related to a repository being imported to GitHub. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import type RepositoryImportEvent struct { // Status represents the final state of the import. This can be one of "success", "cancelled", or "failure". Status *string `json:"status,omitempty"` @@ -1433,7 +1433,7 @@ type RepositoryImportEvent struct { // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert type RepositoryVulnerabilityAlertEvent struct { // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". Action *string `json:"action,omitempty"` @@ -1474,7 +1474,7 @@ type RepositoryVulnerabilityAlert struct { // SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository. // The Webhook name is secret_scanning_alert. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert type SecretScanningAlertEvent struct { // Action is the action that was performed. Possible values are: "created", "resolved", or "reopened". Action *string `json:"action,omitempty"` @@ -1494,7 +1494,7 @@ type SecretScanningAlertEvent struct { // SecurityAndAnalysisEvent is triggered when code security and analysis features // are enabled or disabled for a repository. // -// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis type SecurityAndAnalysisEvent struct { Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` Enterprise *Enterprise `json:"enterprise,omitempty"` @@ -1519,7 +1519,7 @@ type SecurityAndAnalysisChangeFrom struct { // StarEvent is triggered when a star is added or removed from a repository. // The Webhook event name is "star". // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#star +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star type StarEvent struct { // Action is the action that was performed. Possible values are: "created" or "deleted". Action *string `json:"action,omitempty"` @@ -1540,7 +1540,7 @@ type StarEvent struct { // Events of this type are not visible in timelines, they are only used to // trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#status +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status type StatusEvent struct { SHA *string `json:"sha,omitempty"` // State is the new state. Possible values are: "pending", "success", "failure", "error". @@ -1571,7 +1571,7 @@ type StatusEvent struct { // Events of this type are not visible in timelines. These events are only used // to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#team +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team type TeamEvent struct { Action *string `json:"action,omitempty"` Team *Team `json:"team,omitempty"` @@ -1590,7 +1590,7 @@ type TeamEvent struct { // Events of this type are not visible in timelines. These events are only used // to trigger hooks. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#team_add +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add type TeamAddEvent struct { Team *Team `json:"team,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -1624,7 +1624,7 @@ type UserEvent struct { // The event’s actor is the user who starred a repository, and the event’s // repository is the repository that was starred. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#watch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch type WatchEvent struct { // Action is the action that was performed. Possible value is: "started". Action *string `json:"action,omitempty"` @@ -1642,7 +1642,7 @@ type WatchEvent struct { // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or // sends a POST request to the create a workflow dispatch event endpoint. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch type WorkflowDispatchEvent struct { Inputs json.RawMessage `json:"inputs,omitempty"` Ref *string `json:"ref,omitempty"` @@ -1657,7 +1657,7 @@ type WorkflowDispatchEvent struct { // WorkflowJobEvent is triggered when a job is queued, started or completed. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job type WorkflowJobEvent struct { WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` @@ -1675,7 +1675,7 @@ type WorkflowJobEvent struct { // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run type WorkflowRunEvent struct { Action *string `json:"action,omitempty"` Workflow *Workflow `json:"workflow,omitempty"` @@ -1690,7 +1690,7 @@ type WorkflowRunEvent struct { // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisory struct { CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` @@ -1740,8 +1740,8 @@ type AdvisoryVulnerability struct { FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` // PatchedVersions and VulnerableFunctions are used in the following APIs: - // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories-for-an-organization - // - https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-repository-security-advisories + // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization + // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories PatchedVersions *string `json:"patched_versions,omitempty"` VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` } @@ -1759,7 +1759,7 @@ type FirstPatchedVersion struct { // SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisoryEvent struct { Action *string `json:"action,omitempty"` SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` @@ -1774,7 +1774,7 @@ type SecurityAdvisoryEvent struct { // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert type CodeScanningAlertEvent struct { Action *string `json:"action,omitempty"` Alert *Alert `json:"alert,omitempty"` diff --git a/github/gists.go b/github/gists.go index 80961fcb908..08180c6d301 100644 --- a/github/gists.go +++ b/github/gists.go @@ -14,7 +14,7 @@ import ( // GistsService handles communication with the Gist related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/gists +// GitHub API docs: https://docs.github.com/rest/gists type GistsService service // Gist represents a GitHub's gist. @@ -96,8 +96,11 @@ type GistListOptions struct { // is authenticated, it will returns all gists for the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +// +//meta:operation GET /gists +//meta:operation GET /users/{username}/gists func (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) { var u string if user != "" { @@ -126,7 +129,9 @@ func (s *GistsService) List(ctx context.Context, user string, opts *GistListOpti // ListAll lists all public gists. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-public-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists +// +//meta:operation GET /gists/public func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/public", opts) if err != nil { @@ -149,7 +154,9 @@ func (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*G // ListStarred lists starred gists of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-starred-gists +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists +// +//meta:operation GET /gists/starred func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) { u, err := addOptions("gists/starred", opts) if err != nil { @@ -172,7 +179,9 @@ func (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ( // Get a single gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist +// +//meta:operation GET /gists/{gist_id} func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -191,7 +200,9 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er // GetRevision gets a specific revision of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#get-a-gist-revision +// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision +// +//meta:operation GET /gists/{gist_id}/{sha} func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/%v", id, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -210,7 +221,9 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, // Create a gist for authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#create-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist +// +//meta:operation POST /gists func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) { u := "gists" req, err := s.client.NewRequest("POST", u, gist) @@ -229,7 +242,9 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response // Edit a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#update-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist +// +//meta:operation PATCH /gists/{gist_id} func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("PATCH", u, gist) @@ -248,7 +263,9 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, // ListCommits lists commits of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-commits +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits +// +//meta:operation GET /gists/{gist_id}/commits func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) { u := fmt.Sprintf("gists/%v/commits", id) u, err := addOptions(u, opts) @@ -272,7 +289,9 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOpt // Delete a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#delete-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist +// +//meta:operation DELETE /gists/{gist_id} func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -285,7 +304,9 @@ func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) // Star a gist on behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#star-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist +// +//meta:operation PUT /gists/{gist_id}/star func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("PUT", u, nil) @@ -298,7 +319,9 @@ func (s *GistsService) Star(ctx context.Context, id string) (*Response, error) { // Unstar a gist on a behalf of authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#unstar-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist +// +//meta:operation DELETE /gists/{gist_id}/star func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -311,7 +334,9 @@ func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) // IsStarred checks if a gist is starred by authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#check-if-a-gist-is-starred +// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +// +//meta:operation GET /gists/{gist_id}/star func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) { u := fmt.Sprintf("gists/%v/star", id) req, err := s.client.NewRequest("GET", u, nil) @@ -326,7 +351,9 @@ func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Respons // Fork a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#fork-a-gist +// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist +// +//meta:operation POST /gists/{gist_id}/forks func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) req, err := s.client.NewRequest("POST", u, nil) @@ -345,7 +372,9 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e // ListForks lists forks of a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/gists#list-gist-forks +// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks +// +//meta:operation GET /gists/{gist_id}/forks func (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) { u := fmt.Sprintf("gists/%v/forks", id) u, err := addOptions(u, opts) diff --git a/github/gists_comments.go b/github/gists_comments.go index ee0fbfa45f8..5e0614231b8 100644 --- a/github/gists_comments.go +++ b/github/gists_comments.go @@ -25,7 +25,9 @@ func (g GistComment) String() string { // ListComments lists all comments for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#list-gist-comments +// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments +// +//meta:operation GET /gists/{gist_id}/comments func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) u, err := addOptions(u, opts) @@ -49,7 +51,9 @@ func (s *GistsService) ListComments(ctx context.Context, gistID string, opts *Li // GetComment retrieves a single comment from a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#get-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment +// +//meta:operation GET /gists/{gist_id}/comments/{comment_id} func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -68,7 +72,9 @@ func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID // CreateComment creates a comment for a gist. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#create-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment +// +//meta:operation POST /gists/{gist_id}/comments func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments", gistID) req, err := s.client.NewRequest("POST", u, comment) @@ -87,7 +93,9 @@ func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment // EditComment edits an existing gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#update-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment +// +//meta:operation PATCH /gists/{gist_id}/comments/{comment_id} func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -106,7 +114,9 @@ func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID // DeleteComment deletes a gist comment. // -// GitHub API docs: https://docs.github.com/en/rest/gists/comments#delete-a-gist-comment +// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +// +//meta:operation DELETE /gists/{gist_id}/comments/{comment_id} func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) { u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/git.go b/github/git.go index 8960de7b14a..2ca835e1b50 100644 --- a/github/git.go +++ b/github/git.go @@ -8,5 +8,5 @@ package github // GitService handles communication with the git data related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/git/ +// GitHub API docs: https://docs.github.com/rest/git/ type GitService service diff --git a/github/git_blobs.go b/github/git_blobs.go index da0485ccbe2..d8904288896 100644 --- a/github/git_blobs.go +++ b/github/git_blobs.go @@ -23,7 +23,9 @@ type Blob struct { // GetBlob fetches a blob from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// +//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +45,9 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha // GetBlobRaw fetches a blob's contents from a repo. // Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#get-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob +// +//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -64,7 +68,9 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // CreateBlob creates a blob object. // -// GitHub API docs: https://docs.github.com/en/rest/git/blobs#create-a-blob +// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob +// +//meta:operation POST /repos/{owner}/{repo}/git/blobs func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) diff --git a/github/git_commits.go b/github/git_commits.go index 6a7e92c4aa5..573d38be528 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -83,6 +83,8 @@ func (c CommitAuthor) String() string { // GetCommit fetches the Commit object for a given SHA. // // GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object +// +//meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha} func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -122,7 +124,9 @@ type CreateCommitOptions struct { // data if omitted. If the commit.Author is omitted, it will be filled in with // the authenticated user’s information and the current date. // -// GitHub API docs: https://docs.github.com/en/rest/git/commits#create-a-commit +// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit +// +//meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if commit == nil { return nil, nil, fmt.Errorf("commit must be provided") diff --git a/github/git_refs.go b/github/git_refs.go index e839c30f667..ad7b10d7d3f 100644 --- a/github/git_refs.go +++ b/github/git_refs.go @@ -49,7 +49,9 @@ type updateRefRequest struct { // GetRef fetches a single reference in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#get-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference +// +//meta:operation GET /repos/{owner}/{repo}/git/ref/{ref} func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) @@ -88,7 +90,9 @@ type ReferenceListOptions struct { // ListMatchingRefs lists references in a repository that match a supplied ref. // Use an empty ref to list all references. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#list-matching-references +// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references +// +//meta:operation GET /repos/{owner}/{repo}/git/matching-refs/{ref} func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, opts *ReferenceListOptions) ([]*Reference, *Response, error) { var ref string if opts != nil { @@ -116,7 +120,9 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // CreateRef creates a new ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#create-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference +// +//meta:operation POST /repos/{owner}/{repo}/git/refs func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ @@ -139,7 +145,9 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // UpdateRef updates an existing ref in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#update-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference +// +//meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { refPath := strings.TrimPrefix(*ref.Ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) @@ -162,7 +170,9 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // DeleteRef deletes a ref from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/refs#delete-a-reference +// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference +// +//meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) diff --git a/github/git_tags.go b/github/git_tags.go index 30d7b2c2d23..67321566f73 100644 --- a/github/git_tags.go +++ b/github/git_tags.go @@ -35,7 +35,9 @@ type createTagRequest struct { // GetTag fetches a tag from a repo given a SHA. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#get-a-tag +// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag +// +//meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha} func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -54,7 +56,9 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // CreateTag creates a tag object. // -// GitHub API docs: https://docs.github.com/en/rest/git/tags#create-a-tag-object +// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object +// +//meta:operation POST /repos/{owner}/{repo}/git/tags func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) diff --git a/github/git_trees.go b/github/git_trees.go index db28976e032..b8eed58e136 100644 --- a/github/git_trees.go +++ b/github/git_trees.go @@ -93,7 +93,9 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GetTree fetches the Tree object for a given sha hash from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#get-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree +// +//meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha} func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { @@ -124,7 +126,9 @@ type createTree struct { // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // -// GitHub API docs: https://docs.github.com/en/rest/git/trees#create-a-tree +// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree +// +//meta:operation POST /repos/{owner}/{repo}/git/trees func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) diff --git a/github/github.go b/github/github.go index 32e5fe2499f..d87f043260e 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate ../script/metadata.sh update-doc-urls +//go:generate ../script/metadata.sh update-go package github @@ -132,10 +132,10 @@ const ( // https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/ mediaTypeListPullsOrBranchesForCommitPreview = "application/vnd.github.groot-preview+json" - // https://docs.github.com/en/rest/previews/#repository-creation-permissions + // https://docs.github.com/rest/previews/#repository-creation-permissions mediaTypeMemberAllowedRepoCreationTypePreview = "application/vnd.github.surtur-preview+json" - // https://docs.github.com/en/rest/previews/#create-and-use-repository-templates + // https://docs.github.com/rest/previews/#create-and-use-repository-templates mediaTypeRepositoryTemplatePreview = "application/vnd.github.baptiste-preview+json" // https://developer.github.com/changes/2019-10-03-multi-line-comments/ @@ -993,7 +993,7 @@ func compareHTTPResponse(r1, r2 *http.Response) bool { /* An ErrorResponse reports one or more errors caused by an API request. -GitHub API docs: https://docs.github.com/en/rest/#client-errors +GitHub API docs: https://docs.github.com/rest/#client-errors */ type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error @@ -1003,7 +1003,7 @@ type ErrorResponse struct { Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see - // https://docs.github.com/en/rest/#client-errors + // https://docs.github.com/rest/#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } @@ -1123,7 +1123,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/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1186,7 +1186,7 @@ GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). In such cases, Message represents an error message as a workaround. -GitHub API docs: https://docs.github.com/en/rest/#client-errors +GitHub API docs: https://docs.github.com/rest/#client-errors */ type Error struct { Resource string `json:"resource"` // resource on which the error occurred @@ -1304,20 +1304,20 @@ type RateLimits struct { // requests are limited to 60 per hour. Authenticated requests are // limited to 5,000 per hour. // - // GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting + // GitHub API docs: https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting Core *Rate `json:"core"` // The rate limit for search API requests. Unauthenticated requests // are limited to 10 requests per minutes. Authenticated requests are // limited to 30 per minute. // - // GitHub API docs: https://docs.github.com/en/rest/search#rate-limit + // GitHub API docs: https://docs.github.com/rest/search#rate-limit Search *Rate `json:"search"` - // GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit + // GitHub API docs: https://docs.github.com/graphql/overview/resource-limitations#rate-limit GraphQL *Rate `json:"graphql"` - // GitHub API dos: https://docs.github.com/en/rest/rate-limit + // GitHub API dos: https://docs.github.com/rest/rate-limit IntegrationManifest *Rate `json:"integration_manifest"` SourceImport *Rate `json:"source_import"` @@ -1348,7 +1348,7 @@ const ( // category returns the rate limit category of the endpoint, determined by HTTP method and Request.URL.Path. func category(method, path string) rateLimitCategory { switch { - // https://docs.github.com/en/rest/rate-limit#about-rate-limits + // https://docs.github.com/rest/rate-limit#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. @@ -1362,17 +1362,17 @@ func category(method, path string) rateLimitCategory { method == http.MethodPost: return integrationManifestCategory - // https://docs.github.com/en/rest/migrations/source-imports#start-an-import + // https://docs.github.com/rest/migrations/source-imports#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == http.MethodPut: return sourceImportCategory - // https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data + // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): return codeScanningUploadCategory - // https://docs.github.com/en/enterprise-cloud@latest/rest/scim + // https://docs.github.com/enterprise-cloud@latest/rest/scim case strings.HasPrefix(path, "/scim/"): return scimCategory } @@ -1459,7 +1459,7 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/en/rest/#unauthenticated-rate-limited-requests for +See https://docs.github.com/rest/#unauthenticated-rate-limited-requests for more information. */ type UnauthenticatedRateLimitedTransport struct { diff --git a/github/github_test.go b/github/github_test.go index 7d92946dfd0..a7a5f59f8f7 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1226,7 +1226,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1268,7 +1268,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1328,7 +1328,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1370,7 +1370,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { // there is no "Retry-After" header. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1405,7 +1405,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { // url changes between versions but follows roughly the same format. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1436,7 +1436,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1493,7 +1493,7 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", - "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1634,7 +1634,7 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { Request: &http.Request{}, StatusCode: http.StatusForbidden, Body: io.NopCloser(strings.NewReader(`{"message":"m", - "documentation_url": "docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), + "documentation_url": "docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), } err := CheckResponse(res).(*AbuseRateLimitError) diff --git a/github/gitignore.go b/github/gitignore.go index b0cc5ca684b..34cf285e146 100644 --- a/github/gitignore.go +++ b/github/gitignore.go @@ -13,7 +13,7 @@ import ( // GitignoresService provides access to the gitignore related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/gitignore/ +// GitHub API docs: https://docs.github.com/rest/gitignore/ type GitignoresService service // Gitignore represents a .gitignore file as returned by the GitHub API. @@ -29,6 +29,8 @@ func (g Gitignore) String() string { // List all available Gitignore templates. // // GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +// +//meta:operation GET /gitignore/templates func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) { req, err := s.client.NewRequest("GET", "gitignore/templates", nil) if err != nil { @@ -47,6 +49,8 @@ func (s *GitignoresService) List(ctx context.Context) ([]string, *Response, erro // Get a Gitignore by name. // // GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +// +//meta:operation GET /gitignore/templates/{name} func (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) { u := fmt.Sprintf("gitignore/templates/%v", name) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/interactions.go b/github/interactions.go index a690f61268f..2268273dd48 100644 --- a/github/interactions.go +++ b/github/interactions.go @@ -8,7 +8,7 @@ package github // InteractionsService handles communication with the repository and organization related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/ +// GitHub API docs: https://docs.github.com/rest/interactions/ type InteractionsService service // InteractionRestriction represents the interaction restrictions for repository and organization. diff --git a/github/interactions_orgs.go b/github/interactions_orgs.go index 5c7663f583d..f0ba0b15f04 100644 --- a/github/interactions_orgs.go +++ b/github/interactions_orgs.go @@ -12,7 +12,9 @@ import ( // GetRestrictionsForOrg fetches the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +// +//meta:operation GET /orgs/{org}/interaction-limits func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +41,9 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz // in public repositories for the given organization. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +// +//meta:operation PUT /orgs/{org}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) @@ -65,7 +69,9 @@ func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, orga // RemoveRestrictionsFromOrg removes the interaction restrictions for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +// +//meta:operation DELETE /orgs/{org}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/interactions_repos.go b/github/interactions_repos.go index 41e6c5319d0..9c044badd19 100644 --- a/github/interactions_repos.go +++ b/github/interactions_repos.go @@ -12,7 +12,9 @@ import ( // GetRestrictionsForRepo fetches the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -39,7 +41,9 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, // for the given repository. // Possible values are: "existing_users", "contributors_only", "collaborators_only". // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) @@ -65,7 +69,9 @@ func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, own // RemoveRestrictionsFromRepo removes the interaction restrictions for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/interaction-limits func (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issue_import.go b/github/issue_import.go index c56dffaa4ed..4f06371085e 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -71,6 +71,8 @@ type IssueImportError struct { // Create a new imported issue on the specified repository. // // GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import +// +//meta:operation POST /repos/{owner}/{repo}/import/issues func (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -100,6 +102,8 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss // CheckStatus checks the status of an imported issue. // // GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request +// +//meta:operation GET /repos/{owner}/{repo}/import/issues/{issue_number} func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues/%v", owner, repo, issueID) req, err := s.client.NewRequest("GET", u, nil) @@ -122,6 +126,8 @@ func (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string // CheckStatusSince checks the status of multiple imported issues since a given date. // // GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues +// +//meta:operation GET /repos/{owner}/{repo}/import/issues func (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/issues?since=%v", owner, repo, since.Format("2006-01-02")) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/issues.go b/github/issues.go index 42e58a17a8a..47fddd895da 100644 --- a/github/issues.go +++ b/github/issues.go @@ -14,7 +14,7 @@ import ( // IssuesService handles communication with the issue related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/issues/ +// GitHub API docs: https://docs.github.com/rest/issues/ type IssuesService service // Issue represents a GitHub issue on a repository. @@ -56,7 +56,7 @@ type Issue struct { NodeID *string `json:"node_id,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // ActiveLockReason is populated only when LockReason is provided while locking the issue. @@ -132,8 +132,11 @@ type PullRequestLinks struct { // organization repositories; if false, list only owned and member // repositories. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +// +//meta:operation GET /issues +//meta:operation GET /user/issues func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { @@ -147,7 +150,9 @@ func (s *IssuesService) List(ctx context.Context, all bool, opts *IssueListOptio // ListByOrg fetches the issues in the specified organization for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +// +//meta:operation GET /orgs/{org}/issues func (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(ctx, u, opts) @@ -218,7 +223,9 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#list-repository-issues +// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues +// +//meta:operation GET /repos/{owner}/{repo}/issues func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) @@ -245,7 +252,9 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // Get a single issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#get-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -267,7 +276,9 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // Create a new issue on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#create-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) @@ -286,7 +297,9 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // Edit (update) an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) @@ -307,7 +320,9 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num // // This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#update-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) req, err := s.client.NewRequest("PATCH", u, &struct { @@ -337,7 +352,9 @@ type LockIssueOptions struct { // Lock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#lock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue +// +//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) @@ -350,7 +367,9 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // Unlock an issue's conversation. // -// GitHub API docs: https://docs.github.com/en/rest/issues/issues#unlock-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_assignees.go b/github/issues_assignees.go index b7f2e802437..fd065771ed3 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -13,7 +13,9 @@ import ( // ListAssignees fetches all available assignees (owners and collaborators) to // which issues may be assigned. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#list-assignees +// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees +// +//meta:operation GET /repos/{owner}/{repo}/assignees func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees", owner, repo) u, err := addOptions(u, opts) @@ -37,7 +39,9 @@ func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, o // IsAssignee checks if a user is an assignee for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#check-if-a-user-can-be-assigned +// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +// +//meta:operation GET /repos/{owner}/{repo}/assignees/{assignee} func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/assignees/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -52,7 +56,9 @@ func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string // AddAssignees adds the provided GitHub users as assignees to the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#add-assignees-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` @@ -74,7 +80,9 @@ func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, nu // RemoveAssignees removes the provided GitHub users as assignees from the issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/assignees#remove-assignees-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) { users := &struct { Assignees []string `json:"assignees,omitempty"` diff --git a/github/issues_comments.go b/github/issues_comments.go index 17881c093dc..74a4e60f7ca 100644 --- a/github/issues_comments.go +++ b/github/issues_comments.go @@ -50,8 +50,11 @@ type IssueListCommentsOptions struct { // ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#list-issue-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments +// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { @@ -83,7 +86,9 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GetComment fetches the specified issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) @@ -106,7 +111,9 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // CreateComment creates a new comment on the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#create-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -125,7 +132,9 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // EditComment updates an issue comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#update-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -143,7 +152,9 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // DeleteComment deletes an issue comment. // -// GitHub API docs: https://docs.github.com/en/rest/issues/comments#delete-an-issue-comment +// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_events.go b/github/issues_events.go index 0305fca1168..23a16bcdc72 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -101,7 +101,9 @@ type DismissedReview struct { // ListIssueEvents lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/events func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/events", owner, repo, number) u, err := addOptions(u, opts) @@ -127,7 +129,9 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, // ListRepositoryEvents lists events for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#list-issue-events-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/issues/events func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events", owner, repo) u, err := addOptions(u, opts) @@ -151,7 +155,9 @@ func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo st // GetEvent returns the specified issue event. // -// GitHub API docs: https://docs.github.com/en/rest/issues/events#get-an-issue-event +// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event +// +//meta:operation GET /repos/{owner}/{repo}/issues/events/{event_id} func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/events/%v", owner, repo, id) diff --git a/github/issues_labels.go b/github/issues_labels.go index d0f865c03f1..51e7fe6a55b 100644 --- a/github/issues_labels.go +++ b/github/issues_labels.go @@ -27,7 +27,9 @@ func (l Label) String() string { // ListLabels lists all labels for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/labels func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +53,9 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GetLabel gets a single label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#get-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label +// +//meta:operation GET /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) @@ -70,7 +74,9 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // CreateLabel creates a new label on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#create-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label +// +//meta:operation POST /repos/{owner}/{repo}/labels func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) @@ -89,7 +95,9 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // EditLabel edits a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#update-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label +// +//meta:operation PATCH /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) @@ -108,7 +116,9 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // DeleteLabel deletes a label. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#delete-a-label +// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label +// +//meta:operation DELETE /repos/{owner}/{repo}/labels/{name} func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) @@ -120,7 +130,9 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) @@ -144,7 +156,9 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#add-labels-to-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) @@ -163,7 +177,9 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // RemoveLabelForIssue removes a label for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-a-label-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) @@ -176,7 +192,9 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // ReplaceLabelsForIssue replaces all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#set-labels-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +// +//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) @@ -195,7 +213,9 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // RemoveLabelsForIssue removes all labels for an issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#remove-all-labels-from-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) @@ -208,7 +228,9 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // ListLabelsForMilestone lists labels for every issue in a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/labels#list-labels-for-issues-in-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +// +//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/issues_milestones.go b/github/issues_milestones.go index 897c7c0b6da..6c31bcd054d 100644 --- a/github/issues_milestones.go +++ b/github/issues_milestones.go @@ -54,7 +54,9 @@ type MilestoneListOptions struct { // ListMilestones lists all milestones for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#list-milestones +// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones +// +//meta:operation GET /repos/{owner}/{repo}/milestones func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) @@ -78,7 +80,9 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GetMilestone gets a single milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#get-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone +// +//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -97,7 +101,9 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // CreateMilestone creates a new milestone on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#create-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone +// +//meta:operation POST /repos/{owner}/{repo}/milestones func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) @@ -116,7 +122,9 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // EditMilestone edits a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#update-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone +// +//meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) @@ -135,7 +143,9 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // DeleteMilestone deletes a milestone. // -// GitHub API docs: https://docs.github.com/en/rest/issues/milestones#delete-a-milestone +// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone +// +//meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number} func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 8ac02ac14dc..0aa589afe40 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -14,7 +14,7 @@ import ( // Timeline represents an event that occurred around an Issue or Pull Request. // // It is similar to an IssueEvent but may contain more information. -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/issue-event-types type Timeline struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -166,7 +166,9 @@ type Source struct { // ListIssueTimeline lists events for the specified issue. // -// GitHub API docs: https://docs.github.com/en/rest/issues/timeline#list-timeline-events-for-an-issue +// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/timeline func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/timeline", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/licenses.go b/github/licenses.go index fdaae5cfaa9..34b8a3d8af1 100644 --- a/github/licenses.go +++ b/github/licenses.go @@ -13,7 +13,7 @@ import ( // LicensesService handles communication with the license related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/licenses/ +// GitHub API docs: https://docs.github.com/rest/licenses/ type LicensesService service // RepositoryLicense represents the license for a repository. @@ -61,6 +61,8 @@ func (l License) String() string { // List popular open source licenses. // // GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +// +//meta:operation GET /licenses func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error) { req, err := s.client.NewRequest("GET", "licenses", nil) if err != nil { @@ -79,6 +81,8 @@ func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, erro // Get extended metadata for one license. // // GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license +// +//meta:operation GET /licenses/{license} func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) { u := fmt.Sprintf("licenses/%s", licenseName) diff --git a/github/markdown.go b/github/markdown.go index 48b445b3d85..fe3b31128d5 100644 --- a/github/markdown.go +++ b/github/markdown.go @@ -41,6 +41,8 @@ type markdownRenderRequest struct { // Render renders an arbitrary Render document. // // GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document +// +//meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { request := &markdownRenderRequest{Text: String(text)} if opts != nil { diff --git a/github/messages.go b/github/messages.go index c16b6015284..3c60f5c597a 100644 --- a/github/messages.go +++ b/github/messages.go @@ -281,14 +281,14 @@ func ValidateSignature(signature string, payload, secretToken []byte) error { // WebHookType returns the event type of webhook request r. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types func WebHookType(r *http.Request) string { return r.Header.Get(EventTypeHeader) } // DeliveryID returns the unique delivery ID of webhook request r. // -// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types func DeliveryID(r *http.Request) string { return r.Header.Get(DeliveryIDHeader) } diff --git a/github/meta.go b/github/meta.go index a4d9bac77b4..c1b3d3c4c94 100644 --- a/github/meta.go +++ b/github/meta.go @@ -68,6 +68,8 @@ type APIMeta struct { // endpoint provides information about that installation. // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information +// +//meta:operation GET /meta func (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) { req, err := s.client.NewRequest("GET", "meta", nil) if err != nil { @@ -93,6 +95,8 @@ func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) { // bubble. If message is empty, a random zen phrase is used. // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat +// +//meta:operation GET /octocat func (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { @@ -124,6 +128,8 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // See also: http://warpspire.com/posts/taste/ // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +// +//meta:operation GET /zen func (s *MetaService) Zen(ctx context.Context) (string, *Response, error) { req, err := s.client.NewRequest("GET", "zen", nil) if err != nil { diff --git a/github/migrations.go b/github/migrations.go index 67989c0789f..5af8817050f 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -16,7 +16,7 @@ import ( // MigrationService provides access to the migration related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/migration/ +// GitHub API docs: https://docs.github.com/rest/migration/ type MigrationService service // Migration represents a GitHub migration (archival). @@ -74,7 +74,9 @@ type startMigration struct { // StartMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#start-an-organization-migration +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +// +//meta:operation POST /orgs/{org}/migrations func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) @@ -103,7 +105,9 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos // ListMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#list-organization-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +// +//meta:operation GET /orgs/{org}/migrations func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations", org) u, err := addOptions(u, opts) @@ -131,7 +135,9 @@ func (s *MigrationService) ListMigrations(ctx context.Context, org string, opts // MigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#get-an-organization-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status +// +//meta:operation GET /orgs/{org}/migrations/{migration_id} func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v", org, id) @@ -155,7 +161,9 @@ func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id i // MigrationArchiveURL fetches a migration archive URL. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#download-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive +// +//meta:operation GET /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -192,7 +200,9 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // DeleteMigration deletes a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#delete-an-organization-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive +// +//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/archive func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/archive", org, id) @@ -212,7 +222,9 @@ func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id i // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/orgs#unlock-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository +// +//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/migrations/%v/repos/%v/lock", org, id, repo) diff --git a/github/migrations_source_import.go b/github/migrations_source_import.go index 74a04b22a4e..3b161232f6a 100644 --- a/github/migrations_source_import.go +++ b/github/migrations_source_import.go @@ -115,7 +115,7 @@ func (i Import) String() string { // SourceImportAuthor identifies an author imported from a source repository. // -// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-commit-authors type SourceImportAuthor struct { ID *int64 `json:"id,omitempty"` RemoteID *string `json:"remote_id,omitempty"` @@ -132,7 +132,7 @@ func (a SourceImportAuthor) String() string { // LargeFile identifies a file larger than 100MB found during a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migration/source_imports/#get-large-files +// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-large-files type LargeFile struct { RefName *string `json:"ref_name,omitempty"` Path *string `json:"path,omitempty"` @@ -146,7 +146,9 @@ func (f LargeFile) String() string { // StartImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#start-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import +// +//meta:operation PUT /repos/{owner}/{repo}/import func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PUT", u, in) @@ -165,7 +167,9 @@ func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, // ImportProgress queries for the status and progress of an ongoing repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-an-import-status +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +// +//meta:operation GET /repos/{owner}/{repo}/import func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -184,7 +188,9 @@ func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo strin // UpdateImport initiates a repository import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import +// +//meta:operation PATCH /repos/{owner}/{repo}/import func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -213,7 +219,9 @@ func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, // This method and MapCommitAuthor allow you to provide correct Git author // information. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-commit-authors +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +// +//meta:operation GET /repos/{owner}/{repo}/import/authors func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -234,7 +242,9 @@ func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string // application can continue updating authors any time before you push new // commits to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#map-a-commit-author +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +// +//meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id} func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, author) @@ -255,7 +265,9 @@ func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo stri // files larger than 100MB. Only the UseLFS field on the provided Import is // used. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#update-git-lfs-preference +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +// +//meta:operation PATCH /repos/{owner}/{repo}/import/lfs func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/lfs", owner, repo) req, err := s.client.NewRequest("PATCH", u, in) @@ -274,7 +286,9 @@ func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo str // LargeFiles lists files larger than 100MB found during the import. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#get-large-files +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files +// +//meta:operation GET /repos/{owner}/{repo}/import/large_files func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/large_files", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -293,7 +307,9 @@ func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ( // CancelImport stops an import for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/source-imports#cancel-an-import +// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +// +//meta:operation DELETE /repos/{owner}/{repo}/import func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/import", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/migrations_user.go b/github/migrations_user.go index 6586fdb2d3f..1f907cd4ec2 100644 --- a/github/migrations_user.go +++ b/github/migrations_user.go @@ -67,7 +67,9 @@ type startUserMigration struct { // StartUserMigration starts the generation of a migration archive. // repos is a slice of repository names to migrate. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#start-a-user-migration +// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration +// +//meta:operation POST /user/migrations func (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) { u := "user/migrations" @@ -96,7 +98,9 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin // ListUserMigrations lists the most recent migrations. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#list-user-migrations +// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations +// +//meta:operation GET /user/migrations func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) { u := "user/migrations" u, err := addOptions(u, opts) @@ -124,7 +128,9 @@ func (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOpt // UserMigrationStatus gets the status of a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#get-a-user-migration-status +// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +// +//meta:operation GET /user/migrations/{migration_id} func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) { u := fmt.Sprintf("user/migrations/%v", id) @@ -148,7 +154,9 @@ func (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (* // UserMigrationArchiveURL gets the URL for a specific migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#download-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive +// +//meta:operation GET /user/migrations/{migration_id}/archive func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -182,7 +190,9 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 // DeleteUserMigration will delete a previous migration archive. // id is the migration ID. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#delete-a-user-migration-archive +// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +// +//meta:operation DELETE /user/migrations/{migration_id}/archive func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/archive", id) @@ -202,7 +212,9 @@ func (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (* // You should unlock each migrated repository and delete them when the migration // is complete and you no longer need the source data. // -// GitHub API docs: https://docs.github.com/en/rest/migrations/users#unlock-a-user-repository +// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +// +//meta:operation DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock func (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) { url := fmt.Sprintf("user/migrations/%v/repos/%v/lock", id, repo) diff --git a/github/orgs.go b/github/orgs.go index 33e8bf3c8c1..4d3465271b6 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -13,7 +13,7 @@ import ( // OrganizationsService provides access to the organization related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/ +// GitHub API docs: https://docs.github.com/rest/orgs/ type OrganizationsService service // Organization represents a GitHub organization account. @@ -148,7 +148,9 @@ type OrganizationsListOptions struct { // listing the next set of organizations, use the ID of the last-returned organization // as the opts.Since parameter for the next call. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations +// +//meta:operation GET /organizations func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) { u, err := addOptions("organizations", opts) if err != nil { @@ -171,8 +173,11 @@ func (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsL // List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user +// +//meta:operation GET /user/orgs +//meta:operation GET /users/{username}/orgs func (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) { var u string if user != "" { @@ -201,7 +206,9 @@ func (s *OrganizationsService) List(ctx context.Context, user string, opts *List // Get fetches an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization +// +//meta:operation GET /orgs/{org} func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("GET", u, nil) @@ -224,6 +231,8 @@ func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organizati // GetByID fetches an organization. // // Note: GetByID uses the undocumented GitHub API endpoint "GET /organizations/{organization_id}". +// +//meta:operation GET /organizations/{organization_id} func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) { u := fmt.Sprintf("organizations/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -242,7 +251,9 @@ func (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organiza // Edit an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#update-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization +// +//meta:operation PATCH /orgs/{org} func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) { u := fmt.Sprintf("orgs/%v", name) req, err := s.client.NewRequest("PATCH", u, org) @@ -264,7 +275,9 @@ func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organ // Delete an organization by name. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#delete-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization +// +//meta:operation DELETE /orgs/{org} func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v", org) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +290,9 @@ func (s *OrganizationsService) Delete(ctx context.Context, org string) (*Respons // ListInstallations lists installations for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#list-app-installations-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +// +//meta:operation GET /orgs/{org}/installations func (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) { u := fmt.Sprintf("orgs/%v/installations", org) diff --git a/github/orgs_actions_allowed.go b/github/orgs_actions_allowed.go index c467c11546b..b115e094a4b 100644 --- a/github/orgs_actions_allowed.go +++ b/github/orgs_actions_allowed.go @@ -11,8 +11,11 @@ import ( // GetActionsAllowed gets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization // Deprecated: please use `client.Actions.GetActionsAllowed` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) { s2 := (*ActionsService)(s) return s2.GetActionsAllowed(ctx, org) @@ -20,8 +23,11 @@ func (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string // EditActionsAllowed sets the actions that are allowed in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization // Deprecated: please use `client.Actions.EditActionsAllowed` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions func (s *OrganizationsService) EditActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { s2 := (*ActionsService)(s) return s2.EditActionsAllowed(ctx, org, actionsAllowed) diff --git a/github/orgs_actions_permissions.go b/github/orgs_actions_permissions.go index 607ffca7981..97df1c967e9 100644 --- a/github/orgs_actions_permissions.go +++ b/github/orgs_actions_permissions.go @@ -11,8 +11,11 @@ import ( // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-an-organization // Deprecated: please use `client.Actions.GetActionsPermissions` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) { s2 := (*ActionsService)(s) return s2.GetActionsPermissions(ctx, org) @@ -20,8 +23,11 @@ func (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org st // EditActionsPermissions sets the permissions policy for repositories and allowed actions in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-an-organization // Deprecated: please use `client.Actions.EditActionsPermissions` instead. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions func (s *OrganizationsService) EditActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) { s2 := (*ActionsService)(s) return s2.EditActionsPermissions(ctx, org, actionsPermissions) diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 83d7f6c79cf..e3afd3117f5 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -41,7 +41,7 @@ type PolicyOverrideReason struct { } // AuditEntry describes the fields that may be represented by various audit-log "action" entries. -// For a list of actions see - https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions +// 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`. @@ -136,6 +136,8 @@ type AuditEntryData struct { // GetAuditLog gets the audit-log entries for an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization +// +//meta:operation GET /orgs/{org}/audit-log func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) { u := fmt.Sprintf("orgs/%v/audit-log", org) u, err := addOptions(u, opts) diff --git a/github/orgs_credential_authorizations.go b/github/orgs_credential_authorizations.go index 6d56fe8f79a..eed0f0c66e0 100644 --- a/github/orgs_credential_authorizations.go +++ b/github/orgs_credential_authorizations.go @@ -58,7 +58,9 @@ type CredentialAuthorization struct { // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +// +//meta:operation GET /orgs/{org}/credential-authorizations func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) @@ -83,7 +85,9 @@ func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, // RemoveCredentialAuthorization revokes the SAML SSO authorization for a given // credential within an organization. Only available with GitHub Enterprise Cloud. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization +// +//meta:operation DELETE /orgs/{org}/credential-authorizations/{credential_id} func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) req, err := s.client.NewRequest(http.MethodDelete, u, nil) diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go index 7c5b0617e74..45de896a2f9 100644 --- a/github/orgs_custom_roles.go +++ b/github/orgs_custom_roles.go @@ -17,7 +17,7 @@ type OrganizationCustomRepoRoles struct { } // CustomRepoRoles represents custom repository roles for an organization. -// See https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization +// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization // for more information. type CustomRepoRoles struct { ID *int64 `json:"id,omitempty"` @@ -31,6 +31,8 @@ type CustomRepoRoles struct { // In order to see custom repository roles in an organization, the authenticated user must be an organization owner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// +//meta:operation GET /orgs/{org}/custom-repository-roles func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -60,6 +62,8 @@ type CreateOrUpdateCustomRoleOptions struct { // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// +//meta:operation POST /orgs/{org}/custom-repository-roles func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) @@ -81,6 +85,8 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // In order to update custom repository roles in an organization, the authenticated user must be an organization owner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// +//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) @@ -102,6 +108,8 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// +//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org, roleID string) (*Response, error) { u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go index c0dd51e24e3..c2eef77c92e 100644 --- a/github/orgs_hooks.go +++ b/github/orgs_hooks.go @@ -12,7 +12,9 @@ import ( // ListHooks lists all Hooks for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-organization-webhooks +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +// +//meta:operation GET /orgs/{org}/hooks func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) u, err := addOptions(u, opts) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts * // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -59,7 +63,9 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // Note that only a subset of the hook fields are used and hook must // not be nil. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#create-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks", org) @@ -86,7 +92,9 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#update-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +// +//meta:operation PATCH /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -105,7 +113,9 @@ func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int6 // PingHook triggers a 'ping' event to be sent to the Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#ping-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks/{hook_id}/pings func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d/pings", org, id) req, err := s.client.NewRequest("POST", u, nil) @@ -118,7 +128,9 @@ func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int6 // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#delete-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +// +//meta:operation DELETE /orgs/{org}/hooks/{hook_id} func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%d", org, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_hooks_configuration.go b/github/orgs_hooks_configuration.go index 953a2329c36..aeb616fc4c7 100644 --- a/github/orgs_hooks_configuration.go +++ b/github/orgs_hooks_configuration.go @@ -12,7 +12,9 @@ import ( // GetHookConfiguration returns the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org str // EditHookConfiguration updates the configuration for the specified organization webhook. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +// +//meta:operation PATCH /orgs/{org}/hooks/{hook_id}/config func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/orgs_hooks_deliveries.go b/github/orgs_hooks_deliveries.go index 1bfad409ea5..c1c30124028 100644 --- a/github/orgs_hooks_deliveries.go +++ b/github/orgs_hooks_deliveries.go @@ -12,7 +12,9 @@ import ( // ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) u, err := addOptions(u, opts) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org strin // GetHookDelivery returns a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +// +//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -55,7 +59,9 @@ func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string // RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +// +//meta:operation POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v/attempts", owner, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_members.go b/github/orgs_members.go index 79f8a653333..5bc23657fcd 100644 --- a/github/orgs_members.go +++ b/github/orgs_members.go @@ -71,8 +71,11 @@ type ListMembersOptions struct { // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-members -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-public-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members +// +//meta:operation GET /orgs/{org}/members +//meta:operation GET /orgs/{org}/public_members func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) { var u string if opts != nil && opts.PublicOnly { @@ -101,7 +104,9 @@ func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts // IsMember checks if a user is a member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/members/{username} func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -116,7 +121,9 @@ func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) ( // IsPublicMember checks if a user is a public member of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#check-public-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/public_members/{username} func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +138,9 @@ func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user str // RemoveMember removes a user from all teams of an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-an-organization-member +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member +// +//meta:operation DELETE /orgs/{org}/members/{username} func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -145,7 +154,9 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +// +//meta:operation PUT /orgs/{org}/public_members/{username} func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -158,7 +169,9 @@ func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, use // ConcealMembership conceals a user's membership in an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +// +//meta:operation DELETE /orgs/{org}/public_members/{username} func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/public_members/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +194,9 @@ type ListOrgMembershipsOptions struct { // ListOrgMemberships lists the organization memberships for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +// +//meta:operation GET /user/memberships/orgs func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) { u := "user/memberships/orgs" u, err := addOptions(u, opts) @@ -207,8 +222,11 @@ func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *Lis // Passing an empty string for user will get the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#get-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +// +//meta:operation GET /orgs/{org}/memberships/{username} +//meta:operation GET /user/memberships/orgs/{org} func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) { var u string if user != "" { @@ -235,8 +253,11 @@ func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org s // Passing an empty string for user will edit the membership for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +// +//meta:operation PUT /orgs/{org}/memberships/{username} +//meta:operation PATCH /user/memberships/orgs/{org} func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) { var u, method string if user != "" { @@ -264,7 +285,9 @@ func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org // RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#remove-organization-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/memberships/{username} func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) { u := fmt.Sprintf("orgs/%v/memberships/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -277,7 +300,9 @@ func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, or // ListPendingOrgInvitations returns a list of pending invitations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-pending-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations +// +//meta:operation GET /orgs/{org}/invitations func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) u, err := addOptions(u, opts) @@ -323,7 +348,9 @@ type CreateOrgInvitationOptions struct { // In order to create invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#create-an-organization-invitation +// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +// +//meta:operation POST /orgs/{org}/invitations func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations", org) @@ -344,7 +371,9 @@ func (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org stri // ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization, // the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-organization-invitation-teams +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams +// +//meta:operation GET /orgs/{org}/invitations/{invitation_id}/teams func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/invitations/%v/teams", org, invitationID) u, err := addOptions(u, opts) @@ -368,7 +397,9 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, // ListFailedOrgInvitations returns a list of failed inviatations. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/members#list-failed-organization-invitations +// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations +// +//meta:operation GET /orgs/{org}/failed_invitations func (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/failed_invitations", org) u, err := addOptions(u, opts) diff --git a/github/orgs_outside_collaborators.go b/github/orgs_outside_collaborators.go index 506a4946034..56034d72602 100644 --- a/github/orgs_outside_collaborators.go +++ b/github/orgs_outside_collaborators.go @@ -27,7 +27,9 @@ type ListOutsideCollaboratorsOptions struct { // Warning: The API may change without advance notice during the preview period. // Preview features are not supported for production use. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +// +//meta:operation GET /orgs/{org}/outside_collaborators func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators", org) u, err := addOptions(u, opts) @@ -52,7 +54,9 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // RemoveOutsideCollaborator removes a user from the list of outside collaborators; // consequently, removing them from all the organization's repositories. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +// +//meta:operation DELETE /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,7 +73,9 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // Responses for converting a non-member or the last owner to an outside collaborator // are listed in GitHub API docs. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +// +//meta:operation PUT /orgs/{org}/outside_collaborators/{username} func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) diff --git a/github/orgs_packages.go b/github/orgs_packages.go index 0dfe7841695..739c9eaf4b3 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -13,6 +13,8 @@ import ( // List the packages for an organization. // // GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization +// +//meta:operation GET /orgs/{org}/packages func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) { u := fmt.Sprintf("orgs/%v/packages", org) u, err := addOptions(u, opts) @@ -37,6 +39,8 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // Get a package by name from an organization. // // 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) req, err := s.client.NewRequest("GET", u, nil) @@ -56,6 +60,8 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // Delete a package from an organization. // // 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) req, err := s.client.NewRequest("DELETE", u, nil) @@ -69,6 +75,8 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // Restore a package to an organization. // // 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) req, err := s.client.NewRequest("POST", u, nil) @@ -82,6 +90,8 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // Get all versions of a package in an organization. // // 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, err := addOptions(u, opts) @@ -106,6 +116,8 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // Get a specific version of a package in an organization. // // 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) req, err := s.client.NewRequest("GET", u, nil) @@ -125,6 +137,8 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // Delete a package version from an organization. // // 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) req, err := s.client.NewRequest("DELETE", u, nil) @@ -138,6 +152,8 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // Restore a package version to an organization. // // 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) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/orgs_personal_access_tokens.go b/github/orgs_personal_access_tokens.go index c30ff2843ee..0d786114f8c 100644 --- a/github/orgs_personal_access_tokens.go +++ b/github/orgs_personal_access_tokens.go @@ -21,7 +21,9 @@ type ReviewPersonalAccessTokenRequestOptions struct { // Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. // `action` can be one of `approve` or `deny`. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// +//meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) diff --git a/github/orgs_projects.go b/github/orgs_projects.go index d49eae54dce..454d8cf1c34 100644 --- a/github/orgs_projects.go +++ b/github/orgs_projects.go @@ -12,7 +12,9 @@ import ( // ListProjects lists the projects for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-organization-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects +// +//meta:operation GET /orgs/{org}/projects func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt // CreateProject creates a GitHub Project for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-an-organization-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project +// +//meta:operation POST /orgs/{org}/projects func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/projects", org) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/orgs_rules.go b/github/orgs_rules.go index a3905af8fb3..37c06a7333c 100644 --- a/github/orgs_rules.go +++ b/github/orgs_rules.go @@ -12,7 +12,9 @@ import ( // GetAllOrganizationRulesets gets all the rulesets for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-all-organization-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// +//meta:operation GET /orgs/{org}/rulesets func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -32,7 +34,9 @@ func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, o // CreateOrganizationRuleset creates a ruleset for the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#create-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// +//meta:operation POST /orgs/{org}/rulesets func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", org) @@ -52,7 +56,9 @@ func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, or // GetOrganizationRuleset gets a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#get-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// +//meta:operation GET /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) @@ -72,7 +78,9 @@ func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org s // UpdateOrganizationRuleset updates a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#update-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// +//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} 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) @@ -92,7 +100,9 @@ func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, or // DeleteOrganizationRuleset deletes a ruleset from the specified organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/rules#delete-an-organization-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// +//meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) diff --git a/github/orgs_security_managers.go b/github/orgs_security_managers.go index a3f002e0e1c..08037727320 100644 --- a/github/orgs_security_managers.go +++ b/github/orgs_security_managers.go @@ -12,7 +12,9 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +// +//meta:operation GET /orgs/{org}/security-managers func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/security-managers", org) @@ -32,7 +34,9 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +// +//meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("PUT", u, nil) @@ -45,7 +49,9 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team +// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +// +//meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) { u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/orgs_users_blocking.go b/github/orgs_users_blocking.go index 9c6cf60269e..62bd9116cde 100644 --- a/github/orgs_users_blocking.go +++ b/github/orgs_users_blocking.go @@ -12,7 +12,9 @@ import ( // ListBlockedUsers lists all the users blocked by an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#list-users-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +// +//meta:operation GET /orgs/{org}/blocks func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks", org) u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // IsBlocked reports whether specified user is blocked from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +// +//meta:operation GET /orgs/{org}/blocks/{username} func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -58,7 +62,9 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // BlockUser blocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#block-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +// +//meta:operation PUT /orgs/{org}/blocks/{username} func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) @@ -75,7 +81,9 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // UnblockUser unblocks specified user from an organization. // -// GitHub API docs: https://docs.github.com/en/rest/orgs/blocking#unblock-a-user-from-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +// +//meta:operation DELETE /orgs/{org}/blocks/{username} func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) diff --git a/github/projects.go b/github/projects.go index df7ad6cd97e..c5c42f8939b 100644 --- a/github/projects.go +++ b/github/projects.go @@ -13,7 +13,7 @@ import ( // ProjectsService provides access to the projects functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/projects +// GitHub API docs: https://docs.github.com/rest/projects type ProjectsService service // Project represents a GitHub Project. @@ -43,7 +43,9 @@ func (p Project) String() string { // GetProject gets a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#get-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project +// +//meta:operation GET /projects/{project_id} func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -90,7 +92,9 @@ type ProjectOptions struct { // UpdateProject updates a repository project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#update-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project +// +//meta:operation PATCH /projects/{project_id} func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("PATCH", u, opts) @@ -112,7 +116,9 @@ func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *Pro // DeleteProject deletes a GitHub Project from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#delete-a-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project +// +//meta:operation DELETE /projects/{project_id} func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("projects/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -128,7 +134,7 @@ func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Respons // ProjectColumn represents a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/repos/projects/ +// GitHub API docs: https://docs.github.com/rest/repos/projects/ type ProjectColumn struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -142,7 +148,9 @@ type ProjectColumn struct { // ListProjectColumns lists the columns of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#list-project-columns +// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns +// +//meta:operation GET /projects/{project_id}/columns func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) u, err := addOptions(u, opts) @@ -169,7 +177,9 @@ func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int6 // GetProjectColumn gets a column of a GitHub Project for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#get-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column +// +//meta:operation GET /projects/columns/{column_id} func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -199,7 +209,9 @@ type ProjectColumnOptions struct { // CreateProjectColumn creates a column for the specified (by number) project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#create-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column +// +//meta:operation POST /projects/{project_id}/columns func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/%v/columns", projectID) req, err := s.client.NewRequest("POST", u, opts) @@ -221,7 +233,9 @@ func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int // UpdateProjectColumn updates a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#update-an-existing-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column +// +//meta:operation PATCH /projects/columns/{column_id} func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -243,7 +257,9 @@ func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int6 // DeleteProjectColumn deletes a column from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#delete-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column +// +//meta:operation DELETE /projects/columns/{column_id} func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/%v", columnID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -267,7 +283,9 @@ type ProjectColumnMoveOptions struct { // MoveProjectColumn moves a column within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/columns#move-a-project-column +// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column +// +//meta:operation POST /projects/columns/{column_id}/moves func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/%v/moves", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -283,7 +301,7 @@ func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, // ProjectCard represents a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards/#get-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards/#get-a-project-card type ProjectCard struct { URL *string `json:"url,omitempty"` ColumnURL *string `json:"column_url,omitempty"` @@ -318,7 +336,9 @@ type ProjectCardListOptions struct { // ListProjectCards lists the cards in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#list-project-cards +// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards +// +//meta:operation GET /projects/columns/{column_id}/cards func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) u, err := addOptions(u, opts) @@ -345,7 +365,9 @@ func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, // GetProjectCard gets a card in a column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#get-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card +// +//meta:operation GET /projects/columns/cards/{card_id} func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("GET", u, nil) @@ -383,7 +405,9 @@ type ProjectCardOptions struct { // CreateProjectCard creates a card in the specified column of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#create-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card +// +//meta:operation POST /projects/columns/{column_id}/cards func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/%v/cards", columnID) req, err := s.client.NewRequest("POST", u, opts) @@ -405,7 +429,9 @@ func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, // UpdateProjectCard updates a card of a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#update-an-existing-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card +// +//meta:operation PATCH /projects/columns/cards/{card_id} func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("PATCH", u, opts) @@ -427,7 +453,9 @@ func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, o // DeleteProjectCard deletes a card from a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#delete-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card +// +//meta:operation DELETE /projects/columns/cards/{card_id} func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v", cardID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -455,7 +483,9 @@ type ProjectCardMoveOptions struct { // MoveProjectCard moves a card within a GitHub Project. // -// GitHub API docs: https://docs.github.com/en/rest/projects/cards#move-a-project-card +// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card +// +//meta:operation POST /projects/columns/cards/{card_id}/moves func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) req, err := s.client.NewRequest("POST", u, opts) @@ -485,7 +515,9 @@ type ProjectCollaboratorOptions struct { // AddProjectCollaborator adds a collaborator to an organization project and sets // their permission level. You must be an organization owner or a project admin to add a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#add-project-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator +// +//meta:operation PUT /projects/{project_id}/collaborators/{username} func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("PUT", u, opts) @@ -502,7 +534,9 @@ func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, // RemoveProjectCollaborator removes a collaborator from an organization project. // You must be an organization owner or a project admin to remove a collaborator. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#remove-user-as-a-collaborator +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator +// +//meta:operation DELETE /projects/{project_id}/collaborators/{username} func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) req, err := s.client.NewRequest("DELETE", u, nil) @@ -538,7 +572,9 @@ type ListCollaboratorOptions struct { // with access through default organization permissions, and organization owners. You must be an // organization owner or a project admin to list collaborators. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#list-project-collaborators +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators +// +//meta:operation GET /projects/{project_id}/collaborators func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators", id) u, err := addOptions(u, opts) @@ -576,7 +612,9 @@ type ProjectPermissionLevel struct { // project. Possible values for the permission key: "admin", "write", "read", "none". // You must be an organization owner or a project admin to review a user's permission level. // -// GitHub API docs: https://docs.github.com/en/rest/projects/collaborators#get-project-permission-for-a-user +// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user +// +//meta:operation GET /projects/{project_id}/collaborators/{username}/permission func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/pulls.go b/github/pulls.go index 29549e24b86..80df9fa688a 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -14,7 +14,7 @@ import ( // PullRequestsService handles communication with the pull request related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/ +// GitHub API docs: https://docs.github.com/rest/pulls/ type PullRequestsService service // PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. @@ -72,7 +72,7 @@ type PullRequest struct { AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` // RequestedTeams is populated as part of the PullRequestEvent. - // See, https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. + // See, https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. RequestedTeams []*Team `json:"requested_teams,omitempty"` Links *PRLinks `json:"_links,omitempty"` @@ -142,7 +142,9 @@ type PullRequestListOptions struct { // List the pull requests for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests +// +//meta:operation GET /repos/{owner}/{repo}/pulls func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) @@ -169,7 +171,9 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // The results may include open and closed pull requests. // By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) @@ -195,7 +199,9 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // Get a single pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -214,7 +220,9 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GetRaw gets a single pull request in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -254,7 +262,9 @@ type NewPullRequest struct { // Create a new pull request on the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) @@ -293,7 +303,9 @@ type PullRequestBranchUpdateResponse struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request-branch +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch func (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/update-branch", owner, repo, number) @@ -328,7 +340,9 @@ type pullRequestUpdate struct { // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify. // Base.Ref updates the base branch of the pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +// +//meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, fmt.Errorf("pull must be provided") @@ -365,7 +379,9 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // ListCommits lists the commits in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-commits-on-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) @@ -389,7 +405,9 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // ListFiles lists the files in a pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) @@ -413,7 +431,9 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // IsMerged checks if a pull request has been merged. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) @@ -455,7 +475,9 @@ type pullRequestMergeRequest struct { // Merge a pull request. // commitMessage is an extra detail to append to automatic commit message. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index ea1cf45d1e8..a9ffe8d7cc1 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -41,7 +41,7 @@ type PullRequestComment struct { URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` - // Can be one of: LINE, FILE from https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request + // Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request SubjectType *string `json:"subject_type,omitempty"` } @@ -68,8 +68,11 @@ type PullRequestListCommentsOptions struct { // pull request number of 0 will return all comments on all pull requests for // the repository. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-on-a-pull-request -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) { var u string if number == 0 { @@ -102,7 +105,9 @@ func (s *PullRequestsService) ListComments(ctx context.Context, owner, repo stri // GetComment fetches the specified pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -125,7 +130,9 @@ func (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string // CreateComment creates a new comment on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) @@ -147,7 +154,9 @@ func (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo str // CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) { comment := &struct { Body string `json:"body,omitempty"` @@ -174,7 +183,9 @@ func (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, // EditComment updates a pull request comment. // A non-nil comment.Body must be provided. Other comment fields should be left nil. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +// +//meta:operation PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) @@ -193,7 +204,9 @@ func (s *PullRequestsService) EditComment(ctx context.Context, owner, repo strin // DeleteComment deletes a pull request comment. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} func (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/pulls_reviewers.go b/github/pulls_reviewers.go index 96b49651b96..3f0c50b746a 100644 --- a/github/pulls_reviewers.go +++ b/github/pulls_reviewers.go @@ -25,7 +25,9 @@ type Reviewers struct { // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("POST", u, &reviewers) @@ -45,6 +47,8 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo // ListReviewers lists reviewers whose reviews have been requested on the specified pull request. // // GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opts *ListOptions) (*Reviewers, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/requested_reviewers", owner, repo, number) u, err := addOptions(u, opts) @@ -68,7 +72,9 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // RemoveReviewers removes the review request for the provided reviewers for the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, &reviewers) diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index addcce46834..27b8dc37d5d 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -100,7 +100,9 @@ func (r PullRequestReviewDismissalRequest) String() string { // ListReviews lists all reviews on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) u, err := addOptions(u, opts) @@ -124,7 +126,9 @@ func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo strin // GetReview fetches the specified pull request review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -144,7 +148,9 @@ func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, // DeletePendingReview deletes the specified pull request pending review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) @@ -164,7 +170,9 @@ func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, re // ListReviewComments lists all the comments for the specified review. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#list-comments-for-a-pull-request-review +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review +// +//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID) u, err := addOptions(u, opts) @@ -188,8 +196,6 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // CreateReview creates a new review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request -// // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: // @@ -223,6 +229,10 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // Use this instead. // It is waaaaaay better. // ``` +// +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) @@ -251,7 +261,9 @@ func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo stri // UpdateReview updates the review summary on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#update-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) { opts := &struct { Body string `json:"body"` @@ -274,7 +286,9 @@ func (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo stri // SubmitReview submits a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#submit-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +// +//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID) @@ -294,7 +308,9 @@ func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo stri // DismissReview dismisses a specified review on the specified pull request. // -// GitHub API docs: https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +// +//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID) diff --git a/github/reactions.go b/github/reactions.go index c246356fd9b..51c81797d78 100644 --- a/github/reactions.go +++ b/github/reactions.go @@ -14,7 +14,7 @@ import ( // ReactionsService provides access to the reactions-related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/reactions +// GitHub API docs: https://docs.github.com/rest/reactions type ReactionsService service // Reaction represents a GitHub reaction. @@ -61,6 +61,8 @@ type ListCommentReactionOptions struct { // ListCommentReactions lists the reactions for a commit comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment +// +//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -91,6 +93,8 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +// +//meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) @@ -115,6 +119,8 @@ func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, rep // DeleteCommentReaction deletes the reaction for a commit comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -124,6 +130,8 @@ func (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, rep // DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { u := fmt.Sprintf("repositories/%v/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -133,6 +141,8 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // ListIssueReactions lists the reactions for an issue. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) @@ -163,6 +173,8 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/reactions func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) @@ -187,6 +199,8 @@ func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo // DeleteIssueReaction deletes the reaction to an issue. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/%v/reactions/%v", owner, repo, issueNumber, reactionID) @@ -196,6 +210,8 @@ func (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo // DeleteIssueReactionByID deletes the reaction to an issue by repository ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/%v/reactions/%v", repoID, issueNumber, reactionID) @@ -205,6 +221,8 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // ListIssueCommentReactions lists the reactions for an issue comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment +// +//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -235,6 +253,8 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +// +//meta:operation POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) @@ -259,6 +279,8 @@ func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReaction deletes the reaction to an issue comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -268,6 +290,8 @@ func (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner // DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/issues/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -277,6 +301,8 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // ListPullRequestCommentReactions lists the reactions for a pull request review comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +// +//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) @@ -307,6 +333,8 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +// +//meta:operation POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) @@ -331,6 +359,8 @@ func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReaction deletes the reaction to a pull request review comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions/%v", owner, repo, commentID, reactionID) @@ -340,6 +370,8 @@ func (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, // DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) { url := fmt.Sprintf("repositories/%v/pulls/comments/%v/reactions/%v", repoID, commentID, reactionID) @@ -349,6 +381,8 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // ListTeamDiscussionReactions lists the reactions for a team discussion. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy +// +//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) @@ -376,6 +410,8 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy +// +//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/reactions func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) @@ -399,6 +435,8 @@ func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, tea // DeleteTeamDiscussionReaction deletes the reaction to a team discussion. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/reactions/%v", org, teamSlug, discussionNumber, reactionID) @@ -408,6 +446,8 @@ func (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org // DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/reactions/%v", orgID, teamID, discussionNumber, reactionID) @@ -417,6 +457,8 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy +// +//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) @@ -443,6 +485,8 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy +// +//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) @@ -466,6 +510,8 @@ func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v", org, teamSlug, discussionNumber, commentNumber, reactionID) @@ -475,6 +521,8 @@ func (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Conte // DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID. // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions func (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) { url := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v", orgID, teamID, discussionNumber, commentNumber, reactionID) @@ -499,6 +547,8 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res // The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". // // GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/reactions func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) diff --git a/github/repos.go b/github/repos.go index 9f5e1b3686b..302ed85a7b3 100644 --- a/github/repos.go +++ b/github/repos.go @@ -22,7 +22,7 @@ var ErrBranchNotProtected = errors.New("branch is not protected") // RepositoriesService handles communication with the repository related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/repos/ +// GitHub API docs: https://docs.github.com/rest/repos/ type RepositoriesService service // Repository represents a GitHub repository. @@ -141,7 +141,7 @@ type Repository struct { TeamsURL *string `json:"teams_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Visibility is only used for Create and Edit endpoints. The visibility field @@ -150,7 +150,7 @@ type Repository struct { Visibility *string `json:"visibility,omitempty"` // RoleName is only returned by the API 'check team permissions for a repository'. - // See: teams.go (IsTeamRepoByID) https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository + // See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository RoleName *string `json:"role_name,omitempty"` } @@ -220,7 +220,7 @@ func (s SecurityAndAnalysis) String() string { // AdvancedSecurity specifies the state of advanced security on a repository. // -// GitHub API docs: https://docs.github.com/en/github/getting-started-with-github/learning-about-github/about-github-advanced-security +// GitHub API docs: https://docs.github.com/github/getting-started-with-github/learning-about-github/about-github-advanced-security type AdvancedSecurity struct { Status *string `json:"status,omitempty"` } @@ -231,7 +231,7 @@ func (a AdvancedSecurity) String() string { // SecretScanning specifies the state of secret scanning on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/secret-security/about-secret-scanning +// GitHub API docs: https://docs.github.com/code-security/secret-security/about-secret-scanning type SecretScanning struct { Status *string `json:"status,omitempty"` } @@ -242,7 +242,7 @@ func (s SecretScanning) String() string { // SecretScanningPushProtection specifies the state of secret scanning push protection on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns +// GitHub API docs: https://docs.github.com/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns type SecretScanningPushProtection struct { Status *string `json:"status,omitempty"` } @@ -253,7 +253,7 @@ func (s SecretScanningPushProtection) String() string { // DependabotSecurityUpdates specifies the state of Dependabot security updates on a repository. // -// GitHub API docs: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates +// GitHub API docs: https://docs.github.com/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates type DependabotSecurityUpdates struct { Status *string `json:"status,omitempty"` } @@ -265,8 +265,11 @@ func (d DependabotSecurityUpdates) String() string { // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +// +//meta:operation GET /user/repos +//meta:operation GET /users/{username}/repos func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { var u string if user != "" { @@ -317,7 +320,9 @@ type RepositoryListByOrgOptions struct { // ListByOrg lists the repositories for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-organization-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories +// +//meta:operation GET /orgs/{org}/repos func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/repos", org) u, err := addOptions(u, opts) @@ -352,7 +357,9 @@ type RepositoryListAllOptions struct { // ListAll lists all GitHub repositories in the order that they were created. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-public-repositories +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories +// +//meta:operation GET /repositories func (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) { u, err := addOptions("repositories", opts) if err != nil { @@ -424,8 +431,11 @@ type createRepoRequest struct { // changes propagate throughout its servers. You may set up a loop with // exponential back-off to verify repository's creation. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository +// +//meta:operation POST /orgs/{org}/repos +//meta:operation POST /user/repos func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { var u string if org != "" { @@ -492,7 +502,9 @@ type TemplateRepoRequest struct { // CreateFromTemplate generates a repository from a template. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-using-a-template +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +// +//meta:operation POST /repos/{template_owner}/{template_repo}/generate func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/generate", templateOwner, templateRepo) @@ -513,7 +525,9 @@ func (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOw // Get fetches a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -522,7 +536,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // TODO: remove custom Accept header when the license support fully launches - // https://docs.github.com/en/rest/licenses/#get-a-repositorys-license + // https://docs.github.com/rest/licenses/#get-a-repositorys-license acceptHeaders := []string{ mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, @@ -541,10 +555,12 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep } // GetCodeOfConduct gets the contents of a repository's code of conduct. -// Note that https://docs.github.com/en/rest/codes-of-conduct#about-the-codes-of-conduct-api +// Note that https://docs.github.com/rest/codes-of-conduct#about-the-codes-of-conduct-api // says to use the GET /repos/{owner}/{repo} endpoint. // // GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository +// +//meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -567,6 +583,8 @@ func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo // GetByID fetches a repository. // // Note: GetByID uses the undocumented GitHub API endpoint "GET /repositories/{repository_id}". +// +//meta:operation GET /repositories/{repository_id} func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repository, *Response, error) { u := fmt.Sprintf("repositories/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -585,7 +603,9 @@ func (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repositor // Edit updates a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#update-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo} func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("PATCH", u, repository) @@ -606,7 +626,9 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo // Delete a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#delete-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo} func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -653,7 +675,9 @@ type ListContributorsOptions struct { // GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -672,7 +696,9 @@ func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, // EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +// +//meta:operation PUT /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -689,7 +715,9 @@ func (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, own // DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-vulnerability-alerts +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +// +//meta:operation DELETE /repos/{owner}/{repo}/vulnerability-alerts func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) @@ -706,7 +734,9 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -725,7 +755,9 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// +//meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -739,7 +771,9 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// +//meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) @@ -753,7 +787,9 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // ListContributors lists contributors for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-contributors +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors +// +//meta:operation GET /repos/{owner}/{repo}/contributors func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) @@ -784,7 +820,9 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // "Python": 7769 // } // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages +// +//meta:operation GET /repos/{owner}/{repo}/languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -803,7 +841,9 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // ListTeams lists the teams for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-teams +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams +// +//meta:operation GET /repos/{owner}/{repo}/teams func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) @@ -835,7 +875,9 @@ type RepositoryTag struct { // ListTags lists tags for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-tags +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags +// +//meta:operation GET /repos/{owner}/{repo}/tags func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) @@ -1250,7 +1292,9 @@ type AutomatedSecurityFixes struct { // ListBranches lists branches for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches +// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches +// +//meta:operation GET /repos/{owner}/{repo}/branches func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) @@ -1276,7 +1320,9 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#get-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch} func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, url.PathEscape(branch)) @@ -1307,7 +1353,9 @@ type renameBranchRequest struct { // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#rename-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/rename func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, url.PathEscape(branch)) r := &renameBranchRequest{NewName: newName} @@ -1329,7 +1377,9 @@ func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, bra // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1356,7 +1406,9 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-status-checks-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1380,7 +1432,9 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-all-status-check-contexts +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks/contexts", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1403,7 +1457,9 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, preq) @@ -1427,7 +1483,9 @@ func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1442,7 +1500,9 @@ func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1467,7 +1527,9 @@ func (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#create-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) @@ -1491,7 +1553,9 @@ func (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-commit-signature-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_signatures", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1509,7 +1573,9 @@ func (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Co // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, sreq) @@ -1530,7 +1596,9 @@ func (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, ow // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-status-check-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_status_checks", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1544,6 +1612,8 @@ func (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, ow // License gets the contents of a repository's license if one is detected. // // GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/license func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) { u := fmt.Sprintf("repos/%v/%v/license", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1564,7 +1634,9 @@ func (s *RepositoriesService) License(ctx context.Context, owner, repo string) ( // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1589,7 +1661,9 @@ func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Contex // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PATCH", u, patch) @@ -1614,7 +1688,9 @@ func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +// +//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) @@ -1643,7 +1719,9 @@ func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-pull-request-review-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/required_pull_request_reviews", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1658,7 +1736,9 @@ func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Con // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1680,7 +1760,9 @@ func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, nil) @@ -1701,7 +1783,9 @@ func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#delete-admin-branch-protection +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/enforce_admins", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, nil) @@ -1719,7 +1803,9 @@ type repositoryTopics struct { // ListAllTopics lists topics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#get-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics +// +//meta:operation GET /repos/{owner}/{repo}/topics func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -1741,7 +1827,9 @@ func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo str // ReplaceAllTopics replaces all repository topics. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics +// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +// +//meta:operation PUT /repos/{owner}/{repo}/topics func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/topics", owner, repo) t := &repositoryTopics{ @@ -1772,9 +1860,11 @@ func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Deprecated: Please use ListAppRestrictions instead. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1794,9 +1884,11 @@ func (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch // ListAppRestrictions lists the GitHub apps that have push access to a given protected branch. // It requires the GitHub apps to have `write` access to the `content` permission. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch -// // Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved. +// +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) { return s.ListApps(ctx, owner, repo, branch) } @@ -1809,7 +1901,9 @@ func (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, apps) @@ -1833,7 +1927,9 @@ func (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, apps) @@ -1857,7 +1953,9 @@ func (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, rep // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-app-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/apps", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, apps) @@ -1879,7 +1977,9 @@ func (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -1904,7 +2004,9 @@ func (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, r // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#set-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, teams) @@ -1928,7 +2030,9 @@ func (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#add-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, teams) @@ -1952,7 +2056,9 @@ func (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, re // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#remove-team-access-restrictions +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/teams", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, teams) @@ -1974,7 +2080,9 @@ func (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, // // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // -// GitHub API docs: https://docs.github.com/en/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +// +//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("GET", u, nil) @@ -2000,6 +2108,8 @@ func (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, r // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // // GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +// +//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("PUT", u, users) @@ -2024,6 +2134,8 @@ func (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // // GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +// +//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("POST", u, users) @@ -2048,6 +2160,8 @@ func (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, re // Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape . // // GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +// +//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users func (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v/protection/restrictions/users", owner, repo, url.PathEscape(branch)) req, err := s.client.NewRequest("DELETE", u, users) @@ -2079,7 +2193,9 @@ type TransferRequest struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#transfer-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/transfer func (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/transfer", owner, repo) @@ -2108,7 +2224,9 @@ type DispatchRequestOptions struct { // Dispatch triggers a repository_dispatch event in a GitHub Actions workflow. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event +// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +// +//meta:operation POST /repos/{owner}/{repo}/dispatches func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/dispatches", owner, repo) @@ -2136,7 +2254,9 @@ func isBranchNotProtected(err error) bool { // EnablePrivateReporting enables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) @@ -2156,7 +2276,9 @@ func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, // DisablePrivateReporting disables private reporting of vulnerabilities for a // repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/private-vulnerability-reporting func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) diff --git a/github/repos_actions_access.go b/github/repos_actions_access.go index 55761eeb7ee..2da1f01cc26 100644 --- a/github/repos_actions_access.go +++ b/github/repos_actions_access.go @@ -12,7 +12,7 @@ import ( // RepositoryActionsAccessLevel represents the repository actions access level. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository type RepositoryActionsAccessLevel struct { // AccessLevel specifies the level of access that workflows outside of the repository have // to actions and reusable workflows within the repository. @@ -23,7 +23,9 @@ type RepositoryActionsAccessLevel struct { // GetActionsAccessLevel gets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -43,7 +45,9 @@ func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, // EditActionsAccessLevel sets the level of access that workflows outside of the repository have // to actions and reusable workflows in the repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/access func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo) req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel) diff --git a/github/repos_actions_allowed.go b/github/repos_actions_allowed.go index 25a46905839..e9ebff1d328 100644 --- a/github/repos_actions_allowed.go +++ b/github/repos_actions_allowed.go @@ -12,7 +12,9 @@ import ( // GetActionsAllowed gets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ func (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo s // EditActionsAllowed sets the allowed actions and reusable workflows for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/selected-actions func (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions/selected-actions", org, repo) req, err := s.client.NewRequest("PUT", u, actionsAllowed) diff --git a/github/repos_actions_permissions.go b/github/repos_actions_permissions.go index 45f844cec02..2dcc367de1c 100644 --- a/github/repos_actions_permissions.go +++ b/github/repos_actions_permissions.go @@ -12,7 +12,7 @@ import ( // ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions +// GitHub API docs: https://docs.github.com/rest/actions/permissions type ActionsPermissionsRepository struct { Enabled *bool `json:"enabled,omitempty"` AllowedActions *string `json:"allowed_actions,omitempty"` @@ -25,7 +25,9 @@ func (a ActionsPermissionsRepository) String() string { // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -44,7 +46,9 @@ func (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, // EditActionsPermissions sets the permissions policy for repositories and allowed actions in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions func (s *RepositoriesService) EditActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/permissions", owner, repo) req, err := s.client.NewRequest("PUT", u, actionsPermissionsRepository) diff --git a/github/repos_autolinks.go b/github/repos_autolinks.go index 0d2cec618f0..200605aa0b2 100644 --- a/github/repos_autolinks.go +++ b/github/repos_autolinks.go @@ -28,7 +28,9 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) u, err := addOptions(u, opts) @@ -53,7 +55,9 @@ func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo str // AddAutolink creates an autolink reference for a repository. // Users with admin access to the repository can create an autolink. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -72,7 +76,9 @@ func (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo strin // GetAutolink returns a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) @@ -93,7 +99,9 @@ func (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo strin // DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/en/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} func (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/autolinks/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go index 1c3f78abd9b..93eeae09b17 100644 --- a/github/repos_codeowners.go +++ b/github/repos_codeowners.go @@ -36,7 +36,9 @@ type CodeownersError struct { // GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. // -// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-codeowners-errors +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors +// +//meta:operation GET /repos/{owner}/{repo}/codeowners/errors func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) { u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) u, err := addOptions(u, opts) diff --git a/github/repos_collaborators.go b/github/repos_collaborators.go index c2396872f2e..15a4e77a2f1 100644 --- a/github/repos_collaborators.go +++ b/github/repos_collaborators.go @@ -34,7 +34,7 @@ type ListCollaboratorsOptions struct { } // CollaboratorInvitation represents an invitation created when adding a collaborator. -// GitHub API docs: https://docs.github.com/en/rest/repos/collaborators/#response-when-a-new-invitation-is-created +// GitHub API docs: https://docs.github.com/rest/repos/collaborators/#response-when-a-new-invitation-is-created type CollaboratorInvitation struct { ID *int64 `json:"id,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -48,7 +48,9 @@ type CollaboratorInvitation struct { // ListCollaborators lists the GitHub users that have access to the repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#list-repository-collaborators +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators +// +//meta:operation GET /repos/{owner}/{repo}/collaborators func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators", owner, repo) u, err := addOptions(u, opts) @@ -75,7 +77,9 @@ func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo // Note: This will return false if the user is not a collaborator OR the user // is not a GitHub user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +// +//meta:operation GET /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -99,7 +103,9 @@ type RepositoryPermissionLevel struct { // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user +// +//meta:operation GET /repos/{owner}/{repo}/collaborators/{username}/permission func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v/permission", owner, repo, user) req, err := s.client.NewRequest("GET", u, nil) @@ -134,7 +140,9 @@ type RepositoryAddCollaboratorOptions struct { // AddCollaborator sends an invitation to the specified GitHub user // to become a collaborator to the given repo. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +// +//meta:operation PUT /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -154,7 +162,9 @@ func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, // RemoveCollaborator removes the specified GitHub user as collaborator from the given repo. // Note: Does not return error if a valid user that is not a collaborator is removed. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/collaborators#remove-a-repository-collaborator +// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +// +//meta:operation DELETE /repos/{owner}/{repo}/collaborators/{username} func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_comments.go b/github/repos_comments.go index e282374e9e5..766a614cc12 100644 --- a/github/repos_comments.go +++ b/github/repos_comments.go @@ -35,7 +35,9 @@ func (r RepositoryComment) String() string { // ListComments lists all the comments for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments-for-a-repository +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/comments func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments", owner, repo) u, err := addOptions(u, opts) @@ -62,7 +64,9 @@ func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo stri // ListCommitComments lists all the comments for a given commit SHA. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#list-commit-comments +// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) u, err := addOptions(u, opts) @@ -90,7 +94,9 @@ func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, rep // CreateComment creates a comment for the given commit. // Note: GitHub allows for comments to be created for non-existing files and positions. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#create-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment +// +//meta:operation POST /repos/{owner}/{repo}/commits/{commit_sha}/comments func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/comments", owner, repo, sha) req, err := s.client.NewRequest("POST", u, comment) @@ -109,7 +115,9 @@ func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sh // GetComment gets a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#get-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment +// +//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -131,7 +139,9 @@ func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string // UpdateComment updates the body of a single comment. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#update-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment +// +//meta:operation PATCH /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, comment) @@ -150,7 +160,9 @@ func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo str // DeleteComment deletes a single comment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/comments#delete-a-commit-comment +// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +// +//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id} func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_commits.go b/github/repos_commits.go index 90dd6df088d..cca7430cb51 100644 --- a/github/repos_commits.go +++ b/github/repos_commits.go @@ -124,7 +124,9 @@ type BranchCommit struct { // ListCommits lists the commits of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits +// +//meta:operation GET /repos/{owner}/{repo}/commits func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits", owner, repo) u, err := addOptions(u, opts) @@ -148,7 +150,9 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // GetCommit fetches the specified commit, including all details about it. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) u, err := addOptions(u, opts) @@ -172,7 +176,9 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GetCommitRaw fetches the specified commit in raw (diff or patch) format. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) @@ -201,7 +207,9 @@ func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, re // GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#get-a-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref} func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, refURLEscape(ref)) @@ -226,7 +234,9 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// +//meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -257,7 +267,9 @@ func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo st // To compare branches across other repositories in the same network as "repo", // use the format ":branch". // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#compare-two-commits +// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits +// +//meta:operation GET /repos/{owner}/{repo}/compare/{basehead} func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) @@ -290,7 +302,9 @@ func (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo // ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD, // or latest commit for the branch. // -// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-branches-for-head-commit +// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +// +//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head func (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/branches-where-head", owner, repo, sha) diff --git a/github/repos_community_health.go b/github/repos_community_health.go index 750ee158270..54d1b414ec9 100644 --- a/github/repos_community_health.go +++ b/github/repos_community_health.go @@ -43,7 +43,9 @@ type CommunityHealthMetrics struct { // GetCommunityHealthMetrics retrieves all the community health metrics for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/community#get-community-profile-metrics +// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +// +//meta:operation GET /repos/{owner}/{repo}/community/profile func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) { u := fmt.Sprintf("repos/%v/%v/community/profile", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_contents.go b/github/repos_contents.go index a3256ca4679..9539a5c4296 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -4,7 +4,7 @@ // license that can be found in the LICENSE file. // Repository contents API methods. -// GitHub API docs: https://docs.github.com/en/rest/repos/contents/ +// GitHub API docs: https://docs.github.com/rest/repos/contents/ package github @@ -100,7 +100,9 @@ func (r *RepositoryContent) GetContent() (string, error) { // GetReadme gets the Readme file for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-a-repository-readme +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme +// +//meta:operation GET /repos/{owner}/{repo}/readme func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) { u := fmt.Sprintf("repos/%v/%v/readme", owner, repo) u, err := addOptions(u, opts) @@ -132,6 +134,8 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, // code to verify the content is from a successful response. // // GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -168,6 +172,8 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, // code to verify the content is from a successful response. // // GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) @@ -204,7 +210,9 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // Due to an auth vulnerability issue in the GitHub v3 API, ".." is not allowed // to appear anywhere in the "path" or this method will return an error. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content +// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content +// +//meta:operation GET /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { return nil, nil, nil, ErrPathForbidden @@ -244,7 +252,9 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path // CreateFile creates a new file in a repository at the given path and returns // the commit and file metadata. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// +//meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -264,7 +274,9 @@ func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path // UpdateFile updates a file in a repository at the given path and returns the // commit and file metadata. Requires the blob SHA of the file being updated. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents +// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +// +//meta:operation PUT /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("PUT", u, opts) @@ -284,7 +296,9 @@ func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path // DeleteFile deletes a file from a repository and returns the commit. // Requires the blob SHA of the file to be deleted. // -// GitHub API docs: https://docs.github.com/en/rest/repos/contents#delete-a-file +// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file +// +//meta:operation DELETE /repos/{owner}/{repo}/contents/{path} func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, path) req, err := s.client.NewRequest("DELETE", u, opts) @@ -318,6 +332,9 @@ const ( // // GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar // GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip +// +//meta:operation GET /repos/{owner}/{repo}/tarball/{ref} +//meta:operation GET /repos/{owner}/{repo}/zipball/{ref} func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat) if opts != nil && opts.Ref != "" { diff --git a/github/repos_deployment_branch_policies.go b/github/repos_deployment_branch_policies.go index 32bf72ccab5..77ac73e44e1 100644 --- a/github/repos_deployment_branch_policies.go +++ b/github/repos_deployment_branch_policies.go @@ -32,7 +32,9 @@ type DeploymentBranchPolicyRequest struct { // ListDeploymentBranchPolicies lists the deployment branch policies for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#list-deployment-branch-policies +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string) (*DeploymentBranchPolicyResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -52,7 +54,9 @@ func (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, // GetDeploymentBranchPolicy gets a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#get-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -72,7 +76,9 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own // CreateDeploymentBranchPolicy creates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#create-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +// +//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies", owner, repo, environment) @@ -92,7 +98,9 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, // UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#update-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +// +//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) @@ -112,7 +120,9 @@ func (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, // DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +// +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} func (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/environments/%v/deployment-branch-policies/%v", owner, repo, environment, branchPolicyID) diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 36445f895e2..d8c0b63218e 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -63,7 +63,9 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#list-deployments +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments +// +//meta:operation GET /repos/{owner}/{repo}/deployments func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opts) @@ -87,7 +89,9 @@ func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo s // GetDeployment returns a single deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#get-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) @@ -107,7 +111,9 @@ func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo str // CreateDeployment creates a new deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#create-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment +// +//meta:operation POST /repos/{owner}/{repo}/deployments func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) @@ -131,7 +137,9 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo // DeleteDeployment deletes an existing deployment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/deployments#delete-a-deployment +// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +// +//meta:operation DELETE /repos/{owner}/{repo}/deployments/{deployment_id} func (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -175,7 +183,9 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#list-deployment-statuses +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opts) @@ -203,7 +213,9 @@ func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, // GetDeploymentStatus returns a single deployment status of a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#get-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status +// +//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) @@ -227,7 +239,9 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re // CreateDeploymentStatus creates a new status for a deployment. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/statuses#create-a-deployment-status +// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +// +//meta:operation POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) diff --git a/github/repos_environments.go b/github/repos_environments.go index 5598a220020..ed81e3a1f95 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -108,6 +108,8 @@ func (r *RequiredReviewer) UnmarshalJSON(data []byte) error { // ListEnvironments lists all environments for a repository. // // GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments +// +//meta:operation GET /repos/{owner}/{repo}/environments func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +132,9 @@ func (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo // GetEnvironment get a single environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#get-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment +// +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -178,7 +182,7 @@ type CreateUpdateEnvironment struct { } // createUpdateEnvironmentNoEnterprise represents the fields accepted for Pro/Teams private repos. -// Ref: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment +// Ref: https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment // See https://github.com/google/go-github/issues/2602 for more information. type createUpdateEnvironmentNoEnterprise struct { DeploymentBranchPolicy *BranchPolicy `json:"deployment_branch_policy"` @@ -186,7 +190,9 @@ type createUpdateEnvironmentNoEnterprise struct { // CreateUpdateEnvironment create or update a new environment for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +// +//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) @@ -232,7 +238,9 @@ func (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u st // DeleteEnvironment delete an environment from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/deployments/environments#delete-an-environment +// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment +// +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name} func (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/environments/%s", owner, repo, name) diff --git a/github/repos_forks.go b/github/repos_forks.go index f175dfe3b03..60fb49da5ab 100644 --- a/github/repos_forks.go +++ b/github/repos_forks.go @@ -23,7 +23,9 @@ type RepositoryListForksOptions struct { // ListForks lists the forks of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#list-forks +// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks +// +//meta:operation GET /repos/{owner}/{repo}/forks func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) u, err := addOptions(u, opts) @@ -66,7 +68,9 @@ type RepositoryCreateForkOptions struct { // A follow up request, after a delay of a second or so, should result // in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork +// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork +// +//meta:operation POST /repos/{owner}/{repo}/forks func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) { u := fmt.Sprintf("repos/%v/%v/forks", owner, repo) diff --git a/github/repos_hooks.go b/github/repos_hooks.go index 2b379ddf395..8768d603d2b 100644 --- a/github/repos_hooks.go +++ b/github/repos_hooks.go @@ -79,7 +79,9 @@ 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/en/rest/webhooks/repos#create-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#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) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) @@ -106,7 +108,9 @@ 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/en/rest/webhooks/repos#list-repository-webhooks +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#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) { u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) u, err := addOptions(u, opts) @@ -130,7 +134,9 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, // GetHook returns a single specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#get-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#get-a-repository-webhook +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -148,7 +154,9 @@ func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, i // EditHook updates a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#update-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#update-a-repository-webhook +// +//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -166,7 +174,9 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, // DeleteHook deletes a specified Hook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#delete-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#delete-a-repository-webhook +// +//meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id} func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) @@ -178,7 +188,9 @@ 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/en/rest/webhooks/repos#ping-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#ping-a-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -190,7 +202,9 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, // TestHook triggers a test Hook by github. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repos#test-the-push-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repos#test-the-push-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id) req, err := s.client.NewRequest("POST", u, nil) @@ -203,6 +217,8 @@ func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, // Subscribe lets servers register to receive updates when a topic is updated. // // GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// +//meta:operation POST /hub func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("subscribe", owner, repo, event, callback, secret) if err != nil { @@ -215,6 +231,8 @@ func (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, // Unsubscribe lets servers unregister to no longer receive updates when a topic is updated. // // GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub +// +//meta:operation POST /hub func (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) { req, err := s.createWebSubRequest("unsubscribe", owner, repo, event, callback, secret) if err != nil { diff --git a/github/repos_hooks_configuration.go b/github/repos_hooks_configuration.go index 5aadfb645e1..2203d7614f5 100644 --- a/github/repos_hooks_configuration.go +++ b/github/repos_hooks_configuration.go @@ -12,7 +12,9 @@ import ( // GetHookConfiguration returns the configuration for the specified repository webhook. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -31,7 +33,9 @@ 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/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, config) diff --git a/github/repos_hooks_deliveries.go b/github/repos_hooks_deliveries.go index 5f2f8807e4b..6e1fd86f99b 100644 --- a/github/repos_hooks_deliveries.go +++ b/github/repos_hooks_deliveries.go @@ -14,8 +14,8 @@ import ( // HookDelivery represents the data that is received from GitHub's Webhook Delivery API // // GitHub API docs: -// - https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook -// - https://docs.github.com/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook type HookDelivery struct { ID *int64 `json:"id,omitempty"` GUID *string `json:"guid,omitempty"` @@ -63,7 +63,9 @@ func (r HookResponse) String() string { // ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. // -// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#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) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) u, err := addOptions(u, opts) @@ -87,7 +89,9 @@ 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/en/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook +// +//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("GET", u, nil) @@ -106,7 +110,9 @@ 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/en/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// GitHub API docs: https://docs.github.com/rest/webhooks/repo-deliveries#redeliver-a-delivery-for-a-repository-webhook +// +//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v/attempts", owner, repo, hookID, deliveryID) req, err := s.client.NewRequest("POST", u, nil) diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 81956cd49c9..4922e0b298c 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -27,7 +27,9 @@ type RepositoryInvitation struct { // ListInvitations lists all currently-open repository invitations. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +// +//meta:operation GET /repos/{owner}/{repo}/invitations func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations", owner, repo) u, err := addOptions(u, opts) @@ -51,7 +53,9 @@ func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo s // DeleteInvitation deletes a repository invitation. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#delete-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +// +//meta:operation DELETE /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/invitations/%v", owner, repo, invitationID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -68,7 +72,9 @@ func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo // permissions represents the permissions that the associated user will have // on the repository. Possible values are: "read", "write", "admin". // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#update-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +// +//meta:operation PATCH /repos/{owner}/{repo}/invitations/{invitation_id} func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) { opts := &struct { Permissions string `json:"permissions"` diff --git a/github/repos_keys.go b/github/repos_keys.go index c6f0c8b371e..cc86f8bbd09 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -15,6 +15,8 @@ import ( // ListKeys lists the deploy keys for a repository. // // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +// +//meta:operation GET /repos/{owner}/{repo}/keys func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) @@ -39,6 +41,8 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GetKey fetches a single deploy key. // // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key +// +//meta:operation GET /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) @@ -59,6 +63,8 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // CreateKey adds a deploy key for a repository. // // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +// +//meta:operation POST /repos/{owner}/{repo}/keys func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) @@ -79,6 +85,8 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // DeleteKey deletes a deploy key. // // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +// +//meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id} func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) diff --git a/github/repos_lfs.go b/github/repos_lfs.go index fa9af0f1fe8..f0153c08086 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -13,6 +13,8 @@ import ( // EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/lfs func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) @@ -32,6 +34,8 @@ func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) // DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/lfs func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) diff --git a/github/repos_merging.go b/github/repos_merging.go index 66e88452e86..b26e5da1af6 100644 --- a/github/repos_merging.go +++ b/github/repos_merging.go @@ -34,7 +34,9 @@ type RepoMergeUpstreamResult struct { // Merge a branch in the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#merge-a-branch +// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch +// +//meta:operation POST /repos/{owner}/{repo}/merges func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -54,7 +56,9 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, req // MergeUpstream syncs a branch of a forked repository to keep it up-to-date // with the upstream repository. // -// GitHub API docs: https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +// +//meta:operation POST /repos/{owner}/{repo}/merge-upstream func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo) req, err := s.client.NewRequest("POST", u, request) diff --git a/github/repos_pages.go b/github/repos_pages.go index 188d2f9ae39..516cd7ce749 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -104,6 +104,8 @@ type createPagesRequest struct { // EnablePages enables GitHub Pages for the named repo. // // GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site +// +//meta:operation POST /repos/{owner}/{repo}/pages func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -154,6 +156,8 @@ type PagesUpdate struct { // UpdatePages updates GitHub Pages for the named repo. // // GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// +//meta:operation PUT /repos/{owner}/{repo}/pages func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) @@ -173,6 +177,8 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin // DisablePages disables GitHub Pages for the named repo. // // GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site +// +//meta:operation DELETE /repos/{owner}/{repo}/pages func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -189,6 +195,8 @@ func (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo stri // GetPagesInfo fetches information about a GitHub Pages site. // // GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site +// +//meta:operation GET /repos/{owner}/{repo}/pages func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -208,6 +216,8 @@ func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo stri // ListPagesBuilds lists the builds for a GitHub Pages site. // // GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) u, err := addOptions(u, opts) @@ -232,6 +242,8 @@ func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo s // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. // // GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds/latest func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -251,6 +263,8 @@ func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, re // GetPageBuild fetches the specific build information for a GitHub pages site. // // GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build +// +//meta:operation GET /repos/{owner}/{repo}/pages/builds/{build_id} func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -270,6 +284,8 @@ func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo stri // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. // // GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build +// +//meta:operation POST /repos/{owner}/{repo}/pages/builds func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo) req, err := s.client.NewRequest("POST", u, nil) @@ -289,6 +305,8 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPagesHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // // GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages +// +//meta:operation GET /repos/{owner}/{repo}/pages/health func (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pages/health", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_prereceive_hooks.go b/github/repos_prereceive_hooks.go index cd4c81431ec..e8361383f57 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -25,6 +25,8 @@ 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 +// +//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks", owner, repo) u, err := addOptions(u, opts) @@ -52,6 +54,8 @@ 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 +// +//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -74,6 +78,8 @@ 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 +// +//meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("PATCH", u, hook) @@ -96,6 +102,8 @@ 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 +// +//meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/pre-receive-hooks/%d", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_projects.go b/github/repos_projects.go index a3001dee988..9269d4e95c0 100644 --- a/github/repos_projects.go +++ b/github/repos_projects.go @@ -21,7 +21,9 @@ type ProjectListOptions struct { // ListProjects lists the projects for a repo. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-repository-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects +// +//meta:operation GET /repos/{owner}/{repo}/projects func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) u, err := addOptions(u, opts) @@ -48,7 +50,9 @@ func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo stri // CreateProject creates a GitHub Project for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-repository-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project +// +//meta:operation POST /repos/{owner}/{repo}/projects func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/repos_releases.go b/github/repos_releases.go index e2aa845af2f..7231db6d9ea 100644 --- a/github/repos_releases.go +++ b/github/repos_releases.go @@ -87,7 +87,9 @@ func (r ReleaseAsset) String() string { // ListReleases lists the releases for a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#list-releases +// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases +// +//meta:operation GET /repos/{owner}/{repo}/releases func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) u, err := addOptions(u, opts) @@ -110,7 +112,9 @@ func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo stri // GetRelease fetches a single release. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) return s.getSingleRelease(ctx, u) @@ -118,7 +122,9 @@ func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string // GetLatestRelease fetches the latest published release for the repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-the-latest-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/latest func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo) return s.getSingleRelease(ctx, u) @@ -126,7 +132,9 @@ func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo // GetReleaseByTag fetches a release with the specified tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name +// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name +// +//meta:operation GET /repos/{owner}/{repo}/releases/tags/{tag} func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/tags/%s", owner, repo, tag) return s.getSingleRelease(ctx, u) @@ -134,7 +142,9 @@ func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, // GenerateReleaseNotes generates the release notes for the given tag. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases/generate-notes func (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/generate-notes", owner, repo) req, err := s.client.NewRequest("POST", u, opts) @@ -188,7 +198,9 @@ type repositoryReleaseRequest struct { // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#create-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release +// +//meta:operation POST /repos/{owner}/{repo}/releases func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) @@ -222,7 +234,9 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // Note that only a subset of the release fields are used. // See RepositoryRelease for more information. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#update-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release +// +//meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -252,7 +266,9 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin // DeleteRelease delete a single release from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/releases#delete-a-release +// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) @@ -265,7 +281,9 @@ func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo str // ListReleaseAssets lists the release's assets. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#list-release-assets +// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) @@ -288,7 +306,9 @@ func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo // GetReleaseAsset fetches a single release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// +//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -317,7 +337,9 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // exist, but it's possible to pass any http.Client. If nil is passed the // redirectURL will be returned instead. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#get-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset +// +//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -379,7 +401,9 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f // EditReleaseAsset edits a repository release asset. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#update-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset +// +//meta:operation PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -398,7 +422,9 @@ func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo // DeleteReleaseAsset delete a single release asset from a repository. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#delete-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/assets/%d", owner, repo, id) @@ -412,7 +438,9 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // UploadReleaseAsset creates an asset by uploading a file into a release repository. // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly. // -// GitHub API docs: https://docs.github.com/en/rest/releases/assets#upload-a-release-asset +// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset +// +//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) diff --git a/github/repos_rules.go b/github/repos_rules.go index 7f964fe6655..78778b5a59c 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -349,7 +349,9 @@ type Ruleset struct { // GetRulesForBranch gets all the rules that apply to the specified branch. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-rules-for-a-branch +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) @@ -370,7 +372,9 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo // GetAllRulesets gets all the rules that apply to the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-all-repository-rulesets +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// +//meta:operation GET /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) @@ -390,7 +394,9 @@ func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo st // CreateRuleset creates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#create-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// +//meta:operation POST /repos/{owner}/{repo}/rulesets func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) @@ -411,7 +417,9 @@ func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo str // GetRuleset gets a ruleset for the specified repository. // If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#get-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// +//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) @@ -431,7 +439,9 @@ func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string // UpdateRuleset updates a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#update-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) @@ -451,7 +461,9 @@ func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo str // DeleteRuleset deletes a ruleset for the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/rules#delete-a-repository-ruleset +// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// +//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) diff --git a/github/repos_stats.go b/github/repos_stats.go index 3df0a8f6deb..898693f7864 100644 --- a/github/repos_stats.go +++ b/github/repos_stats.go @@ -45,7 +45,9 @@ func (w WeeklyStats) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-all-contributor-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/contributors func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/contributors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -84,7 +86,9 @@ func (w WeeklyCommitActivity) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-last-year-of-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/commit_activity func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/commit_activity", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -111,7 +115,9 @@ func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, rep // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-activity +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +// +//meta:operation GET /repos/{owner}/{repo}/stats/code_frequency func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/code_frequency", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -167,7 +173,9 @@ func (r RepositoryParticipation) String() string { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-weekly-commit-count +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count +// +//meta:operation GET /repos/{owner}/{repo}/stats/participation func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/participation", owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -200,7 +208,9 @@ type PunchCard struct { // it is now computing the requested statistics. A follow up request, after a // delay of a second or so, should result in a successful request. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +// +//meta:operation GET /repos/{owner}/{repo}/stats/punch_card func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) { u := fmt.Sprintf("repos/%v/%v/stats/punch_card", owner, repo) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/repos_statuses.go b/github/repos_statuses.go index ea3d166c753..e7b03047521 100644 --- a/github/repos_statuses.go +++ b/github/repos_statuses.go @@ -45,7 +45,9 @@ func (r RepoStatus) String() string { // ListStatuses lists the statuses of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#list-commit-statuses-for-a-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) @@ -70,7 +72,9 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status +// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status +// +//meta:operation POST /repos/{owner}/{repo}/statuses/{sha} func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("POST", u, status) @@ -109,7 +113,9 @@ func (s CombinedStatus) String() string { // GetCombinedStatus returns the combined status of a repository at the specified // reference. ref can be a SHA, a branch name, or a tag name. // -// GitHub API docs: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +// +//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/status func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/status", owner, repo, refURLEscape(ref)) u, err := addOptions(u, opts) diff --git a/github/repos_tags.go b/github/repos_tags.go index ff46d90c731..93164dd1b8e 100644 --- a/github/repos_tags.go +++ b/github/repos_tags.go @@ -24,7 +24,9 @@ type tagProtectionRequest struct { // ListTagProtection lists tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) @@ -44,7 +46,9 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // CreateTagProtection creates the tag protection of the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) r := &tagProtectionRequest{Pattern: pattern} @@ -64,7 +68,9 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // DeleteTagProtection deletes a tag protection from the specified repository. // -// GitHub API docs: https://docs.github.com/en/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// +//meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/repos_traffic.go b/github/repos_traffic.go index bf093c03ea7..ae2f1a86bd7 100644 --- a/github/repos_traffic.go +++ b/github/repos_traffic.go @@ -54,7 +54,9 @@ type TrafficBreakdownOptions struct { // ListTrafficReferrers list the top 10 referrers over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-sources +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +// +//meta:operation GET /repos/{owner}/{repo}/traffic/popular/referrers func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/referrers", owner, repo) @@ -74,7 +76,9 @@ func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, r // ListTrafficPaths list the top 10 popular content over the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-top-referral-paths +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +// +//meta:operation GET /repos/{owner}/{repo}/traffic/popular/paths func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/popular/paths", owner, repo) @@ -94,7 +98,9 @@ func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo // ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-page-views +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views +// +//meta:operation GET /repos/{owner}/{repo}/traffic/views func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/views", owner, repo) u, err := addOptions(u, opts) @@ -118,7 +124,9 @@ func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. // -// GitHub API docs: https://docs.github.com/en/rest/metrics/traffic#get-repository-clones +// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones +// +//meta:operation GET /repos/{owner}/{repo}/traffic/clones func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) { u := fmt.Sprintf("repos/%v/%v/traffic/clones", owner, repo) u, err := addOptions(u, opts) diff --git a/github/scim.go b/github/scim.go index 9e073428cfa..02136d7ef91 100644 --- a/github/scim.go +++ b/github/scim.go @@ -14,12 +14,12 @@ import ( // SCIMService provides access to SCIM related functions in the // GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/scim +// GitHub API docs: https://docs.github.com/rest/scim type SCIMService service // SCIMUserAttributes represents supported SCIM User attributes. // -// GitHub API docs: https://docs.github.com/en/rest/scim#supported-scim-user-attributes +// GitHub API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes type SCIMUserAttributes struct { UserName string `json:"userName"` // Configured by the admin. Could be an email, login, or username. (Required.) Name SCIMUserName `json:"name"` // (Required.) @@ -67,7 +67,7 @@ type SCIMProvisionedIdentities struct { // ListSCIMProvisionedIdentitiesOptions represents options for ListSCIMProvisionedIdentities. // -// Github API docs: https://docs.github.com/en/rest/scim#list-scim-provisioned-identities--parameters +// GitHub API docs: https://docs.github.com/rest/scim#list-scim-provisioned-identities--parameters type ListSCIMProvisionedIdentitiesOptions struct { StartIndex *int `url:"startIndex,omitempty"` // Used for pagination: the index of the first result to return. (Optional.) Count *int `url:"count,omitempty"` // Used for pagination: the number of results to return. (Optional.) @@ -82,6 +82,8 @@ type ListSCIMProvisionedIdentitiesOptions struct { // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities +// +//meta:operation GET /scim/v2/organizations/{org}/Users func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -106,6 +108,8 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user +// +//meta:operation POST /scim/v2/organizations/{org}/Users func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) u, err := addOptions(u, opts) @@ -124,6 +128,8 @@ func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user +// +//meta:operation GET /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("GET", u, nil) @@ -143,6 +149,8 @@ func (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, s // UpdateProvisionedOrgMembership updates a provisioned organization membership. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership +// +//meta:operation PUT /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -160,7 +168,7 @@ func (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, s // UpdateAttributeForSCIMUserOptions represents options for UpdateAttributeForSCIMUser. // -// GitHub API docs: https://docs.github.com/en/rest/scim#update-an-attribute-for-a-scim-user--parameters +// GitHub API docs: https://docs.github.com/rest/scim#update-an-attribute-for-a-scim-user--parameters type UpdateAttributeForSCIMUserOptions struct { Schemas []string `json:"schemas,omitempty"` // (Optional.) Operations UpdateAttributeForSCIMUserOperations `json:"operations"` // Set of operations to be performed. (Required.) @@ -176,6 +184,8 @@ type UpdateAttributeForSCIMUserOperations struct { // UpdateAttributeForSCIMUser updates an attribute for an SCIM user. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user +// +//meta:operation PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) u, err := addOptions(u, opts) @@ -194,6 +204,8 @@ func (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimU // DeleteSCIMUserFromOrg deletes SCIM user from an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization +// +//meta:operation DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users/%v", org, scimUserID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/search.go b/github/search.go index 18e98c27de1..71efe87a039 100644 --- a/github/search.go +++ b/github/search.go @@ -32,7 +32,7 @@ import ( // For example, querying with "language:c++" and "leveldb", then query should be // "language:c++ leveldb" but not "language:c+++leveldb". // -// GitHub API docs: https://docs.github.com/en/rest/search/ +// GitHub API docs: https://docs.github.com/rest/search/ type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. @@ -73,6 +73,8 @@ type RepositoriesSearchResult struct { // Repositories searches repositories via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-repositories +// +//meta:operation GET /search/repositories func (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) { result := new(RepositoriesSearchResult) resp, err := s.search(ctx, "repositories", &searchParameters{Query: query}, opts, result) @@ -104,10 +106,12 @@ type TopicResult struct { } // Topics finds topics via various criteria. Results are sorted by best match. -// Please see https://help.github.com/en/articles/searching-topics for more +// Please see https://help.github.com/articles/searching-topics for more // information about search qualifiers. // // GitHub API docs: https://docs.github.com/rest/search/search#search-topics +// +//meta:operation GET /search/topics func (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) { result := new(TopicsSearchResult) resp, err := s.search(ctx, "topics", &searchParameters{Query: query}, opts, result) @@ -143,6 +147,8 @@ type CommitResult struct { // Commits searches commits via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-commits +// +//meta:operation GET /search/commits func (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) { result := new(CommitsSearchResult) resp, err := s.search(ctx, "commits", &searchParameters{Query: query}, opts, result) @@ -163,6 +169,8 @@ type IssuesSearchResult struct { // Issues searches issues via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +// +//meta:operation GET /search/issues func (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) { result := new(IssuesSearchResult) resp, err := s.search(ctx, "issues", &searchParameters{Query: query}, opts, result) @@ -183,6 +191,8 @@ type UsersSearchResult struct { // Users searches users via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-users +// +//meta:operation GET /search/users func (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) { result := new(UsersSearchResult) resp, err := s.search(ctx, "users", &searchParameters{Query: query}, opts, result) @@ -236,6 +246,8 @@ func (c CodeResult) String() string { // Code searches code via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-code +// +//meta:operation GET /search/code func (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) { result := new(CodeSearchResult) resp, err := s.search(ctx, "code", &searchParameters{Query: query}, opts, result) @@ -271,6 +283,8 @@ func (l LabelResult) String() string { // Labels searches labels in the repository with ID repoID via various criteria. // // GitHub API docs: https://docs.github.com/rest/search/search#search-labels +// +//meta:operation GET /search/labels func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) { result := new(LabelsSearchResult) resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opts, result) @@ -321,7 +335,7 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) } - // https://docs.github.com/en/rest/search#search-repositories + // https://docs.github.com/rest/search#search-repositories // Accept header defaults to "application/vnd.github.v3+json" // We change it here to fetch back text-match metadata if opts != nil && opts.TextMatch { diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 4aab8737871..0fc86082899 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -72,9 +72,9 @@ type SecretScanningAlertListOptions struct { // List options can vary on the Enterprise type. // On Enterprise Cloud, Secret Scan alerts support requesting by page number // along with providing a cursor for an "after" param. - // See: https://docs.github.com/en/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization // Whereas on Enterprise Server, pagination is by index. - // See: https://docs.github.com/en/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + // See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization ListOptions } @@ -96,6 +96,8 @@ type SecretScanningAlertUpdateOptions struct { // security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise) u, err := addOptions(u, opts) @@ -123,6 +125,8 @@ func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, ent // the repo scope or security_events scope. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +// +//meta:operation GET /orgs/{org}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("orgs/%v/secret-scanning/alerts", org) u, err := addOptions(u, opts) @@ -150,6 +154,8 @@ func (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string // the repo scope or security_events scope. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -177,6 +183,8 @@ func (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, re // the repo scope or security_events scope. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -200,6 +208,8 @@ func (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string // the repo scope or security_events scope. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +// +//meta:operation PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v", owner, repo, number) @@ -223,6 +233,8 @@ func (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo str // the repo scope or security_events scope. // // GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +// +//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations func (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) { u := fmt.Sprintf("repos/%v/%v/secret-scanning/alerts/%v/locations", owner, repo, number) u, err := addOptions(u, opts) diff --git a/github/security_advisories.go b/github/security_advisories.go index 379d9ef70f8..66e7dba15ac 100644 --- a/github/security_advisories.go +++ b/github/security_advisories.go @@ -50,7 +50,9 @@ type ListRepositorySecurityAdvisoriesOptions struct { // RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. // The ghsaID is the GitHub Security Advisory identifier of the advisory. // -// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +// +//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) @@ -73,7 +75,9 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories?apiVersion=2022-11-28#list-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 +// +//meta:operation GET /orgs/{org}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { url := fmt.Sprintf("orgs/%v/security-advisories", org) url, err := addOptions(url, opt) @@ -98,6 +102,8 @@ func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx c // ListRepositorySecurityAdvisories lists the security advisories in a repository. // // GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories +// +//meta:operation GET /repos/{owner}/{repo}/security-advisories func (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opt *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) { url := fmt.Sprintf("repos/%v/%v/security-advisories", owner, repo) url, err := addOptions(url, opt) diff --git a/github/teams.go b/github/teams.go index b6ab42771a7..fd22b792a66 100644 --- a/github/teams.go +++ b/github/teams.go @@ -15,7 +15,7 @@ import ( // TeamsService provides access to the team-related functions // in the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/teams/ +// GitHub API docs: https://docs.github.com/rest/teams/ type TeamsService service // Team represents a team within a GitHub organization. Teams are used to @@ -81,7 +81,9 @@ func (i Invitation) String() string { // ListTeams lists all of the teams for an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams +// +//meta:operation GET /orgs/{org}/teams func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) u, err := addOptions(u, opts) @@ -105,7 +107,9 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// +//meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -124,7 +128,9 @@ func (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*T // GetTeamBySlug fetches a team, given a specified organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#get-a-team-by-name +// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name +// +//meta:operation GET /orgs/{org}/teams/{team_slug} func (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -174,7 +180,9 @@ func (s NewTeam) String() string { // CreateTeam creates a new team within an organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#create-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team +// +//meta:operation POST /orgs/{org}/teams func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams", org) req, err := s.client.NewRequest("POST", u, team) @@ -220,7 +228,9 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) @@ -247,7 +257,9 @@ func (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, te // EditTeamBySlug edits a team, given an organization name, by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#update-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug} func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) @@ -274,7 +286,9 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v", orgID, teamID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -287,7 +301,9 @@ func (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) // DeleteTeamBySlug deletes a team reference by slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#delete-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug} func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v", org, slug) req, err := s.client.NewRequest("DELETE", u, nil) @@ -300,7 +316,9 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/teams", orgID, teamID) u, err := addOptions(u, opts) @@ -324,7 +342,9 @@ func (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, team // ListChildTeamsByParentSlug lists child teams for a parent team given parent slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-child-teams +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/teams func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/teams", org, slug) u, err := addOptions(u, opts) @@ -348,7 +368,9 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos", orgID, teamID) u, err := addOptions(u, opts) @@ -376,7 +398,9 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 // ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-repositories +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos", org, slug) u, err := addOptions(u, opts) @@ -406,7 +430,9 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -430,7 +456,9 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("GET", u, nil) @@ -469,7 +497,9 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -484,7 +514,9 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("PUT", u, opts) @@ -499,7 +531,9 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -514,7 +548,9 @@ func (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int // team given the team slug. Note that this does not delete the repository, it // just removes it from the team. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-repository-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo) req, err := s.client.NewRequest("DELETE", u, nil) @@ -526,7 +562,10 @@ func (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owne } // ListUserTeams lists a user's teams -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user +// +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +// +//meta:operation GET /user/teams func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) { u := "user/teams" u, err := addOptions(u, opts) @@ -550,7 +589,9 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) @@ -574,7 +615,9 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // ListTeamProjectsBySlug lists the organization projects for a team given the team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#list-team-projects +// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) @@ -599,7 +642,9 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -623,7 +668,9 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin // permissions for an organization project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-project +// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) @@ -660,7 +707,9 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -679,7 +728,9 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#add-or-update-team-project-permissions +// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("PUT", u, opts) @@ -701,7 +752,9 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -723,7 +776,9 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, // or project. // Note: This endpoint removes the project from the team, but does not delete it. // -// GitHub API docs: https://docs.github.com/en/rest/teams/teams#remove-a-project-from-a-team +// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("DELETE", u, nil) @@ -753,6 +808,8 @@ type IDPGroup struct { // ListIDPGroupsInOrganization lists IDP groups available in an organization. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization +// +//meta:operation GET /orgs/{org}/team-sync/groups func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) @@ -778,6 +835,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // given organization and team IDs. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -799,6 +858,8 @@ func (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, team // given organization name and team slug. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -820,6 +881,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // between a team and an IDP group given organization and team IDs. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/team-sync/group-mappings", orgID, teamID) @@ -841,6 +904,8 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context // between a team and an IDP group given organization name and team slug. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/team-sync/group-mappings", org, slug) @@ -888,7 +953,9 @@ type ExternalGroupList struct { // GetExternalGroup fetches an external group. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group +// +//meta:operation GET /orgs/{org}/external-group/{group_id} func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) req, err := s.client.NewRequest("GET", u, nil) @@ -915,7 +982,9 @@ type ListExternalGroupsOptions struct { // ListExternalGroups lists external groups in an organization on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-in-an-organization +// +//meta:operation GET /orgs/{org}/external-groups func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/external-groups", org) u, err := addOptions(u, opts) @@ -939,7 +1008,9 @@ func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts // ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -959,7 +1030,9 @@ func (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, // UpdateConnectedExternalGroup updates the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) @@ -979,7 +1052,9 @@ func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, sl // RemoveConnectedExternalGroup removes the connection between an external group and a team. // -// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/external-groups func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) diff --git a/github/teams_discussion_comments.go b/github/teams_discussion_comments.go index f3a1cc4dc00..ad3818c13fb 100644 --- a/github/teams_discussion_comments.go +++ b/github/teams_discussion_comments.go @@ -43,7 +43,9 @@ type DiscussionCommentListOptions struct { // ListCommentsByID lists all comments on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) u, err := addOptions(u, options) @@ -68,7 +70,9 @@ func (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64 // ListCommentsBySlug lists all comments on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#list-discussion-comments +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) u, err := addOptions(u, options) @@ -93,7 +97,9 @@ func (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, // GetCommentByID gets a specific comment on a team discussion by team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -113,7 +119,9 @@ func (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, // GetCommentBySlug gets a specific comment on a team discussion by team slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#get-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) @@ -134,7 +142,9 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // CreateCommentByID creates a new comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -154,7 +164,9 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // CreateCommentBySlug creates a new comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#create-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) req, err := s.client.NewRequest("POST", u, comment) @@ -175,7 +187,9 @@ func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -196,7 +210,9 @@ func (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, // Authenticated user must grant write:discussion scope. // User is allowed to edit body of a comment only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#update-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("PATCH", u, comment) @@ -216,7 +232,9 @@ func (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, // DeleteCommentByID deletes a comment on a team discussion by team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments/%v", orgID, teamID, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -230,7 +248,9 @@ func (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int6 // DeleteCommentBySlug deletes a comment on a team discussion by team slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussion-comments#delete-a-discussion-comment +// GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} func (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments/%v", org, slug, discussionNumber, commentNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_discussions.go b/github/teams_discussions.go index 69a3ebd51ff..ee78c032a61 100644 --- a/github/teams_discussions.go +++ b/github/teams_discussions.go @@ -49,7 +49,9 @@ type DiscussionListOptions struct { // ListDiscussionsByID lists all discussions on team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) u, err := addOptions(u, opts) @@ -74,7 +76,9 @@ func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID in // ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#list-discussions +// GitHub API docs: https://docs.github.com/rest/teams/discussions#list-discussions +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) u, err := addOptions(u, opts) @@ -99,7 +103,9 @@ func (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug stri // GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -119,7 +125,9 @@ func (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int6 // GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug. // Authenticated user must grant read:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#get-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#get-a-discussion +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("GET", u, nil) @@ -139,7 +147,9 @@ func (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string // CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions", orgID, teamID) req, err := s.client.NewRequest("POST", u, discussion) @@ -159,7 +169,9 @@ func (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID i // CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#create-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#create-a-discussion +// +//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions", org, slug) req, err := s.client.NewRequest("POST", u, discussion) @@ -180,7 +192,9 @@ func (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug str // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -201,7 +215,9 @@ func (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int // Authenticated user must grant write:discussion scope. // User is allowed to change Title and Body of a discussion only. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#update-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#update-a-discussion +// +//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("PATCH", u, discussion) @@ -221,7 +237,9 @@ func (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug strin // DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) @@ -235,7 +253,9 @@ func (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID i // DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug. // Authenticated user must grant write:discussion scope. // -// GitHub API docs: https://docs.github.com/en/rest/teams/discussions#delete-a-discussion +// GitHub API docs: https://docs.github.com/rest/teams/discussions#delete-a-discussion +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} func (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v", org, slug, discussionNumber) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/teams_members.go b/github/teams_members.go index 58cb79744e1..059d993a3e6 100644 --- a/github/teams_members.go +++ b/github/teams_members.go @@ -23,7 +23,9 @@ type TeamListTeamMembersOptions struct { // ListTeamMembersByID lists all of the users who are members of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/members", orgID, teamID) u, err := addOptions(u, opts) @@ -48,7 +50,9 @@ func (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID in // ListTeamMembersBySlug lists all of the users who are members of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/members", org, slug) u, err := addOptions(u, opts) @@ -73,7 +77,9 @@ func (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug stri // GetTeamMembershipByID returns the membership status for a user in a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-team-members +// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/members func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("GET", u, nil) @@ -93,7 +99,9 @@ func (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID // GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#get-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("GET", u, nil) @@ -127,7 +135,9 @@ type TeamAddTeamMembershipOptions struct { // AddTeamMembershipByID adds or invites a user to a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -147,7 +157,9 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID // AddTeamMembershipBySlug adds or invites a user to a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#add-or-update-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +// +//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("PUT", u, opts) @@ -167,7 +179,9 @@ func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, u // RemoveTeamMembershipByID removes a user from a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -181,7 +195,9 @@ func (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, team // RemoveTeamMembershipBySlug removes a user from a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#remove-team-membership-for-a-user +// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +// +//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user) req, err := s.client.NewRequest("DELETE", u, nil) @@ -195,7 +211,9 @@ func (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug // ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified // organization ID, by team ID. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/invitations", orgID, teamID) u, err := addOptions(u, opts) @@ -220,7 +238,9 @@ func (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID // ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified // organization name, by team slug. // -// GitHub API docs: https://docs.github.com/en/rest/teams/members#list-pending-team-invitations +// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations +// +//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations func (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/invitations", org, slug) u, err := addOptions(u, opts) diff --git a/github/users.go b/github/users.go index e2f4d44ca51..51b2b2193bc 100644 --- a/github/users.go +++ b/github/users.go @@ -13,7 +13,7 @@ import ( // UsersService handles communication with the user related // methods of the GitHub API. // -// GitHub API docs: https://docs.github.com/en/rest/users/ +// GitHub API docs: https://docs.github.com/rest/users/ type UsersService service // User represents a GitHub user. @@ -63,7 +63,7 @@ type User struct { SubscriptionsURL *string `json:"subscriptions_url,omitempty"` // TextMatches is only populated from search results that request text matches - // See: search.go and https://docs.github.com/en/rest/search/#text-match-metadata + // See: search.go and https://docs.github.com/rest/search/#text-match-metadata TextMatches []*TextMatch `json:"text_matches,omitempty"` // Permissions and RoleName identify the permissions and role that a user has on a given @@ -79,8 +79,11 @@ func (u User) String() string { // Get fetches a user. Passing the empty string will fetch the authenticated // user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user +// +//meta:operation GET /user +//meta:operation GET /users/{username} func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) { var u string if user != "" { @@ -105,6 +108,8 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // // Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". +// +//meta:operation GET /user/{user_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%d", id) req, err := s.client.NewRequest("GET", u, nil) @@ -123,7 +128,9 @@ func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, // Edit the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#update-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user +// +//meta:operation PATCH /user func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) { u := "user" req, err := s.client.NewRequest("PATCH", u, user) @@ -165,7 +172,9 @@ type UserContext struct { // GetHovercard fetches contextual information about user. It requires authentication // via Basic Auth or via OAuth with the repo scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#get-contextual-information-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +// +//meta:operation GET /users/{username}/hovercard func (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) { u := fmt.Sprintf("users/%v/hovercard", user) u, err := addOptions(u, opts) @@ -203,7 +212,9 @@ type UserListOptions struct { // // To paginate through all users, populate 'Since' with the ID of the last user. // -// GitHub API docs: https://docs.github.com/en/rest/users/users#list-users +// GitHub API docs: https://docs.github.com/rest/users/users#list-users +// +//meta:operation GET /users func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) { u, err := addOptions("users", opts) if err != nil { @@ -227,7 +238,9 @@ func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*U // ListInvitations lists all currently-open repository invitations for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +// +//meta:operation GET /user/repository_invitations func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) { u, err := addOptions("user/repository_invitations", opts) if err != nil { @@ -251,7 +264,9 @@ func (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ( // AcceptInvitation accepts the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#accept-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +// +//meta:operation PATCH /user/repository_invitations/{invitation_id} func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("PATCH", u, nil) @@ -265,7 +280,9 @@ func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) // DeclineInvitation declines the currently-open repository invitation for the // authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/collaborators/invitations#decline-a-repository-invitation +// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +// +//meta:operation DELETE /user/repository_invitations/{invitation_id} func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) { u := fmt.Sprintf("user/repository_invitations/%v", invitationID) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_administration.go b/github/users_administration.go index f9299c7e653..02cb894bc3b 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -13,6 +13,8 @@ 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 +// +//meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -27,6 +29,8 @@ 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 +// +//meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/site_admin", user) @@ -46,6 +50,8 @@ 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 +// +//meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) @@ -60,6 +66,8 @@ 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 +// +//meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("users/%v/suspended", user) diff --git a/github/users_blocking.go b/github/users_blocking.go index 3d38d947898..3f2af38f6c9 100644 --- a/github/users_blocking.go +++ b/github/users_blocking.go @@ -12,7 +12,9 @@ import ( // ListBlockedUsers lists all the blocked users by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +// +//meta:operation GET /user/blocks func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) { u := "user/blocks" u, err := addOptions(u, opts) @@ -39,7 +41,9 @@ func (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) // IsBlocked reports whether specified user is blocked by the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +// +//meta:operation GET /user/blocks/{username} func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -58,7 +62,9 @@ func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Respo // BlockUser blocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#block-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user +// +//meta:operation PUT /user/blocks/{username} func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) @@ -75,7 +81,9 @@ func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, e // UnblockUser unblocks specified user for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/blocking#unblock-a-user +// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user +// +//meta:operation DELETE /user/blocks/{username} func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/blocks/%v", user) diff --git a/github/users_emails.go b/github/users_emails.go index 67bd210e8d5..8386de250b2 100644 --- a/github/users_emails.go +++ b/github/users_emails.go @@ -17,7 +17,9 @@ type UserEmail struct { // ListEmails lists all email addresses for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +// +//meta:operation GET /user/emails func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) { u := "user/emails" u, err := addOptions(u, opts) @@ -41,7 +43,9 @@ func (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*Us // AddEmails adds email addresses of the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#add-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +// +//meta:operation POST /user/emails func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) { u := "user/emails" req, err := s.client.NewRequest("POST", u, emails) @@ -60,7 +64,9 @@ func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserE // DeleteEmails deletes email addresses from authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +// +//meta:operation DELETE /user/emails func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) { u := "user/emails" req, err := s.client.NewRequest("DELETE", u, emails) @@ -74,7 +80,9 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp // SetEmailVisibility sets the visibility for the primary email address of the authenticated user. // `visibility` can be "private" or "public". // -// GitHub API docs: https://docs.github.com/en/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +// +//meta:operation PATCH /user/email/visibility func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" diff --git a/github/users_followers.go b/github/users_followers.go index 1266e0e9ee3..ec6f531eaa4 100644 --- a/github/users_followers.go +++ b/github/users_followers.go @@ -13,8 +13,11 @@ import ( // ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user +// +//meta:operation GET /user/followers +//meta:operation GET /users/{username}/followers func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -44,8 +47,11 @@ func (s *UsersService) ListFollowers(ctx context.Context, user string, opts *Lis // ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-the-authenticated-user-follows -// GitHub API docs: https://docs.github.com/en/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows +// +//meta:operation GET /user/following +//meta:operation GET /users/{username}/following func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) { var u string if user != "" { @@ -75,8 +81,11 @@ func (s *UsersService) ListFollowing(ctx context.Context, user string, opts *Lis // IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/followers#check-if-a-user-follows-another-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +// +//meta:operation GET /user/following/{username} +//meta:operation GET /users/{username}/following/{target_user} func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) { var u string if user != "" { @@ -97,7 +106,9 @@ func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bo // Follow will cause the authenticated user to follow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#follow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user +// +//meta:operation PUT /user/following/{username} func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("PUT", u, nil) @@ -110,7 +121,9 @@ func (s *UsersService) Follow(ctx context.Context, user string) (*Response, erro // Unfollow will cause the authenticated user to unfollow the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/users/followers#unfollow-a-user +// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user +// +//meta:operation DELETE /user/following/{username} func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) { u := fmt.Sprintf("user/following/%v", user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_gpg_keys.go b/github/users_gpg_keys.go index 8b401b83f29..de7caaf1bd0 100644 --- a/github/users_gpg_keys.go +++ b/github/users_gpg_keys.go @@ -44,8 +44,11 @@ type GPGEmail struct { // string will fetch keys for the authenticated user. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +// +//meta:operation GET /user/gpg_keys +//meta:operation GET /users/{username}/gpg_keys func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) { var u string if user != "" { @@ -75,7 +78,9 @@ func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListO // GetGPGKey gets extended details for a single GPG key. It requires authentication // via Basic Auth or via OAuth with at least read:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +// +//meta:operation GET /user/gpg_keys/{gpg_key_id} func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("GET", u, nil) @@ -96,6 +101,8 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo // or OAuth with at least write:gpg_key scope. // // GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +// +//meta:operation POST /user/gpg_keys func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) { gpgKey := &struct { ArmoredPublicKey string `json:"armored_public_key"` @@ -117,7 +124,9 @@ func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or // via OAuth with at least admin:gpg_key scope. // -// GitHub API docs: https://docs.github.com/en/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +// +//meta:operation DELETE /user/gpg_keys/{gpg_key_id} func (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/gpg_keys/%v", id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/github/users_keys.go b/github/users_keys.go index b49b8e4b4ef..4d42986ed2b 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -30,8 +30,11 @@ func (k Key) String() string { // ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +// +//meta:operation GET /user/keys +//meta:operation GET /users/{username}/keys func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) { var u string if user != "" { @@ -60,7 +63,9 @@ func (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOpti // GetKey fetches a single public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation GET /user/keys/{key_id} func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) { u := fmt.Sprintf("user/keys/%v", id) @@ -80,7 +85,9 @@ func (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, e // CreateKey adds a public key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation POST /user/keys func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) { u := "user/keys" @@ -100,7 +107,9 @@ func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response // DeleteKey deletes a public key. // -// GitHub API docs: https://docs.github.com/en/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +// +//meta:operation DELETE /user/keys/{key_id} func (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/keys/%v", id) diff --git a/github/users_packages.go b/github/users_packages.go index b77eb2f37ee..ef50e1daf24 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -15,6 +15,9 @@ import ( // // GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +// +//meta:operation GET /user/packages +//meta:operation GET /users/{username}/packages func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { @@ -46,6 +49,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name} +//meta:operation GET /users/{username}/packages/{package_type}/{package_name} func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { @@ -73,6 +79,9 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +// +//meta:operation DELETE /user/packages/{package_type}/{package_name} +//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name} func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -94,6 +103,9 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +// +//meta:operation POST /user/packages/{package_type}/{package_name}/restore +//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/restore func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) { var u string if user != "" { @@ -115,6 +127,9 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // // GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name}/versions +//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { @@ -146,6 +161,9 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user // GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +// +//meta:operation GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} +//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) { var u string if user != "" { @@ -173,6 +191,9 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user // GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +// +//meta:operation DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} +//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { @@ -194,6 +215,9 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user // GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +// +//meta:operation POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore +//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore func (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) { var u string if user != "" { diff --git a/github/users_projects.go b/github/users_projects.go index 0cbd61f923c..0ab57e5c23c 100644 --- a/github/users_projects.go +++ b/github/users_projects.go @@ -12,7 +12,9 @@ import ( // ListProjects lists the projects for the specified user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#list-user-projects +// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects +// +//meta:operation GET /users/{username}/projects func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { u := fmt.Sprintf("users/%v/projects", user) u, err := addOptions(u, opts) @@ -47,7 +49,9 @@ type CreateUserProjectOptions struct { // CreateProject creates a GitHub Project for the current user. // -// GitHub API docs: https://docs.github.com/en/rest/projects/projects#create-a-user-project +// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project +// +//meta:operation POST /user/projects func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { u := "user/projects" req, err := s.client.NewRequest("POST", u, opts) diff --git a/github/users_ssh_signing_keys.go b/github/users_ssh_signing_keys.go index 567623f8875..09491a91d37 100644 --- a/github/users_ssh_signing_keys.go +++ b/github/users_ssh_signing_keys.go @@ -25,8 +25,11 @@ func (k SSHSigningKey) String() string { // ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty // username string will fetch SSH signing keys for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +// +//meta:operation GET /user/ssh_signing_keys +//meta:operation GET /users/{username}/ssh_signing_keys func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) { var u string if user != "" { @@ -55,7 +58,9 @@ func (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts // GetSSHSigningKey fetches a single SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +// +//meta:operation GET /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) @@ -75,7 +80,9 @@ func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSign // CreateSSHSigningKey adds a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +// +//meta:operation POST /user/ssh_signing_keys func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) { u := "user/ssh_signing_keys" @@ -95,7 +102,9 @@ func (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHS // DeleteKey deletes a SSH signing key for the authenticated user. // -// GitHub API docs: https://docs.github.com/en/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +// +//meta:operation DELETE /user/ssh_signing_keys/{ssh_signing_key_id} func (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) { u := fmt.Sprintf("user/ssh_signing_keys/%v", id) diff --git a/metadata.yaml b/openapi_operations.yaml similarity index 76% rename from metadata.yaml rename to openapi_operations.yaml index f3751e86064..f2b1af28843 100644 --- a/metadata.yaml +++ b/openapi_operations.yaml @@ -1,2709 +1,3 @@ -methods: - - name: ActionsService.AddEnabledOrgInEnterprise - operations: - - PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id} - - name: ActionsService.AddEnabledReposInOrg - operations: - - PUT /orgs/{org}/actions/permissions/repositories/{repository_id} - - name: ActionsService.AddRepoToRequiredWorkflow - operations: - - PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - - name: ActionsService.AddRepositoryAccessRunnerGroup - operations: - - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - - name: ActionsService.AddRunnerGroupRunners - operations: - - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - - name: ActionsService.AddSelectedRepoToOrgSecret - operations: - - PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - - name: ActionsService.AddSelectedRepoToOrgVariable - operations: - - PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} - - name: ActionsService.CancelWorkflowRunByID - operations: - - POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel - - name: ActionsService.CreateEnvVariable - operations: - - POST /repositories/{repository_id}/environments/{environment_name}/variables - - name: ActionsService.CreateOrUpdateEnvSecret - operations: - - PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - - name: ActionsService.CreateOrUpdateOrgSecret - operations: - - PUT /orgs/{org}/actions/secrets/{secret_name} - - name: ActionsService.CreateOrUpdateRepoSecret - operations: - - PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} - - name: ActionsService.CreateOrgVariable - operations: - - POST /orgs/{org}/actions/variables - - name: ActionsService.CreateOrganizationRegistrationToken - operations: - - POST /orgs/{org}/actions/runners/registration-token - - name: ActionsService.CreateOrganizationRemoveToken - operations: - - POST /orgs/{org}/actions/runners/remove-token - - name: ActionsService.CreateOrganizationRunnerGroup - operations: - - POST /orgs/{org}/actions/runner-groups - - name: ActionsService.CreateRegistrationToken - operations: - - POST /repos/{owner}/{repo}/actions/runners/registration-token - - name: ActionsService.CreateRemoveToken - operations: - - POST /repos/{owner}/{repo}/actions/runners/remove-token - - name: ActionsService.CreateRepoVariable - operations: - - POST /repos/{owner}/{repo}/actions/variables - - name: ActionsService.CreateRequiredWorkflow - operations: - - POST /orgs/{org}/actions/required_workflows - - name: ActionsService.CreateWorkflowDispatchEventByFileName - operations: - - POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches - - name: ActionsService.CreateWorkflowDispatchEventByID - operations: - - POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches - - name: ActionsService.DeleteArtifact - operations: - - DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id} - - name: ActionsService.DeleteCachesByID - operations: - - DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} - - name: ActionsService.DeleteCachesByKey - operations: - - DELETE /repos/{owner}/{repo}/actions/caches - - name: ActionsService.DeleteEnvSecret - operations: - - DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - - name: ActionsService.DeleteEnvVariable - operations: - - DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} - - name: ActionsService.DeleteOrgSecret - operations: - - DELETE /orgs/{org}/actions/secrets/{secret_name} - - name: ActionsService.DeleteOrgVariable - operations: - - DELETE /orgs/{org}/actions/variables/{name} - - name: ActionsService.DeleteOrganizationRunnerGroup - operations: - - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} - - name: ActionsService.DeleteRepoSecret - operations: - - DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} - - name: ActionsService.DeleteRepoVariable - operations: - - DELETE /repos/{owner}/{repo}/actions/variables/{name} - - name: ActionsService.DeleteRequiredWorkflow - operations: - - DELETE /orgs/{org}/actions/required_workflows/{workflow_id} - - name: ActionsService.DeleteWorkflowRun - operations: - - DELETE /repos/{owner}/{repo}/actions/runs/{run_id} - - name: ActionsService.DeleteWorkflowRunLogs - operations: - - DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs - - name: ActionsService.DisableWorkflowByFileName - operations: - - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable - - name: ActionsService.DisableWorkflowByID - operations: - - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable - - name: ActionsService.DownloadArtifact - operations: - - GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} - - name: ActionsService.EditActionsAllowed - operations: - - PUT /orgs/{org}/actions/permissions/selected-actions - - name: ActionsService.EditActionsAllowedInEnterprise - operations: - - PUT /enterprises/{enterprise}/actions/permissions/selected-actions - - name: ActionsService.EditActionsPermissions - operations: - - PUT /orgs/{org}/actions/permissions - - name: ActionsService.EditActionsPermissionsInEnterprise - operations: - - PUT /enterprises/{enterprise}/actions/permissions - - name: ActionsService.EnableWorkflowByFileName - operations: - - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable - - name: ActionsService.EnableWorkflowByID - operations: - - PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable - - name: ActionsService.GenerateOrgJITConfig - operations: - - POST /orgs/{org}/actions/runners/generate-jitconfig - - name: ActionsService.GenerateRepoJITConfig - operations: - - POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig - - name: ActionsService.GetActionsAllowed - operations: - - GET /orgs/{org}/actions/permissions/selected-actions - - name: ActionsService.GetActionsAllowedInEnterprise - operations: - - GET /enterprises/{enterprise}/actions/permissions/selected-actions - - name: ActionsService.GetActionsPermissions - operations: - - GET /orgs/{org}/actions/permissions - - name: ActionsService.GetActionsPermissionsInEnterprise - operations: - - GET /enterprises/{enterprise}/actions/permissions - - name: ActionsService.GetArtifact - operations: - - GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} - - name: ActionsService.GetCacheUsageForRepo - operations: - - GET /repos/{owner}/{repo}/actions/cache/usage - - name: ActionsService.GetEnvPublicKey - operations: - - GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key - - name: ActionsService.GetEnvSecret - operations: - - GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} - - name: ActionsService.GetEnvVariable - operations: - - GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} - - name: ActionsService.GetOrgOIDCSubjectClaimCustomTemplate - operations: - - GET /orgs/{org}/actions/oidc/customization/sub - - name: ActionsService.GetOrgPublicKey - operations: - - GET /orgs/{org}/actions/secrets/public-key - - name: ActionsService.GetOrgSecret - operations: - - GET /orgs/{org}/actions/secrets/{secret_name} - - name: ActionsService.GetOrgVariable - operations: - - GET /orgs/{org}/actions/variables/{name} - - name: ActionsService.GetOrganizationRunner - operations: - - GET /orgs/{org}/actions/runners/{runner_id} - - name: ActionsService.GetOrganizationRunnerGroup - operations: - - GET /orgs/{org}/actions/runner-groups/{runner_group_id} - - name: ActionsService.GetRepoOIDCSubjectClaimCustomTemplate - operations: - - GET /repos/{owner}/{repo}/actions/oidc/customization/sub - - name: ActionsService.GetRepoPublicKey - operations: - - GET /repos/{owner}/{repo}/actions/secrets/public-key - - name: ActionsService.GetRepoSecret - operations: - - GET /repos/{owner}/{repo}/actions/secrets/{secret_name} - - name: ActionsService.GetRepoVariable - operations: - - GET /repos/{owner}/{repo}/actions/variables/{name} - - name: ActionsService.GetRequiredWorkflowByID - operations: - - GET /orgs/{org}/actions/required_workflows/{workflow_id} - - name: ActionsService.GetRunner - operations: - - GET /repos/{owner}/{repo}/actions/runners/{runner_id} - - name: ActionsService.GetTotalCacheUsageForEnterprise - operations: - - GET /enterprises/{enterprise}/actions/cache/usage - - name: ActionsService.GetTotalCacheUsageForOrg - operations: - - GET /orgs/{org}/actions/cache/usage - - name: ActionsService.GetWorkflowByFileName - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} - - name: ActionsService.GetWorkflowByID - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} - - name: ActionsService.GetWorkflowJobByID - operations: - - GET /repos/{owner}/{repo}/actions/jobs/{job_id} - - name: ActionsService.GetWorkflowJobLogs - operations: - - GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs - - name: ActionsService.GetWorkflowRunAttempt - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number} - - name: ActionsService.GetWorkflowRunAttemptLogs - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs - - name: ActionsService.GetWorkflowRunByID - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id} - - name: ActionsService.GetWorkflowRunLogs - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs - - name: ActionsService.GetWorkflowRunUsageByID - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing - - name: ActionsService.GetWorkflowUsageByFileName - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing - - name: ActionsService.GetWorkflowUsageByID - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing - - name: ActionsService.ListArtifacts - operations: - - GET /repos/{owner}/{repo}/actions/artifacts - - name: ActionsService.ListCacheUsageByRepoForOrg - operations: - - GET /orgs/{org}/actions/cache/usage-by-repository - - name: ActionsService.ListCaches - operations: - - GET /repos/{owner}/{repo}/actions/caches - - name: ActionsService.ListEnabledOrgsInEnterprise - operations: - - GET /enterprises/{enterprise}/actions/permissions/organizations - - name: ActionsService.ListEnabledReposInOrg - operations: - - GET /orgs/{org}/actions/permissions/repositories - - name: ActionsService.ListEnvSecrets - operations: - - GET /repositories/{repository_id}/environments/{environment_name}/secrets - - name: ActionsService.ListEnvVariables - operations: - - GET /repositories/{repository_id}/environments/{environment_name}/variables - - name: ActionsService.ListOrgRequiredWorkflows - operations: - - GET /orgs/{org}/actions/required_workflows - - name: ActionsService.ListOrgSecrets - operations: - - GET /orgs/{org}/actions/secrets - - name: ActionsService.ListOrgVariables - operations: - - GET /orgs/{org}/actions/variables - - name: ActionsService.ListOrganizationRunnerApplicationDownloads - operations: - - GET /orgs/{org}/actions/runners/downloads - - name: ActionsService.ListOrganizationRunnerGroups - operations: - - GET /orgs/{org}/actions/runner-groups - - name: ActionsService.ListOrganizationRunners - operations: - - GET /orgs/{org}/actions/runners - - name: ActionsService.ListRepoRequiredWorkflows - operations: - - GET /repos/{owner}/{repo}/actions/required_workflows - - name: ActionsService.ListRepoSecrets - operations: - - GET /repos/{owner}/{repo}/actions/secrets - - name: ActionsService.ListRepoVariables - operations: - - GET /repos/{owner}/{repo}/actions/variables - - name: ActionsService.ListRepositoryAccessRunnerGroup - operations: - - GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - - name: ActionsService.ListRepositoryWorkflowRuns - operations: - - GET /repos/{owner}/{repo}/actions/runs - - name: ActionsService.ListRequiredWorkflowSelectedRepos - operations: - - GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - - name: ActionsService.ListRunnerApplicationDownloads - operations: - - GET /repos/{owner}/{repo}/actions/runners/downloads - - name: ActionsService.ListRunnerGroupRunners - operations: - - GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners - - name: ActionsService.ListRunners - operations: - - GET /repos/{owner}/{repo}/actions/runners - - name: ActionsService.ListSelectedReposForOrgSecret - operations: - - GET /orgs/{org}/actions/secrets/{secret_name}/repositories - - name: ActionsService.ListSelectedReposForOrgVariable - operations: - - GET /orgs/{org}/actions/variables/{name}/repositories - - name: ActionsService.ListWorkflowJobs - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs - - name: ActionsService.ListWorkflowRunArtifacts - operations: - - GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts - - name: ActionsService.ListWorkflowRunsByFileName - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs - - name: ActionsService.ListWorkflowRunsByID - operations: - - GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs - - name: ActionsService.ListWorkflows - operations: - - GET /repos/{owner}/{repo}/actions/workflows - - name: ActionsService.PendingDeployments - operations: - - POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments - - name: ActionsService.RemoveEnabledOrgInEnterprise - operations: - - DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id} - - name: ActionsService.RemoveEnabledReposInOrg - operations: - - DELETE /orgs/{org}/actions/permissions/repositories/{repository_id} - - name: ActionsService.RemoveOrganizationRunner - operations: - - DELETE /orgs/{org}/actions/runners/{runner_id} - - name: ActionsService.RemoveRepoFromRequiredWorkflow - operations: - - DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} - - name: ActionsService.RemoveRepositoryAccessRunnerGroup - operations: - - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - - name: ActionsService.RemoveRunner - operations: - - DELETE /repos/{owner}/{repo}/actions/runners/{runner_id} - - name: ActionsService.RemoveRunnerGroupRunners - operations: - - DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - - name: ActionsService.RemoveSelectedRepoFromOrgSecret - operations: - - DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - - name: ActionsService.RemoveSelectedRepoFromOrgVariable - operations: - - DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} - - name: ActionsService.RerunFailedJobsByID - operations: - - POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs - - name: ActionsService.RerunJobByID - operations: - - POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun - - name: ActionsService.RerunWorkflowByID - operations: - - POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun - - name: ActionsService.SetEnabledOrgsInEnterprise - operations: - - PUT /enterprises/{enterprise}/actions/permissions/organizations - - name: ActionsService.SetEnabledReposInOrg - operations: - - PUT /orgs/{org}/actions/permissions/repositories - - name: ActionsService.SetOrgOIDCSubjectClaimCustomTemplate - operations: - - PUT /orgs/{org}/actions/oidc/customization/sub - - name: ActionsService.SetRepoOIDCSubjectClaimCustomTemplate - operations: - - PUT /repos/{owner}/{repo}/actions/oidc/customization/sub - - name: ActionsService.SetRepositoryAccessRunnerGroup - operations: - - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - - name: ActionsService.SetRequiredWorkflowSelectedRepos - operations: - - PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories - - name: ActionsService.SetRunnerGroupRunners - operations: - - PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners - - name: ActionsService.SetSelectedReposForOrgSecret - operations: - - PUT /orgs/{org}/actions/secrets/{secret_name}/repositories - - name: ActionsService.SetSelectedReposForOrgVariable - operations: - - PUT /orgs/{org}/actions/variables/{name}/repositories - - name: ActionsService.UpdateEnvVariable - operations: - - PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} - - name: ActionsService.UpdateOrgVariable - operations: - - PATCH /orgs/{org}/actions/variables/{name} - - name: ActionsService.UpdateOrganizationRunnerGroup - operations: - - PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} - - name: ActionsService.UpdateRepoVariable - operations: - - PATCH /repos/{owner}/{repo}/actions/variables/{name} - - name: ActionsService.UpdateRequiredWorkflow - operations: - - PATCH /orgs/{org}/actions/required_workflows/{workflow_id} - - name: ActivityService.DeleteRepositorySubscription - operations: - - DELETE /repos/{owner}/{repo}/subscription - - name: ActivityService.DeleteThreadSubscription - operations: - - DELETE /notifications/threads/{thread_id}/subscription - - name: ActivityService.GetRepositorySubscription - operations: - - GET /repos/{owner}/{repo}/subscription - - name: ActivityService.GetThread - operations: - - GET /notifications/threads/{thread_id} - - name: ActivityService.GetThreadSubscription - operations: - - GET /notifications/threads/{thread_id}/subscription - - name: ActivityService.IsStarred - operations: - - GET /user/starred/{owner}/{repo} - - name: ActivityService.ListEvents - operations: - - GET /events - - name: ActivityService.ListEventsForOrganization - operations: - - GET /orgs/{org}/events - - name: ActivityService.ListEventsForRepoNetwork - operations: - - GET /networks/{owner}/{repo}/events - - name: ActivityService.ListEventsPerformedByUser - operations: - - GET /users/{username}/events - - GET /users/{username}/events/public - - name: ActivityService.ListEventsReceivedByUser - operations: - - GET /users/{username}/received_events - - GET /users/{username}/received_events/public - - name: ActivityService.ListFeeds - operations: - - GET /feeds - - name: ActivityService.ListIssueEventsForRepository - operations: - - GET /repos/{owner}/{repo}/issues/events - - name: ActivityService.ListNotifications - operations: - - GET /notifications - - name: ActivityService.ListRepositoryEvents - operations: - - GET /repos/{owner}/{repo}/events - - name: ActivityService.ListRepositoryNotifications - operations: - - GET /repos/{owner}/{repo}/notifications - - name: ActivityService.ListStargazers - operations: - - GET /repos/{owner}/{repo}/stargazers - - name: ActivityService.ListStarred - operations: - - GET /user/starred - - GET /users/{username}/starred - - name: ActivityService.ListUserEventsForOrganization - operations: - - GET /users/{username}/events/orgs/{org} - - name: ActivityService.ListWatched - operations: - - GET /user/subscriptions - - GET /users/{username}/subscriptions - - name: ActivityService.ListWatchers - operations: - - GET /repos/{owner}/{repo}/subscribers - - name: ActivityService.MarkNotificationsRead - operations: - - PUT /notifications - - name: ActivityService.MarkRepositoryNotificationsRead - operations: - - PUT /repos/{owner}/{repo}/notifications - - name: ActivityService.MarkThreadRead - operations: - - PATCH /notifications/threads/{thread_id} - - name: ActivityService.SetRepositorySubscription - operations: - - PUT /repos/{owner}/{repo}/subscription - - name: ActivityService.SetThreadSubscription - operations: - - PUT /notifications/threads/{thread_id}/subscription - - name: ActivityService.Star - operations: - - PUT /user/starred/{owner}/{repo} - - name: ActivityService.Unstar - operations: - - DELETE /user/starred/{owner}/{repo} - - name: AdminService.CreateOrg - operations: - - POST /admin/organizations - - name: AdminService.CreateUser - operations: - - POST /admin/users - - name: AdminService.CreateUserImpersonation - operations: - - POST /admin/users/{username}/authorizations - - name: AdminService.DeleteUser - operations: - - DELETE /admin/users/{username} - - name: AdminService.DeleteUserImpersonation - operations: - - DELETE /admin/users/{username}/authorizations - - name: AdminService.GetAdminStats - operations: - - GET /enterprise/stats/all - - name: AdminService.RenameOrg - operations: - - PATCH /admin/organizations/{org} - - name: AdminService.RenameOrgByName - operations: - - PATCH /admin/organizations/{org} - - name: AdminService.UpdateTeamLDAPMapping - operations: - - PATCH /admin/ldap/teams/{team_id}/mapping - - name: AdminService.UpdateUserLDAPMapping - operations: - - PATCH /admin/ldap/users/{username}/mapping - - name: AppsService.AddRepository - operations: - - PUT /user/installations/{installation_id}/repositories/{repository_id} - - name: AppsService.CompleteAppManifest - operations: - - POST /app-manifests/{code}/conversions - - name: AppsService.CreateAttachment - operations: - - POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments - - name: AppsService.CreateInstallationToken - operations: - - POST /app/installations/{installation_id}/access_tokens - - name: AppsService.DeleteInstallation - operations: - - DELETE /app/installations/{installation_id} - - name: AppsService.FindOrganizationInstallation - operations: - - GET /orgs/{org}/installation - - name: AppsService.FindRepositoryInstallation - operations: - - GET /repos/{owner}/{repo}/installation - - name: AppsService.FindRepositoryInstallationByID - operations: - - GET /repositories/{repository_id}/installation - - name: AppsService.FindUserInstallation - operations: - - GET /users/{username}/installation - - name: AppsService.Get - operations: - - GET /app - - GET /apps/{app_slug} - - name: AppsService.GetHookConfig - operations: - - GET /app/hook/config - - name: AppsService.GetHookDelivery - operations: - - GET /app/hook/deliveries/{delivery_id} - - name: AppsService.GetInstallation - operations: - - GET /app/installations/{installation_id} - - name: AppsService.ListHookDeliveries - operations: - - GET /app/hook/deliveries - - name: AppsService.ListInstallationRequests - operations: - - GET /app/installation-requests - - name: AppsService.ListInstallations - operations: - - GET /app/installations - - name: AppsService.ListRepos - operations: - - GET /installation/repositories - - name: AppsService.ListUserInstallations - operations: - - GET /user/installations - - name: AppsService.ListUserRepos - operations: - - GET /user/installations/{installation_id}/repositories - - name: AppsService.RedeliverHookDelivery - operations: - - POST /app/hook/deliveries/{delivery_id}/attempts - - name: AppsService.RemoveRepository - operations: - - DELETE /user/installations/{installation_id}/repositories/{repository_id} - - name: AppsService.RevokeInstallationToken - operations: - - DELETE /installation/token - - name: AppsService.SuspendInstallation - operations: - - PUT /app/installations/{installation_id}/suspended - - name: AppsService.UnsuspendInstallation - operations: - - DELETE /app/installations/{installation_id}/suspended - - name: AppsService.UpdateHookConfig - operations: - - PATCH /app/hook/config - - name: AuthorizationsService.Check - operations: - - POST /applications/{client_id}/token - - name: AuthorizationsService.CreateImpersonation - operations: - - POST /admin/users/{username}/authorizations - - name: AuthorizationsService.DeleteGrant - operations: - - DELETE /applications/{client_id}/grant - - name: AuthorizationsService.DeleteImpersonation - operations: - - DELETE /admin/users/{username}/authorizations - - name: AuthorizationsService.Reset - operations: - - PATCH /applications/{client_id}/token - - name: AuthorizationsService.Revoke - operations: - - DELETE /applications/{client_id}/token - - name: BillingService.GetActionsBillingOrg - operations: - - GET /orgs/{org}/settings/billing/actions - - name: BillingService.GetActionsBillingUser - operations: - - GET /users/{username}/settings/billing/actions - - name: BillingService.GetAdvancedSecurityActiveCommittersOrg - operations: - - GET /orgs/{org}/settings/billing/advanced-security - - name: BillingService.GetPackagesBillingOrg - operations: - - GET /orgs/{org}/settings/billing/packages - - name: BillingService.GetPackagesBillingUser - operations: - - GET /users/{username}/settings/billing/packages - - name: BillingService.GetStorageBillingOrg - operations: - - GET /orgs/{org}/settings/billing/shared-storage - - name: BillingService.GetStorageBillingUser - operations: - - GET /users/{username}/settings/billing/shared-storage - - name: ChecksService.CreateCheckRun - operations: - - POST /repos/{owner}/{repo}/check-runs - - name: ChecksService.CreateCheckSuite - operations: - - POST /repos/{owner}/{repo}/check-suites - - name: ChecksService.GetCheckRun - operations: - - GET /repos/{owner}/{repo}/check-runs/{check_run_id} - - name: ChecksService.GetCheckSuite - operations: - - GET /repos/{owner}/{repo}/check-suites/{check_suite_id} - - name: ChecksService.ListCheckRunAnnotations - operations: - - GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations - - name: ChecksService.ListCheckRunsCheckSuite - operations: - - GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs - - name: ChecksService.ListCheckRunsForRef - operations: - - GET /repos/{owner}/{repo}/commits/{ref}/check-runs - - name: ChecksService.ListCheckSuitesForRef - operations: - - GET /repos/{owner}/{repo}/commits/{ref}/check-suites - - name: ChecksService.ReRequestCheckRun - operations: - - POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest - - name: ChecksService.ReRequestCheckSuite - operations: - - POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest - - name: ChecksService.SetCheckSuitePreferences - operations: - - PATCH /repos/{owner}/{repo}/check-suites/preferences - - name: ChecksService.UpdateCheckRun - operations: - - PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} - - name: CodeScanningService.DeleteAnalysis - operations: - - DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} - - name: CodeScanningService.GetAlert - operations: - - GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} - - name: CodeScanningService.GetAnalysis - operations: - - GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id} - - name: CodeScanningService.GetCodeQLDatabase - operations: - - GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} - - name: CodeScanningService.GetDefaultSetupConfiguration - operations: - - GET /repos/{owner}/{repo}/code-scanning/default-setup - - name: CodeScanningService.GetSARIF - operations: - - GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id} - - name: CodeScanningService.ListAlertInstances - operations: - - GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances - - name: CodeScanningService.ListAlertsForOrg - operations: - - GET /orgs/{org}/code-scanning/alerts - - name: CodeScanningService.ListAlertsForRepo - operations: - - GET /repos/{owner}/{repo}/code-scanning/alerts - - name: CodeScanningService.ListAnalysesForRepo - operations: - - GET /repos/{owner}/{repo}/code-scanning/analyses - - name: CodeScanningService.ListCodeQLDatabases - operations: - - GET /repos/{owner}/{repo}/code-scanning/codeql/databases - - name: CodeScanningService.UpdateAlert - operations: - - PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number} - - name: CodeScanningService.UpdateDefaultSetupConfiguration - operations: - - PATCH /repos/{owner}/{repo}/code-scanning/default-setup - - name: CodeScanningService.UploadSarif - operations: - - POST /repos/{owner}/{repo}/code-scanning/sarifs - - name: CodesOfConductService.Get - operations: - - GET /codes_of_conduct/{key} - - name: CodesOfConductService.List - operations: - - GET /codes_of_conduct - - name: CodespacesService.AddSelectedRepoToOrgSecret - operations: - - PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} - - name: CodespacesService.AddSelectedRepoToUserSecret - operations: - - PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} - - name: CodespacesService.CreateInRepo - operations: - - POST /repos/{owner}/{repo}/codespaces - - name: CodespacesService.CreateOrUpdateOrgSecret - operations: - - PUT /orgs/{org}/codespaces/secrets/{secret_name} - - name: CodespacesService.CreateOrUpdateRepoSecret - operations: - - PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - - name: CodespacesService.CreateOrUpdateUserSecret - operations: - - PUT /user/codespaces/secrets/{secret_name} - - name: CodespacesService.Delete - operations: - - DELETE /user/codespaces/{codespace_name} - - name: CodespacesService.DeleteOrgSecret - operations: - - DELETE /orgs/{org}/codespaces/secrets/{secret_name} - - name: CodespacesService.DeleteRepoSecret - operations: - - DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - - name: CodespacesService.DeleteUserSecret - operations: - - DELETE /user/codespaces/secrets/{secret_name} - - name: CodespacesService.GetOrgPublicKey - operations: - - GET /orgs/{org}/codespaces/secrets/public-key - - name: CodespacesService.GetOrgSecret - operations: - - GET /orgs/{org}/codespaces/secrets/{secret_name} - - name: CodespacesService.GetRepoPublicKey - operations: - - GET /repos/{owner}/{repo}/codespaces/secrets/public-key - - name: CodespacesService.GetRepoSecret - operations: - - GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} - - name: CodespacesService.GetUserPublicKey - operations: - - GET /user/codespaces/secrets/public-key - - name: CodespacesService.GetUserSecret - operations: - - GET /user/codespaces/secrets/{secret_name} - - name: CodespacesService.List - operations: - - GET /user/codespaces - - name: CodespacesService.ListInRepo - operations: - - GET /repos/{owner}/{repo}/codespaces - - name: CodespacesService.ListOrgSecrets - operations: - - GET /orgs/{org}/codespaces/secrets - - name: CodespacesService.ListRepoSecrets - operations: - - GET /repos/{owner}/{repo}/codespaces/secrets - - name: CodespacesService.ListSelectedReposForOrgSecret - operations: - - GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories - - name: CodespacesService.ListSelectedReposForUserSecret - operations: - - GET /user/codespaces/secrets/{secret_name}/repositories - - name: CodespacesService.ListUserSecrets - operations: - - GET /user/codespaces/secrets - - name: CodespacesService.RemoveSelectedRepoFromOrgSecret - operations: - - DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} - - name: CodespacesService.RemoveSelectedRepoFromUserSecret - operations: - - DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} - - name: CodespacesService.SetSelectedReposForOrgSecret - operations: - - PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories - - name: CodespacesService.SetSelectedReposForUserSecret - operations: - - PUT /user/codespaces/secrets/{secret_name}/repositories - - name: CodespacesService.Start - operations: - - POST /user/codespaces/{codespace_name}/start - - name: CodespacesService.Stop - operations: - - POST /user/codespaces/{codespace_name}/stop - - name: DependabotService.AddSelectedRepoToOrgSecret - operations: - - PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} - - name: DependabotService.CreateOrUpdateOrgSecret - operations: - - PUT /orgs/{org}/dependabot/secrets/{secret_name} - - name: DependabotService.CreateOrUpdateRepoSecret - operations: - - PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - - name: DependabotService.DeleteOrgSecret - operations: - - DELETE /orgs/{org}/dependabot/secrets/{secret_name} - - name: DependabotService.DeleteRepoSecret - operations: - - DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - - name: DependabotService.GetOrgPublicKey - operations: - - GET /orgs/{org}/dependabot/secrets/public-key - - name: DependabotService.GetOrgSecret - operations: - - GET /orgs/{org}/dependabot/secrets/{secret_name} - - name: DependabotService.GetRepoAlert - operations: - - GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number} - - name: DependabotService.GetRepoPublicKey - operations: - - GET /repos/{owner}/{repo}/dependabot/secrets/public-key - - name: DependabotService.GetRepoSecret - operations: - - GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name} - - name: DependabotService.ListOrgAlerts - operations: - - GET /orgs/{org}/dependabot/alerts - - name: DependabotService.ListOrgSecrets - operations: - - GET /orgs/{org}/dependabot/secrets - - name: DependabotService.ListRepoAlerts - operations: - - GET /repos/{owner}/{repo}/dependabot/alerts - - name: DependabotService.ListRepoSecrets - operations: - - GET /repos/{owner}/{repo}/dependabot/secrets - - name: DependabotService.ListSelectedReposForOrgSecret - operations: - - GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories - - name: DependabotService.RemoveSelectedRepoFromOrgSecret - operations: - - DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} - - name: DependabotService.SetSelectedReposForOrgSecret - operations: - - PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories - - name: DependencyGraphService.GetSBOM - operations: - - GET /repos/{owner}/{repo}/dependency-graph/sbom - - name: EmojisService.List - operations: - - GET /emojis - - name: EnterpriseService.AddOrganizationAccessRunnerGroup - operations: - - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - - name: EnterpriseService.AddRunnerGroupRunners - operations: - - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - - name: EnterpriseService.CreateEnterpriseRunnerGroup - operations: - - POST /enterprises/{enterprise}/actions/runner-groups - - name: EnterpriseService.CreateRegistrationToken - operations: - - POST /enterprises/{enterprise}/actions/runners/registration-token - - name: EnterpriseService.DeleteEnterpriseRunnerGroup - operations: - - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - - name: EnterpriseService.EnableDisableSecurityFeature - operations: - - POST /enterprises/{enterprise}/{security_product}/{enablement} - - name: EnterpriseService.GenerateEnterpriseJITConfig - operations: - - POST /enterprises/{enterprise}/actions/runners/generate-jitconfig - - name: EnterpriseService.GetAuditLog - operations: - - GET /enterprises/{enterprise}/audit-log - - name: EnterpriseService.GetCodeSecurityAndAnalysis - operations: - - GET /enterprises/{enterprise}/code_security_and_analysis - - name: EnterpriseService.GetEnterpriseRunnerGroup - operations: - - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - - name: EnterpriseService.ListOrganizationAccessRunnerGroup - operations: - - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - - name: EnterpriseService.ListRunnerApplicationDownloads - operations: - - GET /enterprises/{enterprise}/actions/runners/downloads - - name: EnterpriseService.ListRunnerGroupRunners - operations: - - GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - - name: EnterpriseService.ListRunnerGroups - operations: - - GET /enterprises/{enterprise}/actions/runner-groups - - name: EnterpriseService.ListRunners - operations: - - GET /enterprises/{enterprise}/actions/runners - - name: EnterpriseService.RemoveOrganizationAccessRunnerGroup - operations: - - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - - name: EnterpriseService.RemoveRunner - operations: - - DELETE /enterprises/{enterprise}/actions/runners/{runner_id} - - name: EnterpriseService.RemoveRunnerGroupRunners - operations: - - DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - - name: EnterpriseService.SetOrganizationAccessRunnerGroup - operations: - - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - - name: EnterpriseService.SetRunnerGroupRunners - operations: - - PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - - name: EnterpriseService.UpdateCodeSecurityAndAnalysis - operations: - - PATCH /enterprises/{enterprise}/code_security_and_analysis - - name: EnterpriseService.UpdateEnterpriseRunnerGroup - operations: - - PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - - name: GistsService.Create - operations: - - POST /gists - - name: GistsService.CreateComment - operations: - - POST /gists/{gist_id}/comments - - name: GistsService.Delete - operations: - - DELETE /gists/{gist_id} - - name: GistsService.DeleteComment - operations: - - DELETE /gists/{gist_id}/comments/{comment_id} - - name: GistsService.Edit - operations: - - PATCH /gists/{gist_id} - - name: GistsService.EditComment - operations: - - PATCH /gists/{gist_id}/comments/{comment_id} - - name: GistsService.Fork - operations: - - POST /gists/{gist_id}/forks - - name: GistsService.Get - operations: - - GET /gists/{gist_id} - - name: GistsService.GetComment - operations: - - GET /gists/{gist_id}/comments/{comment_id} - - name: GistsService.GetRevision - operations: - - GET /gists/{gist_id}/{sha} - - name: GistsService.IsStarred - operations: - - GET /gists/{gist_id}/star - - name: GistsService.List - operations: - - GET /gists - - GET /users/{username}/gists - - name: GistsService.ListAll - operations: - - GET /gists/public - - name: GistsService.ListComments - operations: - - GET /gists/{gist_id}/comments - - name: GistsService.ListCommits - operations: - - GET /gists/{gist_id}/commits - - name: GistsService.ListForks - operations: - - GET /gists/{gist_id}/forks - - name: GistsService.ListStarred - operations: - - GET /gists/starred - - name: GistsService.Star - operations: - - PUT /gists/{gist_id}/star - - name: GistsService.Unstar - operations: - - DELETE /gists/{gist_id}/star - - name: GitService.CreateBlob - operations: - - POST /repos/{owner}/{repo}/git/blobs - - name: GitService.CreateCommit - operations: - - POST /repos/{owner}/{repo}/git/commits - - name: GitService.CreateRef - operations: - - POST /repos/{owner}/{repo}/git/refs - - name: GitService.CreateTag - operations: - - POST /repos/{owner}/{repo}/git/tags - - name: GitService.CreateTree - operations: - - POST /repos/{owner}/{repo}/git/trees - - name: GitService.DeleteRef - operations: - - DELETE /repos/{owner}/{repo}/git/refs/{ref} - - name: GitService.GetBlob - operations: - - GET /repos/{owner}/{repo}/git/blobs/{file_sha} - - name: GitService.GetBlobRaw - operations: - - GET /repos/{owner}/{repo}/git/blobs/{file_sha} - - name: GitService.GetCommit - operations: - - GET /repos/{owner}/{repo}/git/commits/{commit_sha} - - name: GitService.GetRef - operations: - - GET /repos/{owner}/{repo}/git/ref/{ref} - - name: GitService.GetTag - operations: - - GET /repos/{owner}/{repo}/git/tags/{tag_sha} - - name: GitService.GetTree - operations: - - GET /repos/{owner}/{repo}/git/trees/{tree_sha} - - name: GitService.ListMatchingRefs - operations: - - GET /repos/{owner}/{repo}/git/matching-refs/{ref} - - name: GitService.UpdateRef - operations: - - PATCH /repos/{owner}/{repo}/git/refs/{ref} - - name: GitignoresService.Get - operations: - - GET /gitignore/templates/{name} - - name: GitignoresService.List - operations: - - GET /gitignore/templates - - name: InteractionsService.GetRestrictionsForOrg - operations: - - GET /orgs/{org}/interaction-limits - - name: InteractionsService.GetRestrictionsForRepo - operations: - - GET /repos/{owner}/{repo}/interaction-limits - - name: InteractionsService.RemoveRestrictionsFromOrg - operations: - - DELETE /orgs/{org}/interaction-limits - - name: InteractionsService.RemoveRestrictionsFromRepo - operations: - - DELETE /repos/{owner}/{repo}/interaction-limits - - name: InteractionsService.UpdateRestrictionsForOrg - operations: - - PUT /orgs/{org}/interaction-limits - - name: InteractionsService.UpdateRestrictionsForRepo - operations: - - PUT /repos/{owner}/{repo}/interaction-limits - - name: IssueImportService.CheckStatus - operations: - - GET /repos/{owner}/{repo}/import/issues/{issue_number} - - name: IssueImportService.CheckStatusSince - operations: - - GET /repos/{owner}/{repo}/import/issues - - name: IssueImportService.Create - operations: - - POST /repos/{owner}/{repo}/import/issues - - name: IssuesService.AddAssignees - operations: - - POST /repos/{owner}/{repo}/issues/{issue_number}/assignees - - name: IssuesService.AddLabelsToIssue - operations: - - POST /repos/{owner}/{repo}/issues/{issue_number}/labels - - name: IssuesService.Create - operations: - - POST /repos/{owner}/{repo}/issues - - name: IssuesService.CreateComment - operations: - - POST /repos/{owner}/{repo}/issues/{issue_number}/comments - - name: IssuesService.CreateLabel - operations: - - POST /repos/{owner}/{repo}/labels - - name: IssuesService.CreateMilestone - operations: - - POST /repos/{owner}/{repo}/milestones - - name: IssuesService.DeleteComment - operations: - - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} - - name: IssuesService.DeleteLabel - operations: - - DELETE /repos/{owner}/{repo}/labels/{name} - - name: IssuesService.DeleteMilestone - operations: - - DELETE /repos/{owner}/{repo}/milestones/{milestone_number} - - name: IssuesService.Edit - operations: - - PATCH /repos/{owner}/{repo}/issues/{issue_number} - - name: IssuesService.EditComment - operations: - - PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} - - name: IssuesService.EditLabel - operations: - - PATCH /repos/{owner}/{repo}/labels/{name} - - name: IssuesService.EditMilestone - operations: - - PATCH /repos/{owner}/{repo}/milestones/{milestone_number} - - name: IssuesService.Get - operations: - - GET /repos/{owner}/{repo}/issues/{issue_number} - - name: IssuesService.GetComment - operations: - - GET /repos/{owner}/{repo}/issues/comments/{comment_id} - - name: IssuesService.GetEvent - operations: - - GET /repos/{owner}/{repo}/issues/events/{event_id} - - name: IssuesService.GetLabel - operations: - - GET /repos/{owner}/{repo}/labels/{name} - - name: IssuesService.GetMilestone - operations: - - GET /repos/{owner}/{repo}/milestones/{milestone_number} - - name: IssuesService.IsAssignee - operations: - - GET /repos/{owner}/{repo}/assignees/{assignee} - - name: IssuesService.List - operations: - - GET /issues - - GET /user/issues - - name: IssuesService.ListAssignees - operations: - - GET /repos/{owner}/{repo}/assignees - - name: IssuesService.ListByOrg - operations: - - GET /orgs/{org}/issues - - name: IssuesService.ListByRepo - operations: - - GET /repos/{owner}/{repo}/issues - - name: IssuesService.ListComments - operations: - - GET /repos/{owner}/{repo}/issues/comments - - GET /repos/{owner}/{repo}/issues/{issue_number}/comments - - name: IssuesService.ListIssueEvents - operations: - - GET /repos/{owner}/{repo}/issues/{issue_number}/events - - name: IssuesService.ListIssueTimeline - operations: - - GET /repos/{owner}/{repo}/issues/{issue_number}/timeline - - name: IssuesService.ListLabels - operations: - - GET /repos/{owner}/{repo}/labels - - name: IssuesService.ListLabelsByIssue - operations: - - GET /repos/{owner}/{repo}/issues/{issue_number}/labels - - name: IssuesService.ListLabelsForMilestone - operations: - - GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels - - name: IssuesService.ListMilestones - operations: - - GET /repos/{owner}/{repo}/milestones - - name: IssuesService.ListRepositoryEvents - operations: - - GET /repos/{owner}/{repo}/issues/events - - name: IssuesService.Lock - operations: - - PUT /repos/{owner}/{repo}/issues/{issue_number}/lock - - name: IssuesService.RemoveAssignees - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees - - name: IssuesService.RemoveLabelForIssue - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} - - name: IssuesService.RemoveLabelsForIssue - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels - - name: IssuesService.RemoveMilestone - operations: - - PATCH /repos/{owner}/{repo}/issues/{issue_number} - - name: IssuesService.ReplaceLabelsForIssue - operations: - - PUT /repos/{owner}/{repo}/issues/{issue_number}/labels - - name: IssuesService.Unlock - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock - - name: LicensesService.Get - operations: - - GET /licenses/{license} - - name: LicensesService.List - operations: - - GET /licenses - - name: MarkdownService.Render - operations: - - POST /markdown - - name: MarketplaceService.GetPlanAccountForAccount - operations: - - GET /marketplace_listing/accounts/{account_id} - - GET /marketplace_listing/stubbed/accounts/{account_id} - - name: MarketplaceService.ListMarketplacePurchasesForUser - operations: - - GET /user/marketplace_purchases - - GET /user/marketplace_purchases/stubbed - - name: MarketplaceService.ListPlanAccountsForPlan - operations: - - GET /marketplace_listing/plans/{plan_id}/accounts - - GET /marketplace_listing/stubbed/plans/{plan_id}/accounts - - name: MarketplaceService.ListPlans - operations: - - GET /marketplace_listing/plans - - GET /marketplace_listing/stubbed/plans - - name: MetaService.Get - operations: - - GET /meta - - name: MetaService.Octocat - operations: - - GET /octocat - - name: MetaService.Zen - operations: - - GET /zen - - name: MigrationService.CancelImport - operations: - - DELETE /repos/{owner}/{repo}/import - - name: MigrationService.CommitAuthors - operations: - - GET /repos/{owner}/{repo}/import/authors - - name: MigrationService.DeleteMigration - operations: - - DELETE /orgs/{org}/migrations/{migration_id}/archive - - name: MigrationService.DeleteUserMigration - operations: - - DELETE /user/migrations/{migration_id}/archive - - name: MigrationService.ImportProgress - operations: - - GET /repos/{owner}/{repo}/import - - name: MigrationService.LargeFiles - operations: - - GET /repos/{owner}/{repo}/import/large_files - - name: MigrationService.ListMigrations - operations: - - GET /orgs/{org}/migrations - - name: MigrationService.ListUserMigrations - operations: - - GET /user/migrations - - name: MigrationService.MapCommitAuthor - operations: - - PATCH /repos/{owner}/{repo}/import/authors/{author_id} - - name: MigrationService.MigrationArchiveURL - operations: - - GET /orgs/{org}/migrations/{migration_id}/archive - - name: MigrationService.MigrationStatus - operations: - - GET /orgs/{org}/migrations/{migration_id} - - name: MigrationService.SetLFSPreference - operations: - - PATCH /repos/{owner}/{repo}/import/lfs - - name: MigrationService.StartImport - operations: - - PUT /repos/{owner}/{repo}/import - - name: MigrationService.StartMigration - operations: - - POST /orgs/{org}/migrations - - name: MigrationService.StartUserMigration - operations: - - POST /user/migrations - - name: MigrationService.UnlockRepo - operations: - - DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock - - name: MigrationService.UnlockUserRepo - operations: - - DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock - - name: MigrationService.UpdateImport - operations: - - PATCH /repos/{owner}/{repo}/import - - name: MigrationService.UserMigrationArchiveURL - operations: - - GET /user/migrations/{migration_id}/archive - - name: MigrationService.UserMigrationStatus - operations: - - GET /user/migrations/{migration_id} - - name: OrganizationsService.AddSecurityManagerTeam - operations: - - PUT /orgs/{org}/security-managers/teams/{team_slug} - - name: OrganizationsService.BlockUser - operations: - - PUT /orgs/{org}/blocks/{username} - - name: OrganizationsService.ConcealMembership - operations: - - DELETE /orgs/{org}/public_members/{username} - - name: OrganizationsService.ConvertMemberToOutsideCollaborator - operations: - - PUT /orgs/{org}/outside_collaborators/{username} - - name: OrganizationsService.CreateCustomRepoRole - operations: - - POST /orgs/{org}/custom-repository-roles - - name: OrganizationsService.CreateHook - operations: - - POST /orgs/{org}/hooks - - name: OrganizationsService.CreateOrgInvitation - operations: - - POST /orgs/{org}/invitations - - name: OrganizationsService.CreateOrganizationRuleset - operations: - - POST /orgs/{org}/rulesets - - name: OrganizationsService.CreateProject - operations: - - POST /orgs/{org}/projects - - name: OrganizationsService.Delete - operations: - - DELETE /orgs/{org} - - name: OrganizationsService.DeleteCustomRepoRole - operations: - - DELETE /orgs/{org}/custom-repository-roles/{role_id} - - name: OrganizationsService.DeleteHook - operations: - - DELETE /orgs/{org}/hooks/{hook_id} - - name: OrganizationsService.DeleteOrganizationRuleset - operations: - - DELETE /orgs/{org}/rulesets/{ruleset_id} - - name: OrganizationsService.DeletePackage - operations: - - DELETE /orgs/{org}/packages/{package_type}/{package_name} - - name: OrganizationsService.Edit - operations: - - PATCH /orgs/{org} - - name: OrganizationsService.EditActionsAllowed - operations: - - PUT /orgs/{org}/actions/permissions/selected-actions - - name: OrganizationsService.EditActionsPermissions - operations: - - PUT /orgs/{org}/actions/permissions - - name: OrganizationsService.EditHook - operations: - - PATCH /orgs/{org}/hooks/{hook_id} - - name: OrganizationsService.EditHookConfiguration - operations: - - PATCH /orgs/{org}/hooks/{hook_id}/config - - name: OrganizationsService.EditOrgMembership - operations: - - PATCH /user/memberships/orgs/{org} - - PUT /orgs/{org}/memberships/{username} - - name: OrganizationsService.Get - operations: - - GET /orgs/{org} - - name: OrganizationsService.GetActionsAllowed - operations: - - GET /orgs/{org}/actions/permissions/selected-actions - - name: OrganizationsService.GetActionsPermissions - operations: - - GET /orgs/{org}/actions/permissions - - name: OrganizationsService.GetAllOrganizationRulesets - operations: - - GET /orgs/{org}/rulesets - - name: OrganizationsService.GetAuditLog - operations: - - GET /orgs/{org}/audit-log - - name: OrganizationsService.GetByID - operations: - - GET /organizations/{organization_id} - - name: OrganizationsService.GetHook - operations: - - GET /orgs/{org}/hooks/{hook_id} - - name: OrganizationsService.GetHookConfiguration - operations: - - GET /orgs/{org}/hooks/{hook_id}/config - - name: OrganizationsService.GetHookDelivery - operations: - - GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} - - name: OrganizationsService.GetOrgMembership - operations: - - GET /orgs/{org}/memberships/{username} - - GET /user/memberships/orgs/{org} - - name: OrganizationsService.GetOrganizationRuleset - operations: - - GET /orgs/{org}/rulesets/{ruleset_id} - - name: OrganizationsService.GetPackage - operations: - - GET /orgs/{org}/packages/{package_type}/{package_name} - - name: OrganizationsService.IsBlocked - operations: - - GET /orgs/{org}/blocks/{username} - - name: OrganizationsService.IsMember - operations: - - GET /orgs/{org}/members/{username} - - name: OrganizationsService.IsPublicMember - operations: - - GET /orgs/{org}/public_members/{username} - - name: OrganizationsService.List - operations: - - GET /user/orgs - - GET /users/{username}/orgs - - name: OrganizationsService.ListAll - operations: - - GET /organizations - - name: OrganizationsService.ListBlockedUsers - operations: - - GET /orgs/{org}/blocks - - name: OrganizationsService.ListCredentialAuthorizations - operations: - - GET /orgs/{org}/credential-authorizations - - name: OrganizationsService.ListCustomRepoRoles - operations: - - GET /orgs/{org}/custom-repository-roles - - name: OrganizationsService.ListFailedOrgInvitations - operations: - - GET /orgs/{org}/failed_invitations - - name: OrganizationsService.ListHookDeliveries - operations: - - GET /orgs/{org}/hooks/{hook_id}/deliveries - - name: OrganizationsService.ListHooks - operations: - - GET /orgs/{org}/hooks - - name: OrganizationsService.ListInstallations - operations: - - GET /orgs/{org}/installations - - name: OrganizationsService.ListMembers - operations: - - GET /orgs/{org}/members - - GET /orgs/{org}/public_members - - name: OrganizationsService.ListOrgInvitationTeams - operations: - - GET /orgs/{org}/invitations/{invitation_id}/teams - - name: OrganizationsService.ListOrgMemberships - operations: - - GET /user/memberships/orgs - - name: OrganizationsService.ListOutsideCollaborators - operations: - - GET /orgs/{org}/outside_collaborators - - name: OrganizationsService.ListPackages - operations: - - GET /orgs/{org}/packages - - name: OrganizationsService.ListPendingOrgInvitations - operations: - - GET /orgs/{org}/invitations - - name: OrganizationsService.ListProjects - operations: - - GET /orgs/{org}/projects - - name: OrganizationsService.ListSecurityManagerTeams - operations: - - GET /orgs/{org}/security-managers - - name: OrganizationsService.PackageDeleteVersion - operations: - - DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} - - name: OrganizationsService.PackageGetAllVersions - operations: - - GET /orgs/{org}/packages/{package_type}/{package_name}/versions - - name: OrganizationsService.PackageGetVersion - operations: - - GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} - - name: OrganizationsService.PackageRestoreVersion - operations: - - POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore - - name: OrganizationsService.PingHook - operations: - - POST /orgs/{org}/hooks/{hook_id}/pings - - name: OrganizationsService.PublicizeMembership - operations: - - PUT /orgs/{org}/public_members/{username} - - name: OrganizationsService.RedeliverHookDelivery - operations: - - POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts - - name: OrganizationsService.RemoveCredentialAuthorization - operations: - - DELETE /orgs/{org}/credential-authorizations/{credential_id} - - name: OrganizationsService.RemoveMember - operations: - - DELETE /orgs/{org}/members/{username} - - name: OrganizationsService.RemoveOrgMembership - operations: - - DELETE /orgs/{org}/memberships/{username} - - name: OrganizationsService.RemoveOutsideCollaborator - operations: - - DELETE /orgs/{org}/outside_collaborators/{username} - - name: OrganizationsService.RemoveSecurityManagerTeam - operations: - - DELETE /orgs/{org}/security-managers/teams/{team_slug} - - name: OrganizationsService.RestorePackage - operations: - - POST /orgs/{org}/packages/{package_type}/{package_name}/restore - - name: OrganizationsService.ReviewPersonalAccessTokenRequest - operations: - - POST /orgs/{org}/personal-access-token-requests/{pat_request_id} - - name: OrganizationsService.UnblockUser - operations: - - DELETE /orgs/{org}/blocks/{username} - - name: OrganizationsService.UpdateCustomRepoRole - operations: - - PATCH /orgs/{org}/custom-repository-roles/{role_id} - - name: OrganizationsService.UpdateOrganizationRuleset - operations: - - PUT /orgs/{org}/rulesets/{ruleset_id} - - name: ProjectsService.AddProjectCollaborator - operations: - - PUT /projects/{project_id}/collaborators/{username} - - name: ProjectsService.CreateProjectCard - operations: - - POST /projects/columns/{column_id}/cards - - name: ProjectsService.CreateProjectColumn - operations: - - POST /projects/{project_id}/columns - - name: ProjectsService.DeleteProject - operations: - - DELETE /projects/{project_id} - - name: ProjectsService.DeleteProjectCard - operations: - - DELETE /projects/columns/cards/{card_id} - - name: ProjectsService.DeleteProjectColumn - operations: - - DELETE /projects/columns/{column_id} - - name: ProjectsService.GetProject - operations: - - GET /projects/{project_id} - - name: ProjectsService.GetProjectCard - operations: - - GET /projects/columns/cards/{card_id} - - name: ProjectsService.GetProjectColumn - operations: - - GET /projects/columns/{column_id} - - name: ProjectsService.ListProjectCards - operations: - - GET /projects/columns/{column_id}/cards - - name: ProjectsService.ListProjectCollaborators - operations: - - GET /projects/{project_id}/collaborators - - name: ProjectsService.ListProjectColumns - operations: - - GET /projects/{project_id}/columns - - name: ProjectsService.MoveProjectCard - operations: - - POST /projects/columns/cards/{card_id}/moves - - name: ProjectsService.MoveProjectColumn - operations: - - POST /projects/columns/{column_id}/moves - - name: ProjectsService.RemoveProjectCollaborator - operations: - - DELETE /projects/{project_id}/collaborators/{username} - - name: ProjectsService.ReviewProjectCollaboratorPermission - operations: - - GET /projects/{project_id}/collaborators/{username}/permission - - name: ProjectsService.UpdateProject - operations: - - PATCH /projects/{project_id} - - name: ProjectsService.UpdateProjectCard - operations: - - PATCH /projects/columns/cards/{card_id} - - name: ProjectsService.UpdateProjectColumn - operations: - - PATCH /projects/columns/{column_id} - - name: PullRequestsService.Create - operations: - - POST /repos/{owner}/{repo}/pulls - - name: PullRequestsService.CreateComment - operations: - - POST /repos/{owner}/{repo}/pulls/{pull_number}/comments - - name: PullRequestsService.CreateCommentInReplyTo - operations: - - POST /repos/{owner}/{repo}/pulls/{pull_number}/comments - - name: PullRequestsService.CreateReview - operations: - - POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews - - name: PullRequestsService.DeleteComment - operations: - - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id} - - name: PullRequestsService.DeletePendingReview - operations: - - DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} - - name: PullRequestsService.DismissReview - operations: - - PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals - - name: PullRequestsService.Edit - operations: - - PATCH /repos/{owner}/{repo}/pulls/{pull_number} - - name: PullRequestsService.EditComment - operations: - - PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id} - - name: PullRequestsService.Get - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number} - - name: PullRequestsService.GetComment - operations: - - GET /repos/{owner}/{repo}/pulls/comments/{comment_id} - - name: PullRequestsService.GetRaw - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number} - - name: PullRequestsService.GetReview - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} - - name: PullRequestsService.IsMerged - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/merge - - name: PullRequestsService.List - operations: - - GET /repos/{owner}/{repo}/pulls - - name: PullRequestsService.ListComments - operations: - - GET /repos/{owner}/{repo}/pulls/comments - - GET /repos/{owner}/{repo}/pulls/{pull_number}/comments - - name: PullRequestsService.ListCommits - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/commits - - name: PullRequestsService.ListFiles - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/files - - name: PullRequestsService.ListPullRequestsWithCommit - operations: - - GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls - - name: PullRequestsService.ListReviewComments - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments - - name: PullRequestsService.ListReviewers - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers - - name: PullRequestsService.ListReviews - operations: - - GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews - - name: PullRequestsService.Merge - operations: - - PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge - - name: PullRequestsService.RemoveReviewers - operations: - - DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers - - name: PullRequestsService.RequestReviewers - operations: - - POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers - - name: PullRequestsService.SubmitReview - operations: - - POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events - - name: PullRequestsService.UpdateBranch - operations: - - PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch - - name: PullRequestsService.UpdateReview - operations: - - PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} - - name: ReactionsService.CreateCommentReaction - operations: - - POST /repos/{owner}/{repo}/comments/{comment_id}/reactions - - name: ReactionsService.CreateIssueCommentReaction - operations: - - POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions - - name: ReactionsService.CreateIssueReaction - operations: - - POST /repos/{owner}/{repo}/issues/{issue_number}/reactions - - name: ReactionsService.CreatePullRequestCommentReaction - operations: - - POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions - - name: ReactionsService.CreateReleaseReaction - operations: - - POST /repos/{owner}/{repo}/releases/{release_id}/reactions - - name: ReactionsService.CreateTeamDiscussionCommentReaction - operations: - - POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - - name: ReactionsService.CreateTeamDiscussionReaction - operations: - - POST /teams/{team_id}/discussions/{discussion_number}/reactions - - name: ReactionsService.DeleteCommentReaction - operations: - - DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeleteCommentReactionByID - operations: - - DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeleteIssueCommentReaction - operations: - - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeleteIssueCommentReactionByID - operations: - - DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeleteIssueReaction - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} - - name: ReactionsService.DeleteIssueReactionByID - operations: - - DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} - - name: ReactionsService.DeletePullRequestCommentReaction - operations: - - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeletePullRequestCommentReactionByID - operations: - - DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} - - name: ReactionsService.DeleteTeamDiscussionCommentReaction - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} - - name: ReactionsService.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions - - name: ReactionsService.DeleteTeamDiscussionReaction - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} - - name: ReactionsService.DeleteTeamDiscussionReactionByOrgIDAndTeamID - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions - - name: ReactionsService.ListCommentReactions - operations: - - GET /repos/{owner}/{repo}/comments/{comment_id}/reactions - - name: ReactionsService.ListIssueCommentReactions - operations: - - GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions - - name: ReactionsService.ListIssueReactions - operations: - - GET /repos/{owner}/{repo}/issues/{issue_number}/reactions - - name: ReactionsService.ListPullRequestCommentReactions - operations: - - GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions - - name: ReactionsService.ListTeamDiscussionCommentReactions - operations: - - GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - - name: ReactionsService.ListTeamDiscussionReactions - operations: - - GET /teams/{team_id}/discussions/{discussion_number}/reactions - - name: RepositoriesService.AddAdminEnforcement - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - - name: RepositoriesService.AddAppRestrictions - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - - name: RepositoriesService.AddAutolink - operations: - - POST /repos/{owner}/{repo}/autolinks - - name: RepositoriesService.AddCollaborator - operations: - - PUT /repos/{owner}/{repo}/collaborators/{username} - - name: RepositoriesService.AddTeamRestrictions - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - - name: RepositoriesService.AddUserRestrictions - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - - name: RepositoriesService.CompareCommits - operations: - - GET /repos/{owner}/{repo}/compare/{basehead} - - name: RepositoriesService.CompareCommitsRaw - operations: - - GET /repos/{owner}/{repo}/compare/{basehead} - - name: RepositoriesService.Create - operations: - - POST /orgs/{org}/repos - - POST /user/repos - - name: RepositoriesService.CreateComment - operations: - - POST /repos/{owner}/{repo}/commits/{commit_sha}/comments - - name: RepositoriesService.CreateDeployment - operations: - - POST /repos/{owner}/{repo}/deployments - - name: RepositoriesService.CreateDeploymentBranchPolicy - operations: - - POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies - - name: RepositoriesService.CreateDeploymentStatus - operations: - - POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses - - name: RepositoriesService.CreateFile - operations: - - PUT /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.CreateFork - operations: - - POST /repos/{owner}/{repo}/forks - - name: RepositoriesService.CreateFromTemplate - operations: - - POST /repos/{template_owner}/{template_repo}/generate - - name: RepositoriesService.CreateHook - operations: - - POST /repos/{owner}/{repo}/hooks - - name: RepositoriesService.CreateKey - operations: - - POST /repos/{owner}/{repo}/keys - - name: RepositoriesService.CreateProject - operations: - - POST /repos/{owner}/{repo}/projects - - name: RepositoriesService.CreateRelease - operations: - - POST /repos/{owner}/{repo}/releases - - name: RepositoriesService.CreateRuleset - operations: - - POST /repos/{owner}/{repo}/rulesets - - name: RepositoriesService.CreateStatus - operations: - - POST /repos/{owner}/{repo}/statuses/{sha} - - name: RepositoriesService.CreateTagProtection - operations: - - POST /repos/{owner}/{repo}/tags/protection - - name: RepositoriesService.CreateUpdateEnvironment - operations: - - PUT /repos/{owner}/{repo}/environments/{environment_name} - - name: RepositoriesService.Delete - operations: - - DELETE /repos/{owner}/{repo} - - name: RepositoriesService.DeleteAutolink - operations: - - DELETE /repos/{owner}/{repo}/autolinks/{autolink_id} - - name: RepositoriesService.DeleteComment - operations: - - DELETE /repos/{owner}/{repo}/comments/{comment_id} - - name: RepositoriesService.DeleteDeployment - operations: - - DELETE /repos/{owner}/{repo}/deployments/{deployment_id} - - name: RepositoriesService.DeleteDeploymentBranchPolicy - operations: - - DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} - - name: RepositoriesService.DeleteEnvironment - operations: - - DELETE /repos/{owner}/{repo}/environments/{environment_name} - - name: RepositoriesService.DeleteFile - operations: - - DELETE /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.DeleteHook - operations: - - DELETE /repos/{owner}/{repo}/hooks/{hook_id} - - name: RepositoriesService.DeleteInvitation - operations: - - DELETE /repos/{owner}/{repo}/invitations/{invitation_id} - - name: RepositoriesService.DeleteKey - operations: - - DELETE /repos/{owner}/{repo}/keys/{key_id} - - name: RepositoriesService.DeletePreReceiveHook - operations: - - DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - - name: RepositoriesService.DeleteRelease - operations: - - DELETE /repos/{owner}/{repo}/releases/{release_id} - - name: RepositoriesService.DeleteReleaseAsset - operations: - - DELETE /repos/{owner}/{repo}/releases/assets/{asset_id} - - name: RepositoriesService.DeleteRuleset - operations: - - DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} - - name: RepositoriesService.DeleteTagProtection - operations: - - DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} - - name: RepositoriesService.DisableAutomatedSecurityFixes - operations: - - DELETE /repos/{owner}/{repo}/automated-security-fixes - - name: RepositoriesService.DisableDismissalRestrictions - operations: - - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews - - name: RepositoriesService.DisableLFS - operations: - - DELETE /repos/{owner}/{repo}/lfs - - name: RepositoriesService.DisablePages - operations: - - DELETE /repos/{owner}/{repo}/pages - - name: RepositoriesService.DisablePrivateReporting - operations: - - DELETE /repos/{owner}/{repo}/private-vulnerability-reporting - - name: RepositoriesService.DisableVulnerabilityAlerts - operations: - - DELETE /repos/{owner}/{repo}/vulnerability-alerts - - name: RepositoriesService.Dispatch - operations: - - POST /repos/{owner}/{repo}/dispatches - - name: RepositoriesService.DownloadContents - operations: - - GET /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.DownloadContentsWithMeta - operations: - - GET /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.DownloadReleaseAsset - operations: - - GET /repos/{owner}/{repo}/releases/assets/{asset_id} - - name: RepositoriesService.Edit - operations: - - PATCH /repos/{owner}/{repo} - - name: RepositoriesService.EditActionsAccessLevel - operations: - - PUT /repos/{owner}/{repo}/actions/permissions/access - - name: RepositoriesService.EditActionsAllowed - operations: - - PUT /repos/{owner}/{repo}/actions/permissions/selected-actions - - name: RepositoriesService.EditActionsPermissions - operations: - - PUT /repos/{owner}/{repo}/actions/permissions - - name: RepositoriesService.EditHook - operations: - - PATCH /repos/{owner}/{repo}/hooks/{hook_id} - - name: RepositoriesService.EditHookConfiguration - operations: - - PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config - - name: RepositoriesService.EditRelease - operations: - - PATCH /repos/{owner}/{repo}/releases/{release_id} - - name: RepositoriesService.EditReleaseAsset - operations: - - PATCH /repos/{owner}/{repo}/releases/assets/{asset_id} - - name: RepositoriesService.EnableAutomatedSecurityFixes - operations: - - PUT /repos/{owner}/{repo}/automated-security-fixes - - name: RepositoriesService.EnableLFS - operations: - - PUT /repos/{owner}/{repo}/lfs - - name: RepositoriesService.EnablePages - operations: - - POST /repos/{owner}/{repo}/pages - - name: RepositoriesService.EnablePrivateReporting - operations: - - PUT /repos/{owner}/{repo}/private-vulnerability-reporting - - name: RepositoriesService.EnableVulnerabilityAlerts - operations: - - PUT /repos/{owner}/{repo}/vulnerability-alerts - - name: RepositoriesService.GenerateReleaseNotes - operations: - - POST /repos/{owner}/{repo}/releases/generate-notes - - name: RepositoriesService.Get - operations: - - GET /repos/{owner}/{repo} - - name: RepositoriesService.GetActionsAccessLevel - operations: - - GET /repos/{owner}/{repo}/actions/permissions/access - - name: RepositoriesService.GetActionsAllowed - operations: - - GET /repos/{owner}/{repo}/actions/permissions/selected-actions - - name: RepositoriesService.GetActionsPermissions - operations: - - GET /repos/{owner}/{repo}/actions/permissions - - name: RepositoriesService.GetAdminEnforcement - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - - name: RepositoriesService.GetAllRulesets - operations: - - GET /repos/{owner}/{repo}/rulesets - - name: RepositoriesService.GetArchiveLink - operations: - - GET /repos/{owner}/{repo}/tarball/{ref} - - GET /repos/{owner}/{repo}/zipball/{ref} - - name: RepositoriesService.GetAutolink - operations: - - GET /repos/{owner}/{repo}/autolinks/{autolink_id} - - name: RepositoriesService.GetAutomatedSecurityFixes - operations: - - GET /repos/{owner}/{repo}/automated-security-fixes - - name: RepositoriesService.GetBranch - operations: - - GET /repos/{owner}/{repo}/branches/{branch} - - name: RepositoriesService.GetBranchProtection - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection - - name: RepositoriesService.GetByID - operations: - - GET /repositories/{repository_id} - - name: RepositoriesService.GetCodeOfConduct - operations: - - GET /repos/{owner}/{repo} - - name: RepositoriesService.GetCodeownersErrors - operations: - - GET /repos/{owner}/{repo}/codeowners/errors - - name: RepositoriesService.GetCombinedStatus - operations: - - GET /repos/{owner}/{repo}/commits/{ref}/status - - name: RepositoriesService.GetComment - operations: - - GET /repos/{owner}/{repo}/comments/{comment_id} - - name: RepositoriesService.GetCommit - operations: - - GET /repos/{owner}/{repo}/commits/{ref} - - name: RepositoriesService.GetCommitRaw - operations: - - GET /repos/{owner}/{repo}/commits/{ref} - - name: RepositoriesService.GetCommitSHA1 - operations: - - GET /repos/{owner}/{repo}/commits/{ref} - - name: RepositoriesService.GetCommunityHealthMetrics - operations: - - GET /repos/{owner}/{repo}/community/profile - - name: RepositoriesService.GetContents - operations: - - GET /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.GetDeployment - operations: - - GET /repos/{owner}/{repo}/deployments/{deployment_id} - - name: RepositoriesService.GetDeploymentBranchPolicy - operations: - - GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} - - name: RepositoriesService.GetDeploymentStatus - operations: - - GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} - - name: RepositoriesService.GetEnvironment - operations: - - GET /repos/{owner}/{repo}/environments/{environment_name} - - name: RepositoriesService.GetHook - operations: - - GET /repos/{owner}/{repo}/hooks/{hook_id} - - name: RepositoriesService.GetHookConfiguration - operations: - - GET /repos/{owner}/{repo}/hooks/{hook_id}/config - - name: RepositoriesService.GetHookDelivery - operations: - - GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} - - name: RepositoriesService.GetKey - operations: - - GET /repos/{owner}/{repo}/keys/{key_id} - - name: RepositoriesService.GetLatestPagesBuild - operations: - - GET /repos/{owner}/{repo}/pages/builds/latest - - name: RepositoriesService.GetLatestRelease - operations: - - GET /repos/{owner}/{repo}/releases/latest - - name: RepositoriesService.GetPageBuild - operations: - - GET /repos/{owner}/{repo}/pages/builds/{build_id} - - name: RepositoriesService.GetPageHealthCheck - operations: - - GET /repos/{owner}/{repo}/pages/health - - name: RepositoriesService.GetPagesInfo - operations: - - GET /repos/{owner}/{repo}/pages - - name: RepositoriesService.GetPermissionLevel - operations: - - GET /repos/{owner}/{repo}/collaborators/{username}/permission - - name: RepositoriesService.GetPreReceiveHook - operations: - - GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - - name: RepositoriesService.GetPullRequestReviewEnforcement - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews - - name: RepositoriesService.GetReadme - operations: - - GET /repos/{owner}/{repo}/readme - - name: RepositoriesService.GetRelease - operations: - - GET /repos/{owner}/{repo}/releases/{release_id} - - name: RepositoriesService.GetReleaseAsset - operations: - - GET /repos/{owner}/{repo}/releases/assets/{asset_id} - - name: RepositoriesService.GetReleaseByTag - operations: - - GET /repos/{owner}/{repo}/releases/tags/{tag} - - name: RepositoriesService.GetRequiredStatusChecks - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - - name: RepositoriesService.GetRulesForBranch - operations: - - GET /repos/{owner}/{repo}/rules/branches/{branch} - - name: RepositoriesService.GetRuleset - operations: - - GET /repos/{owner}/{repo}/rulesets/{ruleset_id} - - name: RepositoriesService.GetSignaturesProtectedBranch - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - - name: RepositoriesService.GetVulnerabilityAlerts - operations: - - GET /repos/{owner}/{repo}/vulnerability-alerts - - name: RepositoriesService.IsCollaborator - operations: - - GET /repos/{owner}/{repo}/collaborators/{username} - - name: RepositoriesService.License - operations: - - GET /repos/{owner}/{repo}/license - - name: RepositoriesService.List - operations: - - GET /user/repos - - GET /users/{username}/repos - - name: RepositoriesService.ListAll - operations: - - GET /repositories - - name: RepositoriesService.ListAllTopics - operations: - - GET /repos/{owner}/{repo}/topics - - name: RepositoriesService.ListAppRestrictions - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - - name: RepositoriesService.ListApps - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - - name: RepositoriesService.ListAutolinks - operations: - - GET /repos/{owner}/{repo}/autolinks - - name: RepositoriesService.ListBranches - operations: - - GET /repos/{owner}/{repo}/branches - - name: RepositoriesService.ListBranchesHeadCommit - operations: - - GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head - - name: RepositoriesService.ListByOrg - operations: - - GET /orgs/{org}/repos - - name: RepositoriesService.ListCodeFrequency - operations: - - GET /repos/{owner}/{repo}/stats/code_frequency - - name: RepositoriesService.ListCollaborators - operations: - - GET /repos/{owner}/{repo}/collaborators - - name: RepositoriesService.ListComments - operations: - - GET /repos/{owner}/{repo}/comments - - name: RepositoriesService.ListCommitActivity - operations: - - GET /repos/{owner}/{repo}/stats/commit_activity - - name: RepositoriesService.ListCommitComments - operations: - - GET /repos/{owner}/{repo}/commits/{commit_sha}/comments - - name: RepositoriesService.ListCommits - operations: - - GET /repos/{owner}/{repo}/commits - - name: RepositoriesService.ListContributors - operations: - - GET /repos/{owner}/{repo}/contributors - - name: RepositoriesService.ListContributorsStats - operations: - - GET /repos/{owner}/{repo}/stats/contributors - - name: RepositoriesService.ListDeploymentBranchPolicies - operations: - - GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies - - name: RepositoriesService.ListDeploymentStatuses - operations: - - GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses - - name: RepositoriesService.ListDeployments - operations: - - GET /repos/{owner}/{repo}/deployments - - name: RepositoriesService.ListEnvironments - operations: - - GET /repos/{owner}/{repo}/environments - - name: RepositoriesService.ListForks - operations: - - GET /repos/{owner}/{repo}/forks - - name: RepositoriesService.ListHookDeliveries - operations: - - GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries - - name: RepositoriesService.ListHooks - operations: - - GET /repos/{owner}/{repo}/hooks - - name: RepositoriesService.ListInvitations - operations: - - GET /repos/{owner}/{repo}/invitations - - name: RepositoriesService.ListKeys - operations: - - GET /repos/{owner}/{repo}/keys - - name: RepositoriesService.ListLanguages - operations: - - GET /repos/{owner}/{repo}/languages - - name: RepositoriesService.ListPagesBuilds - operations: - - GET /repos/{owner}/{repo}/pages/builds - - name: RepositoriesService.ListParticipation - operations: - - GET /repos/{owner}/{repo}/stats/participation - - name: RepositoriesService.ListPreReceiveHooks - operations: - - GET /repos/{owner}/{repo}/pre-receive-hooks - - name: RepositoriesService.ListProjects - operations: - - GET /repos/{owner}/{repo}/projects - - name: RepositoriesService.ListPunchCard - operations: - - GET /repos/{owner}/{repo}/stats/punch_card - - name: RepositoriesService.ListReleaseAssets - operations: - - GET /repos/{owner}/{repo}/releases/{release_id}/assets - - name: RepositoriesService.ListReleases - operations: - - GET /repos/{owner}/{repo}/releases - - name: RepositoriesService.ListRequiredStatusChecksContexts - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts - - name: RepositoriesService.ListStatuses - operations: - - GET /repos/{owner}/{repo}/commits/{ref}/statuses - - name: RepositoriesService.ListTagProtection - operations: - - GET /repos/{owner}/{repo}/tags/protection - - name: RepositoriesService.ListTags - operations: - - GET /repos/{owner}/{repo}/tags - - name: RepositoriesService.ListTeamRestrictions - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - - name: RepositoriesService.ListTeams - operations: - - GET /repos/{owner}/{repo}/teams - - name: RepositoriesService.ListTrafficClones - operations: - - GET /repos/{owner}/{repo}/traffic/clones - - name: RepositoriesService.ListTrafficPaths - operations: - - GET /repos/{owner}/{repo}/traffic/popular/paths - - name: RepositoriesService.ListTrafficReferrers - operations: - - GET /repos/{owner}/{repo}/traffic/popular/referrers - - name: RepositoriesService.ListTrafficViews - operations: - - GET /repos/{owner}/{repo}/traffic/views - - name: RepositoriesService.ListUserRestrictions - operations: - - GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - - name: RepositoriesService.Merge - operations: - - POST /repos/{owner}/{repo}/merges - - name: RepositoriesService.MergeUpstream - operations: - - POST /repos/{owner}/{repo}/merge-upstream - - name: RepositoriesService.OptionalSignaturesOnProtectedBranch - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - - name: RepositoriesService.PingHook - operations: - - POST /repos/{owner}/{repo}/hooks/{hook_id}/pings - - name: RepositoriesService.RedeliverHookDelivery - operations: - - POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts - - name: RepositoriesService.RemoveAdminEnforcement - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - - name: RepositoriesService.RemoveAppRestrictions - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - - name: RepositoriesService.RemoveBranchProtection - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection - - name: RepositoriesService.RemoveCollaborator - operations: - - DELETE /repos/{owner}/{repo}/collaborators/{username} - - name: RepositoriesService.RemovePullRequestReviewEnforcement - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews - - name: RepositoriesService.RemoveRequiredStatusChecks - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - - name: RepositoriesService.RemoveTeamRestrictions - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - - name: RepositoriesService.RemoveUserRestrictions - operations: - - DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - - name: RepositoriesService.RenameBranch - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/rename - - name: RepositoriesService.ReplaceAllTopics - operations: - - PUT /repos/{owner}/{repo}/topics - - name: RepositoriesService.ReplaceAppRestrictions - operations: - - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - - name: RepositoriesService.ReplaceTeamRestrictions - operations: - - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams - - name: RepositoriesService.ReplaceUserRestrictions - operations: - - PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - - name: RepositoriesService.RequestPageBuild - operations: - - POST /repos/{owner}/{repo}/pages/builds - - name: RepositoriesService.RequireSignaturesOnProtectedBranch - operations: - - POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - - name: RepositoriesService.Subscribe - operations: - - POST /hub - - name: RepositoriesService.TestHook - operations: - - POST /repos/{owner}/{repo}/hooks/{hook_id}/tests - - name: RepositoriesService.Transfer - operations: - - POST /repos/{owner}/{repo}/transfer - - name: RepositoriesService.Unsubscribe - operations: - - POST /hub - - name: RepositoriesService.UpdateBranchProtection - operations: - - PUT /repos/{owner}/{repo}/branches/{branch}/protection - - name: RepositoriesService.UpdateComment - operations: - - PATCH /repos/{owner}/{repo}/comments/{comment_id} - - name: RepositoriesService.UpdateDeploymentBranchPolicy - operations: - - PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id} - - name: RepositoriesService.UpdateFile - operations: - - PUT /repos/{owner}/{repo}/contents/{path} - - name: RepositoriesService.UpdateInvitation - operations: - - PATCH /repos/{owner}/{repo}/invitations/{invitation_id} - - name: RepositoriesService.UpdatePages - operations: - - PUT /repos/{owner}/{repo}/pages - - name: RepositoriesService.UpdatePreReceiveHook - operations: - - PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} - - name: RepositoriesService.UpdatePullRequestReviewEnforcement - operations: - - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews - - name: RepositoriesService.UpdateRequiredStatusChecks - operations: - - PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks - - name: RepositoriesService.UpdateRuleset - operations: - - PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} - - name: RepositoriesService.UploadReleaseAsset - operations: - - POST /repos/{owner}/{repo}/releases/{release_id}/assets - - name: SCIMService.DeleteSCIMUserFromOrg - operations: - - DELETE /scim/v2/organizations/{org}/Users/{scim_user_id} - - name: SCIMService.GetSCIMProvisioningInfoForUser - operations: - - GET /scim/v2/organizations/{org}/Users/{scim_user_id} - - name: SCIMService.ListSCIMProvisionedIdentities - operations: - - GET /scim/v2/organizations/{org}/Users - - name: SCIMService.ProvisionAndInviteSCIMUser - operations: - - POST /scim/v2/organizations/{org}/Users - - name: SCIMService.UpdateAttributeForSCIMUser - operations: - - PATCH /scim/v2/organizations/{org}/Users/{scim_user_id} - - name: SCIMService.UpdateProvisionedOrgMembership - operations: - - PUT /scim/v2/organizations/{org}/Users/{scim_user_id} - - name: SearchService.Code - operations: - - GET /search/code - - name: SearchService.Commits - operations: - - GET /search/commits - - name: SearchService.Issues - operations: - - GET /search/issues - - name: SearchService.Labels - operations: - - GET /search/labels - - name: SearchService.Repositories - operations: - - GET /search/repositories - - name: SearchService.Topics - operations: - - GET /search/topics - - name: SearchService.Users - operations: - - GET /search/users - - name: SecretScanningService.GetAlert - operations: - - GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} - - name: SecretScanningService.ListAlertsForEnterprise - operations: - - GET /enterprises/{enterprise}/secret-scanning/alerts - - name: SecretScanningService.ListAlertsForOrg - operations: - - GET /orgs/{org}/secret-scanning/alerts - - name: SecretScanningService.ListAlertsForRepo - operations: - - GET /repos/{owner}/{repo}/secret-scanning/alerts - - name: SecretScanningService.ListLocationsForAlert - operations: - - GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations - - name: SecretScanningService.UpdateAlert - operations: - - PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} - - name: SecurityAdvisoriesService.ListRepositorySecurityAdvisories - operations: - - GET /repos/{owner}/{repo}/security-advisories - - name: SecurityAdvisoriesService.ListRepositorySecurityAdvisoriesForOrg - operations: - - GET /orgs/{org}/security-advisories - - name: SecurityAdvisoriesService.RequestCVE - operations: - - POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve - - name: TeamsService.AddTeamMembershipByID - operations: - - PUT /orgs/{org}/teams/{team_slug}/memberships/{username} - - name: TeamsService.AddTeamMembershipBySlug - operations: - - PUT /orgs/{org}/teams/{team_slug}/memberships/{username} - - name: TeamsService.AddTeamProjectByID - operations: - - PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.AddTeamProjectBySlug - operations: - - PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.AddTeamRepoByID - operations: - - PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.AddTeamRepoBySlug - operations: - - PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.CreateCommentByID - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - - name: TeamsService.CreateCommentBySlug - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - - name: TeamsService.CreateDiscussionByID - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions - - name: TeamsService.CreateDiscussionBySlug - operations: - - POST /orgs/{org}/teams/{team_slug}/discussions - - name: TeamsService.CreateOrUpdateIDPGroupConnectionsByID - operations: - - PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings - - name: TeamsService.CreateOrUpdateIDPGroupConnectionsBySlug - operations: - - PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings - - name: TeamsService.CreateTeam - operations: - - POST /orgs/{org}/teams - - name: TeamsService.DeleteCommentByID - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.DeleteCommentBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.DeleteDiscussionByID - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.DeleteDiscussionBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.DeleteTeamByID - operations: - - DELETE /orgs/{org}/teams/{team_slug} - - name: TeamsService.DeleteTeamBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug} - - name: TeamsService.EditCommentByID - operations: - - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.EditCommentBySlug - operations: - - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.EditDiscussionByID - operations: - - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.EditDiscussionBySlug - operations: - - PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.EditTeamByID - operations: - - PATCH /orgs/{org}/teams/{team_slug} - - name: TeamsService.EditTeamBySlug - operations: - - PATCH /orgs/{org}/teams/{team_slug} - - name: TeamsService.GetCommentByID - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.GetCommentBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - - name: TeamsService.GetDiscussionByID - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.GetDiscussionBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - - name: TeamsService.GetExternalGroup - operations: - - GET /orgs/{org}/external-group/{group_id} - - name: TeamsService.GetTeamByID - operations: - - GET /orgs/{org}/teams/{team_slug} - - name: TeamsService.GetTeamBySlug - operations: - - GET /orgs/{org}/teams/{team_slug} - - name: TeamsService.GetTeamMembershipByID - operations: - - GET /orgs/{org}/teams/{team_slug}/members - - name: TeamsService.GetTeamMembershipBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/memberships/{username} - - name: TeamsService.IsTeamRepoByID - operations: - - GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.IsTeamRepoBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.ListChildTeamsByParentID - operations: - - GET /orgs/{org}/teams/{team_slug}/teams - - name: TeamsService.ListChildTeamsByParentSlug - operations: - - GET /orgs/{org}/teams/{team_slug}/teams - - name: TeamsService.ListCommentsByID - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - - name: TeamsService.ListCommentsBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - - name: TeamsService.ListDiscussionsByID - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions - - name: TeamsService.ListDiscussionsBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/discussions - - name: TeamsService.ListExternalGroups - operations: - - GET /orgs/{org}/external-groups - - name: TeamsService.ListExternalGroupsForTeamBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/external-groups - - name: TeamsService.ListIDPGroupsForTeamByID - operations: - - GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings - - name: TeamsService.ListIDPGroupsForTeamBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings - - name: TeamsService.ListIDPGroupsInOrganization - operations: - - GET /orgs/{org}/team-sync/groups - - name: TeamsService.ListPendingTeamInvitationsByID - operations: - - GET /orgs/{org}/teams/{team_slug}/invitations - - name: TeamsService.ListPendingTeamInvitationsBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/invitations - - name: TeamsService.ListTeamMembersByID - operations: - - GET /orgs/{org}/teams/{team_slug}/members - - name: TeamsService.ListTeamMembersBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/members - - name: TeamsService.ListTeamProjectsByID - operations: - - GET /orgs/{org}/teams/{team_slug}/projects - - name: TeamsService.ListTeamProjectsBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/projects - - name: TeamsService.ListTeamReposByID - operations: - - GET /orgs/{org}/teams/{team_slug}/repos - - name: TeamsService.ListTeamReposBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/repos - - name: TeamsService.ListTeams - operations: - - GET /orgs/{org}/teams - - name: TeamsService.ListUserTeams - operations: - - GET /user/teams - - name: TeamsService.RemoveConnectedExternalGroup - operations: - - DELETE /orgs/{org}/teams/{team_slug}/external-groups - - name: TeamsService.RemoveTeamMembershipByID - operations: - - DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} - - name: TeamsService.RemoveTeamMembershipBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug}/memberships/{username} - - name: TeamsService.RemoveTeamProjectByID - operations: - - DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.RemoveTeamProjectBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.RemoveTeamRepoByID - operations: - - DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.RemoveTeamRepoBySlug - operations: - - DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - - name: TeamsService.ReviewTeamProjectsByID - operations: - - GET /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.ReviewTeamProjectsBySlug - operations: - - GET /orgs/{org}/teams/{team_slug}/projects/{project_id} - - name: TeamsService.UpdateConnectedExternalGroup - operations: - - PATCH /orgs/{org}/teams/{team_slug}/external-groups - - name: UsersService.AcceptInvitation - operations: - - PATCH /user/repository_invitations/{invitation_id} - - name: UsersService.AddEmails - operations: - - POST /user/emails - - name: UsersService.BlockUser - operations: - - PUT /user/blocks/{username} - - name: UsersService.CreateGPGKey - operations: - - POST /user/gpg_keys - - name: UsersService.CreateKey - operations: - - POST /user/keys - - name: UsersService.CreateProject - operations: - - POST /user/projects - - name: UsersService.CreateSSHSigningKey - operations: - - POST /user/ssh_signing_keys - - name: UsersService.DeclineInvitation - operations: - - DELETE /user/repository_invitations/{invitation_id} - - name: UsersService.DeleteEmails - operations: - - DELETE /user/emails - - name: UsersService.DeleteGPGKey - operations: - - DELETE /user/gpg_keys/{gpg_key_id} - - name: UsersService.DeleteKey - operations: - - DELETE /user/keys/{key_id} - - name: UsersService.DeletePackage - operations: - - DELETE /user/packages/{package_type}/{package_name} - - DELETE /users/{username}/packages/{package_type}/{package_name} - - name: UsersService.DeleteSSHSigningKey - operations: - - DELETE /user/ssh_signing_keys/{ssh_signing_key_id} - - name: UsersService.DemoteSiteAdmin - operations: - - DELETE /users/{username}/site_admin - - name: UsersService.Edit - operations: - - PATCH /user - - name: UsersService.Follow - operations: - - PUT /user/following/{username} - - name: UsersService.Get - operations: - - GET /user - - GET /users/{username} - - name: UsersService.GetByID - operations: - - GET /user/{user_id} - - name: UsersService.GetGPGKey - operations: - - GET /user/gpg_keys/{gpg_key_id} - - name: UsersService.GetHovercard - operations: - - GET /users/{username}/hovercard - - name: UsersService.GetKey - operations: - - GET /user/keys/{key_id} - - name: UsersService.GetPackage - operations: - - GET /user/packages/{package_type}/{package_name} - - GET /users/{username}/packages/{package_type}/{package_name} - - name: UsersService.GetSSHSigningKey - operations: - - GET /user/ssh_signing_keys/{ssh_signing_key_id} - - name: UsersService.IsBlocked - operations: - - GET /user/blocks/{username} - - name: UsersService.IsFollowing - operations: - - GET /user/following/{username} - - GET /users/{username}/following/{target_user} - - name: UsersService.ListAll - operations: - - GET /users - - name: UsersService.ListBlockedUsers - operations: - - GET /user/blocks - - name: UsersService.ListEmails - operations: - - GET /user/emails - - name: UsersService.ListFollowers - operations: - - GET /user/followers - - GET /users/{username}/followers - - name: UsersService.ListFollowing - operations: - - GET /user/following - - GET /users/{username}/following - - name: UsersService.ListGPGKeys - operations: - - GET /user/gpg_keys - - GET /users/{username}/gpg_keys - - name: UsersService.ListInvitations - operations: - - GET /user/repository_invitations - - name: UsersService.ListKeys - operations: - - GET /user/keys - - GET /users/{username}/keys - - name: UsersService.ListPackages - operations: - - GET /user/packages - - GET /users/{username}/packages - - name: UsersService.ListProjects - operations: - - GET /users/{username}/projects - - name: UsersService.ListSSHSigningKeys - operations: - - GET /user/ssh_signing_keys - - GET /users/{username}/ssh_signing_keys - - name: UsersService.PackageDeleteVersion - operations: - - DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id} - - DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} - - name: UsersService.PackageGetAllVersions - operations: - - GET /user/packages/{package_type}/{package_name}/versions - - GET /users/{username}/packages/{package_type}/{package_name}/versions - - name: UsersService.PackageGetVersion - operations: - - GET /user/packages/{package_type}/{package_name}/versions/{package_version_id} - - GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} - - name: UsersService.PackageRestoreVersion - operations: - - POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore - - POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore - - name: UsersService.PromoteSiteAdmin - operations: - - PUT /users/{username}/site_admin - - name: UsersService.RestorePackage - operations: - - POST /user/packages/{package_type}/{package_name}/restore - - POST /users/{username}/packages/{package_type}/{package_name}/restore - - name: UsersService.SetEmailVisibility - operations: - - PATCH /user/email/visibility - - name: UsersService.Suspend - operations: - - PUT /users/{username}/suspended - - name: UsersService.UnblockUser - operations: - - DELETE /user/blocks/{username} - - name: UsersService.Unfollow - operations: - - DELETE /user/following/{username} - - name: UsersService.Unsuspend - operations: - - DELETE /users/{username}/suspended operations: - name: POST /hub documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub diff --git a/script/lint.sh b/script/lint.sh index d3d1c764ad2..b76758a47d4 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -1,6 +1,6 @@ #!/bin/sh #/ [ CHECK_GITHUB_OPENAPI=1 ] script/lint.sh runs linters and validates generated files. -#/ When CHECK_GITHUB is set, it validates that metadata.yaml is consistent with the +#/ When CHECK_GITHUB is set, it validates that openapi_operations.yaml is consistent with the #/ descriptions from github.com/github/rest-api-description. set -e @@ -12,6 +12,13 @@ BIN="$(pwd -P)"/bin mkdir -p "$BIN" +EXIT_CODE=0 + +fail() { + echo "$@" + EXIT_CODE=1 +} + # install golangci-lint bin/golangci-lint doesn't exist with the correct version if ! "$BIN"/golangci-lint --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" @@ -30,19 +37,17 @@ for dir in $MOD_DIRS; do else "$BIN"/golangci-lint run --path-prefix "$dir" fi - ) || FAILED=1 + ) || fail "failed linting $dir" done -echo validating metadata.yaml if [ -n "$CHECK_GITHUB_OPENAPI" ]; then - script/metadata.sh validate --check-github || FAILED=1 -else - script/metadata.sh validate || FAILED=1 + echo validating openapi_operations.yaml + script/metadata.sh update-openapi --validate || fail "failed validating openapi_operations.yaml" fi echo validating generated files -script/generate.sh --check || FAILED=1 +script/generate.sh --check || fail "failed validating generated files" -if [ -n "$FAILED" ]; then - exit 1 -fi +[ -z "$FAILED" ] || exit 1 + +exit "$EXIT_CODE" diff --git a/script/test.sh b/script/test.sh index 23e6a0c8f84..dedd832ecad 100755 --- a/script/test.sh +++ b/script/test.sh @@ -1,6 +1,8 @@ #!/bin/sh #/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation. #/ "-race -covermode atomic ./..." is used when no arguments are given. +#/ +#/ When UPDATE_GOLDEN is set, all directories named "golden" are removed before running tests. set -e @@ -10,6 +12,10 @@ if [ "$#" = "0" ]; then set -- -race -covermode atomic ./... fi +if [ -n "$UPDATE_GOLDEN" ]; then + find . -name golden -type d -exec rm -rf {} + +fi + MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" for dir in $MOD_DIRS; do diff --git a/tools/metadata/main.go b/tools/metadata/main.go index ca9538e4e8f..4c852785eb4 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -17,45 +17,52 @@ import ( ) var helpVars = kong.Vars{ - "update_openapi_help": `Update metadata.yaml from OpenAPI descriptions in github.com/github/rest-api-description.`, - "update_doc_urls_help": `Update documentation urls in the Go source files in the github directory to match the urls in the metadata file.`, - "format_help": `Format metadata.yaml.`, - "validate_help": `Validate that metadata.yaml is consistent with source code.`, - "unused_ops_help": `List operations in metadata.yaml that don't have any associated go methods'.`, - "canonize_help": `Update metadata.yaml to use canonical operation names.`, - "working_dir_help": `Working directory. Should be the root of the go-github repository.`, - "filename_help": `Path to metadata.yaml. Defaults to /metadata.yaml.`, - "github_dir_help": `Path to the github package. Defaults to /github.`, - "openapi_ref_help": `Git ref to pull OpenAPI descriptions from.`, - "output_json_help": `Output JSON.`, - "validate_github_help": `Check that metadata.yaml is consistent with the OpenAPI descriptions in github.com/github/rest-api-description.`, + "update_openapi_help": ` +Update openapi_operations.yaml from OpenAPI descriptions in github.com/github/rest-api-description at the given git ref. +`, + + "update_go_help": ` +Update go source code to be consistent with openapi_operations.yaml. + - Adds and updates "// GitHub API docs:" comments for service methods. + - Updates "//meta:operation" comments to use canonical operation names. + - Updates formatting of "//meta:operation" comments to make sure there isn't a space between the "//" and the "meta". + - Formats modified files with the equivalent of "go fmt". +`, + + "format_help": `Format whitespace in openapi_operations.yaml and sort its operations.`, + "unused_help": `List operations in openapi_operations.yaml that aren't used by any service methods.`, + + "working_dir_help": `Working directory. Should be the root of the go-github repository.`, + "openapi_ref_help": `Git ref to pull OpenAPI descriptions from.`, + + "openapi_validate_help": ` +Instead of updating, make sure that the operations in openapi_operations.yaml's "openapi_operations" field are +consistent with the sha listed in "openapi_commit". This is run in CI as a convenience so that reviewers can trust +changes to openapi_operations.yaml. +`, + + "output_json_help": `Output JSON.`, } type rootCmd struct { - WorkingDir string `kong:"short=C,default=.,help=${working_dir_help}"` - Filename string `kong:"help=${filename_help}"` - GithubDir string `kong:"help=${github_dir_help}"` UpdateOpenAPI updateOpenAPICmd `kong:"cmd,name=update-openapi,help=${update_openapi_help}"` - UpdateDocURLs updateDocURLsCmd `kong:"cmd,name=update-doc-urls,help=${update_doc_urls_help}"` + UpdateGo updateGoCmd `kong:"cmd,help=${update_go_help}"` Format formatCmd `kong:"cmd,help=${format_help}"` - Validate validateCmd `kong:"cmd,help=${validate_help}"` - UnusedOps unusedOpsCmd `kong:"cmd,help=${unused_ops_help}"` - Canonize canonizeCmd `kong:"cmd,help=${canonize_help}"` + Unused unusedCmd `kong:"cmd,help=${unused_help}"` + + WorkingDir string `kong:"short=C,default=.,help=${working_dir_help}"` // for testing GithubURL string `kong:"hidden,default='https://api.github.com'"` } -func (c *rootCmd) metadata() (string, *metadata, error) { - filename := c.Filename - if filename == "" { - filename = filepath.Join(c.WorkingDir, "metadata.yaml") - } - meta, err := loadMetadataFile(filename) +func (c *rootCmd) opsFile() (string, *operationsFile, error) { + filename := filepath.Join(c.WorkingDir, "openapi_operations.yaml") + opsFile, err := loadOperationsFile(filename) if err != nil { return "", nil, err } - return filename, meta, nil + return filename, opsFile, nil } func githubClient(apiURL string) (*github.Client, error) { @@ -67,135 +74,102 @@ func githubClient(apiURL string) (*github.Client, error) { } type updateOpenAPICmd struct { - Ref string `kong:"default=main,help=${openapi_ref_help}"` + Ref string `kong:"default=main,help=${openapi_ref_help}"` + ValidateGithub bool `kong:"name=validate,help=${openapi_validate_help}"` } func (c *updateOpenAPICmd) Run(root *rootCmd) error { ctx := context.Background() - filename, meta, err := root.metadata() + if c.ValidateGithub && c.Ref != "main" { + return fmt.Errorf("--validate and --ref are mutually exclusive") + } + filename, opsFile, err := root.opsFile() if err != nil { return err } + origOps := make([]*operation, len(opsFile.OpenapiOps)) + copy(origOps, opsFile.OpenapiOps) + for i := range origOps { + origOps[i] = origOps[i].clone() + } client, err := githubClient(root.GithubURL) if err != nil { return err } - - err = meta.updateFromGithub(ctx, client, c.Ref) + ref := c.Ref + if c.ValidateGithub { + ref = opsFile.GitCommit + if ref == "" { + return fmt.Errorf("openapi_operations.yaml does not have an openapi_commit field") + } + } + err = opsFile.updateFromGithub(ctx, client, ref) if err != nil { return err } - return meta.saveFile(filename) + if !c.ValidateGithub { + return opsFile.saveFile(filename) + } + if !operationsEqual(origOps, opsFile.OpenapiOps) { + return fmt.Errorf("openapi_operations.yaml does not match the OpenAPI descriptions in github.com/github/rest-api-description") + } + return nil } type formatCmd struct{} func (c *formatCmd) Run(root *rootCmd) error { - filename, meta, err := root.metadata() + filename, opsFile, err := root.opsFile() if err != nil { return err } - return meta.saveFile(filename) + return opsFile.saveFile(filename) } -type validateCmd struct { - CheckGithub bool `kong:"help=${validate_github_help}"` -} +type updateGoCmd struct{} -func (c *validateCmd) Run(k *kong.Context, root *rootCmd) error { - ctx := context.Background() - githubDir := filepath.Join(root.WorkingDir, "github") - filename, meta, err := root.metadata() +func (c *updateGoCmd) Run(root *rootCmd) error { + _, opsFile, err := root.opsFile() if err != nil { return err } - issues, err := validateMetadata(githubDir, meta) - if err != nil { - return err - } - // don't waste time checking github if there are already issues - if c.CheckGithub && len(issues) == 0 { - client, err := githubClient(root.GithubURL) - if err != nil { - return err - } - msg, err := validateGitCommit(ctx, client, meta) - if err != nil { - return err - } - if msg != "" { - issues = append(issues, msg) - } - } - if len(issues) == 0 { - return nil - } - for _, issue := range issues { - fmt.Fprintln(k.Stderr, issue) - } - return fmt.Errorf("found %d issues in %s", len(issues), filename) -} - -type updateDocURLsCmd struct{} - -func (c *updateDocURLsCmd) Run(root *rootCmd) error { - githubDir := filepath.Join(root.WorkingDir, "github") - _, meta, err := root.metadata() - if err != nil { - return err - } - err = updateDocLinks(meta, githubDir) + err = updateDocs(opsFile, filepath.Join(root.WorkingDir, "github")) return err } -type unusedOpsCmd struct { +type unusedCmd struct { JSON bool `kong:"help=${output_json_help}"` } -func (c *unusedOpsCmd) Run(root *rootCmd) error { - _, meta, err := root.metadata() +func (c *unusedCmd) Run(root *rootCmd, k *kong.Context) error { + _, opsFile, err := root.opsFile() if err != nil { return err } - var unused []*operation - for _, op := range meta.operations() { - goMethods := meta.operationMethods(op.Name) - if len(goMethods) == 0 { - unused = append(unused, op) - } + unused, err := unusedOps(opsFile, filepath.Join(root.WorkingDir, "github")) + if err != nil { + return err } if c.JSON { - enc := json.NewEncoder(os.Stdout) + enc := json.NewEncoder(k.Stdout) enc.SetIndent("", " ") return enc.Encode(unused) } - fmt.Printf("Found %d unused operations\n", len(unused)) + fmt.Fprintf(k.Stdout, "Found %d unused operations\n", len(unused)) if len(unused) == 0 { return nil } - fmt.Println("") + fmt.Fprintln(k.Stdout, "") for _, op := range unused { - fmt.Println(op.Name) - fmt.Printf("doc: %s\n", op.DocumentationURL) - fmt.Println("") + fmt.Fprintln(k.Stdout, op.Name) + if op.DocumentationURL != "" { + fmt.Fprintf(k.Stdout, "doc: %s\n", op.DocumentationURL) + } + fmt.Fprintln(k.Stdout, "") } return nil } -type canonizeCmd struct{} - -func (c *canonizeCmd) Run(root *rootCmd) error { - filename, meta, err := root.metadata() - if err != nil { - return err - } - err = meta.canonizeMethodOperations() - if err != nil { - return err - } - return meta.saveFile(filename) -} - func main() { err := run(os.Args[1:], nil) if err != nil { diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 27ba2bc279d..39fe5357d0f 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -26,34 +26,43 @@ import ( "github.com/google/go-github/v56/github" ) -func TestUpdateDocURLs(t *testing.T) { - res := runTest(t, "testdata/update-doc-urls", "update-doc-urls") - res.assertOutput("", "") - res.assertNoErr() - res.checkGolden() -} - -func TestValidate(t *testing.T) { - t.Run("invalid", func(t *testing.T) { - res := runTest(t, "testdata/validate_invalid", "validate") - res.assertErr("found 4 issues in") - res.assertOutput("", ` -Method AService.MissingFromMetadata does not exist in metadata.yaml. Please add it. -Method AService.Get has operation which is does not use the canonical name. You may be able to automatically fix this by running 'script/metadata.sh canonize': GET /a/{a_id_noncanonical}. -Name in override_operations does not exist in operations or openapi_operations: GET /a/{a_id_noncanonical2} -Name in override_operations does not exist in operations or openapi_operations: GET /fake/{a_id} -`) +func TestUpdateGo(t *testing.T) { + t.Run("valid", func(t *testing.T) { + res := runTest(t, "testdata/update-go/valid", "update-go") + res.assertOutput("", "") + res.assertNoErr() res.checkGolden() }) - t.Run("valid", func(t *testing.T) { - res := runTest(t, "testdata/validate_valid", "validate") + t.Run("invalid", func(t *testing.T) { + res := runTest(t, "testdata/update-go/invalid", "update-go") res.assertOutput("", "") - res.assertNoErr() + res.assertErr(` +no operations defined for AService.NoOperation +no operations defined for AService.NoComment +ambiguous operation "GET /ambiguous/{}" could match any of: [GET /ambiguous/{id} GET /ambiguous/{name}] +could not find operation "GET /missing/{id}" in openapi_operations.yaml +duplicate operation: GET /a/{a_id} +`) res.checkGolden() }) } +func TestUnused(t *testing.T) { + res := runTest(t, "testdata/unused", "unused") + res.assertOutput(` +Found 3 unused operations + +GET /a/{a_id} +doc: https://docs.github.com/rest/a/a#overridden-get-a + +POST /a/{a_id} +doc: https://docs.github.com/rest/a/a#update-a + +GET /undocumented/{undocumented_id} +`, "") +} + func TestUpdateOpenAPI(t *testing.T) { testServer := newTestServer(t, "main", map[string]interface{}{ "api.github.com/api.github.com.json": openapi3.T{ @@ -119,13 +128,6 @@ func TestUpdateOpenAPI(t *testing.T) { res.checkGolden() } -func TestCanonize(t *testing.T) { - res := runTest(t, "testdata/canonize", "canonize") - res.assertOutput("", "") - res.assertNoErr() - res.checkGolden() -} - func TestFormat(t *testing.T) { res := runTest(t, "testdata/format", "format") res.assertOutput("", "") @@ -135,6 +137,9 @@ func TestFormat(t *testing.T) { func updateGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { t.Helper() + if os.Getenv("UPDATE_GOLDEN") == "" { + return + } assertNilError(t, os.RemoveAll(goldenDir)) assertNilError(t, filepath.WalkDir(resultDir, func(path string, d fs.DirEntry, err error) error { if err != nil || d.IsDir() { @@ -170,10 +175,14 @@ func updateGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { t.Helper() - if os.Getenv("UPDATE_GOLDEN") != "" { - updateGoldenDir(t, origDir, resultDir, goldenDir) - return - } + golden := true + t.Cleanup(func() { + t.Helper() + if !golden { + t.Log("To regenerate golden files run `UPDATE_GOLDEN=1 script/test.sh`") + } + }) + updateGoldenDir(t, origDir, resultDir, goldenDir) checked := map[string]bool{} _, err := os.Stat(goldenDir) if err == nil { @@ -182,7 +191,9 @@ func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { if err != nil || info.IsDir() { return err } - assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } checked[relPath] = true return nil })) @@ -192,7 +203,9 @@ func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { if err != nil || info.IsDir() || checked[relPath] { return err } - assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } checked[relPath] = true return nil })) @@ -201,6 +214,7 @@ func checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) { if err != nil || info.IsDir() || checked[relPath] { return err } + golden = false return fmt.Errorf("found unexpected file:\n%s", relPath) })) } @@ -292,8 +306,8 @@ func (r testRun) assertErr(want string) { r.t.Error("expected error") return } - if !strings.Contains(r.err.Error(), want) { - r.t.Errorf("expected error to contain %q, got %q", want, r.err.Error()) + if strings.TrimSpace(r.err.Error()) != strings.TrimSpace(want) { + r.t.Errorf("unexpected error:\nwant:\n%s\ngot:\n%s", want, r.err.Error()) } } @@ -378,23 +392,24 @@ func assertEqualStrings(t *testing.T, want, got string) { } } -func assertEqualFiles(t *testing.T, want, got string) { +func assertEqualFiles(t *testing.T, want, got string) bool { t.Helper() wantBytes, err := os.ReadFile(want) if !assertNilError(t, err) { - return + return false } wantBytes = bytes.ReplaceAll(wantBytes, []byte("\r\n"), []byte("\n")) gotBytes, err := os.ReadFile(got) if !assertNilError(t, err) { - return + return false } gotBytes = bytes.ReplaceAll(gotBytes, []byte("\r\n"), []byte("\n")) - if bytes.Equal(wantBytes, gotBytes) { - return + if !bytes.Equal(wantBytes, gotBytes) { + diff := cmp.Diff(string(wantBytes), string(gotBytes)) + t.Errorf("files %q and %q differ: %s", want, got, diff) + return false } - diff := cmp.Diff(string(wantBytes), string(gotBytes)) - t.Errorf("files %q and %q differ: %s", want, got, diff) + return true } func assertNilError(t *testing.T, err error) bool { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index 718e010c0de..c60a1cfe215 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -8,15 +8,16 @@ package main import ( "bytes" "context" + "errors" "fmt" "go/ast" "go/format" "go/parser" "go/printer" "go/token" - "io/fs" "net/url" "os" + "path" "path/filepath" "regexp" "sort" @@ -79,52 +80,44 @@ func sortOperations(ops []*operation) { }) } -var normalizedURLs = map[string]string{} -var normalizedURLsMu sync.Mutex - -// normalizedURL returns an endpoint with all templated path parameters replaced with *. -func normalizedURL(u string) string { - normalizedURLsMu.Lock() - defer normalizedURLsMu.Unlock() - n, ok := normalizedURLs[u] - if ok { - return n +// normalizeOpPath returns an endpoint with all templated path parameters replaced with *. +func normalizeOpPath(opPath string) string { + if !strings.ContainsAny(opPath, "{%") { + return opPath } - parts := strings.Split(u, "/") - for i, p := range parts { - if len(p) == 0 { + segments := strings.Split(opPath, "/") + for i, segment := range segments { + if len(segment) == 0 { continue } - if p[0] == '{' || p[0] == '%' { - parts[i] = "*" + if segment[0] == '{' || segment[0] == '%' { + segments[i] = "*" } } - n = strings.Join(parts, "/") - normalizedURLs[u] = n - return n + return strings.Join(segments, "/") } func normalizedOpName(name string) string { verb, u := parseOpName(name) - return verb + " " + normalizedURL(u) + return strings.TrimSpace(verb + " " + normalizeOpPath(u)) } +// matches something like "GET /some/path" +var opNameRe = regexp.MustCompile(`(?i)(\S+)(?:\s+(\S.*))?`) + func parseOpName(id string) (verb, url string) { - fields := strings.Fields(id) - verb = fields[0] - if len(fields) > 1 { - url = fields[1] + match := opNameRe.FindStringSubmatch(id) + if match == nil { + return "", "" } - return strings.ToUpper(verb), url -} - -type method struct { - Name string `yaml:"name" json:"name"` - OpNames []string `yaml:"operations,omitempty" json:"operations,omitempty"` + u := strings.TrimSpace(match[2]) + if !strings.HasPrefix(u, "/") { + u = "/" + u + } + return strings.ToUpper(match[1]), u } -type metadata struct { - Methods []*method `yaml:"methods,omitempty"` +type operationsFile struct { ManualOps []*operation `yaml:"operations,omitempty"` OverrideOps []*operation `yaml:"operation_overrides,omitempty"` GitCommit string `yaml:"openapi_commit,omitempty"` @@ -134,7 +127,7 @@ type metadata struct { resolvedOps map[string]*operation } -func (m *metadata) resolve() { +func (m *operationsFile) resolve() { m.mu.Lock() defer m.mu.Unlock() if m.resolvedOps != nil { @@ -162,42 +155,13 @@ func (m *metadata) resolve() { } } -func (m *metadata) operations() []*operation { - m.resolve() - ops := make([]*operation, 0, len(m.resolvedOps)) - for _, op := range m.resolvedOps { - ops = append(ops, op) - } - sortOperations(ops) - return ops -} - -func loadMetadataFile(filename string) (*metadata, error) { - b, err := os.ReadFile(filename) - if err != nil { - return nil, err - } - var meta metadata - err = yaml.Unmarshal(b, &meta) - if err != nil { - return nil, err - } - return &meta, nil -} - -func (m *metadata) saveFile(filename string) (errOut error) { +func (m *operationsFile) saveFile(filename string) (errOut error) { sortOperations(m.ManualOps) sortOperations(m.OverrideOps) sortOperations(m.OpenapiOps) - sort.Slice(m.Methods, func(i, j int) bool { - return m.Methods[i].Name < m.Methods[j].Name - }) - for _, method := range m.Methods { - sort.Strings(method.OpNames) - } f, err := os.Create(filename) if err != nil { - panic(err) + return err } defer func() { e := f.Close() @@ -207,9 +171,47 @@ func (m *metadata) saveFile(filename string) (errOut error) { }() enc := yaml.NewEncoder(f) enc.SetIndent(2) + defer func() { + e := enc.Close() + if errOut == nil { + errOut = e + } + }() return enc.Encode(m) } +func (m *operationsFile) updateFromGithub(ctx context.Context, client *github.Client, ref string) error { + commit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil) + if err != nil { + return err + } + if resp.StatusCode != 200 { + return fmt.Errorf("unexpected status code: %s", resp.Status) + } + ops, err := getOpsFromGithub(ctx, client, ref) + if err != nil { + return err + } + if !operationsEqual(m.OpenapiOps, ops) { + m.OpenapiOps = ops + m.GitCommit = commit.GetSHA() + } + return nil +} + +func loadOperationsFile(filename string) (*operationsFile, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + var opsFile operationsFile + err = yaml.Unmarshal(b, &opsFile) + if err != nil { + return nil, err + } + return &opsFile, nil +} + func addOperation(ops []*operation, filename, opName, docURL string) []*operation { for _, op := range ops { if opName != op.Name { @@ -240,328 +242,266 @@ func addOperation(ops []*operation, filename, opName, docURL string) []*operatio }) } -// operationMethods returns a list methods that are mapped to the given operation id. -func (m *metadata) operationMethods(opName string) []string { - var methods []string - for _, method := range m.Methods { - for _, methodOpName := range method.OpNames { - if methodOpName == opName { - methods = append(methods, method.Name) +func unusedOps(opsFile *operationsFile, dir string) ([]*operation, error) { + var usedOps map[string]bool + err := visitServiceMethods(dir, false, func(_ string, fn *ast.FuncDecl, cmap ast.CommentMap) error { + ops, err := methodOps(opsFile, cmap, fn) + if err != nil { + return err + } + for _, op := range ops { + if usedOps == nil { + usedOps = map[string]bool{} } + usedOps[op.Name] = true } + return nil + }) + if err != nil { + return nil, err } - return methods -} - -func (m *metadata) getOperation(name string) *operation { - m.resolve() - return m.resolvedOps[name] -} - -func (m *metadata) getOperationsWithNormalizedName(name string) []*operation { - m.resolve() var result []*operation - norm := normalizedOpName(name) - for n := range m.resolvedOps { - if normalizedOpName(n) == norm { - result = append(result, m.resolvedOps[n]) + opsFile.resolve() + for opName, op := range opsFile.resolvedOps { + if !usedOps[opName] { + result = append(result, op) } } sortOperations(result) - return result + return result, nil } -func (m *metadata) getMethod(name string) *method { - for _, method := range m.Methods { - if method.Name == name { - return method - } - } - return nil -} +func updateDocsVisitor(opsFile *operationsFile) nodeVisitor { + return func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error { + linksMap := map[string]struct{}{} + undocMap := map[string]bool{} -func (m *metadata) operationsForMethod(methodName string) []*operation { - method := m.getMethod(methodName) - if method == nil { - return nil - } - var operations []*operation - for _, name := range method.OpNames { - op := m.getOperation(name) - if op != nil { - operations = append(operations, op) + ops, err := methodOps(opsFile, cmap, fn) + if err != nil { + return err + } + if len(ops) == 0 { + return fmt.Errorf("no operations defined for %s", serviceMethod) } - } - sortOperations(operations) - return operations -} -func (m *metadata) canonizeMethodOperations() error { - for _, mm := range m.Methods { - for i := range mm.OpNames { - opName := mm.OpNames[i] - if m.getOperation(opName) != nil { + for _, op := range ops { + if op.DocumentationURL == "" { + undocMap[op.Name] = true continue } - ops := m.getOperationsWithNormalizedName(opName) - switch len(ops) { - case 0: - return fmt.Errorf("method %q has an operation that can not be canonized to any defined name: %s", mm.Name, opName) - case 1: - mm.OpNames[i] = ops[0].Name - default: - candidateList := "" - for _, op := range ops { - candidateList += "\n " + op.Name - } - return fmt.Errorf("method %q has an operation that can be canonized to multiple defined names:\n operation: %s\n matches: %s", mm.Name, opName, candidateList) - } + linksMap[op.DocumentationURL] = struct{}{} } - } - return nil -} + var undocumentedOps []string + for op := range undocMap { + undocumentedOps = append(undocumentedOps, op) + } + sort.Strings(undocumentedOps) -func (m *metadata) updateFromGithub(ctx context.Context, client *github.Client, ref string) error { - commit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil) - if err != nil { - return err - } - if resp.StatusCode != 200 { - return fmt.Errorf("unexpected status code: %s", resp.Status) - } - ops, err := getOpsFromGithub(ctx, client, ref) - if err != nil { - return err - } - if !operationsEqual(m.OpenapiOps, ops) { - m.OpenapiOps = ops - m.GitCommit = commit.GetSHA() - } - return nil -} + // Find the group that comes before the function + var group *ast.CommentGroup + for _, g := range cmap[fn] { + if g.End() == fn.Pos()-1 { + group = g + } + } -// updateDocLinks updates the code comments in dir with doc urls from metadata. -func updateDocLinks(meta *metadata, dir string) error { - return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { - if err != nil { - return err + // If there is no group, create one + if group == nil { + group = &ast.CommentGroup{ + List: []*ast.Comment{{Text: "//", Slash: fn.Pos() - 1}}, + } + cmap[fn] = append(cmap[fn], group) } - if d.IsDir() || - !strings.HasSuffix(path, ".go") || - strings.HasSuffix(path, "_test.go") { - return nil + + origList := group.List + group.List = nil + for _, comment := range origList { + if metaOpRe.MatchString(comment.Text) || + docLineRE.MatchString(comment.Text) || + undocRE.MatchString(comment.Text) { + continue + } + group.List = append(group.List, comment) } - content, err := os.ReadFile(path) - if err != nil { - return err + + // add an empty line before adding doc links + group.List = append(group.List, &ast.Comment{Text: "//"}) + + var docLinks []string + for link := range linksMap { + docLinks = append(docLinks, link) } - content = bytes.ReplaceAll(content, []byte("\r\n"), []byte("\n")) - updatedContent, err := updateDocsLinksInFile(meta, content) - if err != nil { - return err + sort.Strings(docLinks) + + for _, dl := range docLinks { + group.List = append( + group.List, + &ast.Comment{ + Text: "// GitHub API docs: " + cleanURLPath(dl), + }, + ) } - if bytes.Equal(content, updatedContent) { - return nil + _, methodName, _ := strings.Cut(serviceMethod, ".") + for _, opName := range undocumentedOps { + line := fmt.Sprintf("// Note: %s uses the undocumented GitHub API endpoint %q.", methodName, opName) + group.List = append(group.List, &ast.Comment{Text: line}) } - f, err := os.Create(path) - if err != nil { - return err + for _, op := range ops { + group.List = append(group.List, &ast.Comment{ + Text: fmt.Sprintf("//meta:operation %s", op.Name), + }) } - _, err = f.Write(updatedContent) - if err != nil { - return err + group.List[0].Slash = fn.Pos() - 1 + for i := 1; i < len(group.List); i++ { + group.List[i].Slash = token.NoPos } - return f.Close() - }) -} - -// updateDocsLinksInFile updates in the code comments in content with doc urls from metadata. -func updateDocsLinksInFile(metadata *metadata, content []byte) ([]byte, error) { - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, "", content, parser.ParseComments) - if err != nil { - return nil, err - } - cmap := ast.NewCommentMap(fset, file, file.Comments) - - // ignore files where package is not github - if file.Name.Name != "github" { - return content, nil + return nil } +} - ast.Inspect(file, func(n ast.Node) bool { - return updateDocsLinksForNode(metadata, cmap, n) - }) - - file.Comments = cmap.Filter(file).Comments() - - var buf bytes.Buffer - err = printer.Fprint(&buf, fset, file) - if err != nil { - return nil, err - } - return format.Source(buf.Bytes()) +// updateDocs updates the code comments in dir with doc urls from metadata. +func updateDocs(opsFile *operationsFile, dir string) error { + return visitServiceMethods(dir, true, updateDocsVisitor(opsFile)) } -var ( - docLineRE = regexp.MustCompile(`(?i)\s*(//\s*)?GitHub\s+API\s+docs:\s*(https?://\S+)`) -) +type nodeVisitor func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error -func updateDocsLinksForNode(metadata *metadata, cmap ast.CommentMap, n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok { - return true - } - sm := serviceMethodFromNode(n) - if sm == "" { - return true +// visitServiceMethods runs visit on the ast.Node of every service method in dir. When writeFiles is true it will +// save any changes back to the original file. +func visitServiceMethods(dir string, writeFiles bool, visit nodeVisitor) error { + dirEntries, err := os.ReadDir(dir) + if err != nil { + return err } - - linksMap := map[string]struct{}{} - undocMap := map[string]bool{} - ops := metadata.operationsForMethod(sm) - for _, op := range ops { - if op.DocumentationURL == "" { - undocMap[op.Name] = true + for _, dirEntry := range dirEntries { + filename := filepath.Join(dir, dirEntry.Name()) + if dirEntry.IsDir() || + !strings.HasSuffix(filename, ".go") || + strings.HasSuffix(filename, "_test.go") { continue } - linksMap[op.DocumentationURL] = struct{}{} - } - var undocumentedOps []string - for op := range undocMap { - undocumentedOps = append(undocumentedOps, op) + err = errors.Join(err, visitFileMethods(writeFiles, filename, visit)) } - sort.Strings(undocumentedOps) + return err +} - // Find the group that comes before the function - var group *ast.CommentGroup - for _, g := range cmap[fn] { - if g.End() == fn.Pos()-1 { - group = g - } +func visitFileMethods(updateFile bool, filename string, visit nodeVisitor) error { + content, err := os.ReadFile(filename) + if err != nil { + return err } + content = bytes.ReplaceAll(content, []byte("\r\n"), []byte("\n")) - // If there is no group, create one - if group == nil { - group = &ast.CommentGroup{ - List: []*ast.Comment{{Text: "//", Slash: fn.Pos() - 1}}, - } - cmap[fn] = append(cmap[fn], group) + fset := token.NewFileSet() + fileNode, err := parser.ParseFile(fset, "", content, parser.ParseComments) + if err != nil { + return err } + cmap := ast.NewCommentMap(fset, fileNode, fileNode.Comments) - skipSpacer := false - var newList []*ast.Comment - for _, comment := range group.List { - if strings.Contains(comment.Text, "uses the undocumented GitHub API endpoint") { - skipSpacer = true - continue - } - match := docLineRE.FindStringSubmatch(comment.Text) - if match == nil { - newList = append(newList, comment) - continue - } - matchesLink := false - for link := range linksMap { - if sameDocLink(match[2], link) { - matchesLink = true - skipSpacer = true - delete(linksMap, link) - break - } + ast.Inspect(fileNode, func(n ast.Node) bool { + fn, ok := n.(*ast.FuncDecl) + if !ok { + return true } - if matchesLink { - newList = append(newList, comment) + serviceMethod := nodeServiceMethod(fn) + if serviceMethod == "" { + return true } + e := visit(serviceMethod, fn, cmap) + err = errors.Join(err, e) + return true + }) + if err != nil { + return err } - group.List = newList - - // add an empty line before adding doc links - if !skipSpacer { - group.List = append(group.List, &ast.Comment{Text: "//"}) - } - - var docLinks []string - for link := range linksMap { - docLinks = append(docLinks, link) + if !updateFile { + return nil } - sort.Strings(docLinks) - - for _, dl := range docLinks { - group.List = append( - group.List, - &ast.Comment{ - Text: "// GitHub API docs: " + normalizeDocURLPath(dl), - }, - ) + fileNode.Comments = cmap.Filter(fileNode).Comments() + var buf bytes.Buffer + err = printer.Fprint(&buf, fset, fileNode) + if err != nil { + return err } - _, methodName, _ := strings.Cut(sm, ".") - for _, opName := range undocumentedOps { - line := fmt.Sprintf("// Note: %s uses the undocumented GitHub API endpoint %q.", methodName, opName) - group.List = append(group.List, &ast.Comment{Text: line}) + updatedContent, err := format.Source(buf.Bytes()) + if err != nil { + return err } - group.List[0].Slash = fn.Pos() - 1 - for i := 1; i < len(group.List); i++ { - group.List[i].Slash = token.NoPos + if bytes.Equal(content, updatedContent) { + return nil } - return true + return os.WriteFile(filename, updatedContent, 0600) } -const docURLPrefix = "https://docs.github.com/rest/" - -var docURLPrefixRE = regexp.MustCompile(`^https://docs\.github\.com.*/rest/`) +var ( + metaOpRe = regexp.MustCompile(`(?i)\s*//\s*meta:operation\s+(\S.+)`) + undocRE = regexp.MustCompile(`(?i)\s*//\s*Note:\s+\S.+ uses the undocumented GitHub API endpoint`) + docLineRE = regexp.MustCompile(`(?i)\s*//\s*GitHub\s+API\s+docs:`) +) -func normalizeDocURLPath(u string) string { - u = strings.Replace(u, "/en/", "/", 1) - pre := docURLPrefixRE.FindString(u) - if pre == "" { - return u - } - if strings.Contains(u, "docs.github.com/enterprise-cloud@latest/") { - // remove unsightly double slash - // https://docs.github.com/enterprise-cloud@latest/ - return strings.ReplaceAll( - u, - "docs.github.com/enterprise-cloud@latest//", - "docs.github.com/enterprise-cloud@latest/", - ) - } - if strings.Contains(u, "docs.github.com/enterprise-server") { - return u +// methodOps parses a method's comments for //meta:operation lines and returns the corresponding operations. +func methodOps(opsFile *operationsFile, cmap ast.CommentMap, fn *ast.FuncDecl) ([]*operation, error) { + var ops []*operation + var err error + seen := map[string]bool{} + for _, g := range cmap[fn] { + for _, c := range g.List { + match := metaOpRe.FindStringSubmatch(c.Text) + if match == nil { + continue + } + opName := strings.TrimSpace(match[1]) + opsFile.resolve() + var found []*operation + norm := normalizedOpName(opName) + for n := range opsFile.resolvedOps { + if normalizedOpName(n) == norm { + found = append(found, opsFile.resolvedOps[n]) + } + } + switch len(found) { + case 0: + err = errors.Join(err, fmt.Errorf("could not find operation %q in openapi_operations.yaml", opName)) + case 1: + name := found[0].Name + if seen[name] { + err = errors.Join(err, fmt.Errorf("duplicate operation: %s", name)) + } + seen[name] = true + ops = append(ops, found[0]) + default: + var foundNames []string + for _, op := range found { + foundNames = append(foundNames, op.Name) + } + sort.Strings(foundNames) + err = errors.Join(err, fmt.Errorf("ambiguous operation %q could match any of: %v", opName, foundNames)) + } + } } - return docURLPrefix + strings.TrimPrefix(u, pre) -} - -// sameDocLink returns true if the two doc links are going to end up rendering the same page pointed -// to the same section. -// -// If a url path starts with *./rest/ it ignores query parameters and everything before /rest/ when -// making the comparison. -func sameDocLink(left, right string) bool { - if !docURLPrefixRE.MatchString(left) || - !docURLPrefixRE.MatchString(right) { - return left == right - } - left = stripURLQuery(normalizeDocURLPath(left)) - right = stripURLQuery(normalizeDocURLPath(right)) - return left == right + sortOperations(ops) + return ops, err } -func stripURLQuery(u string) string { - p, err := url.Parse(u) +// cleanURLPath runs path.Clean on the url path. This is to remove the unsightly double slashes from some +// of the urls in github's openapi descriptions. +func cleanURLPath(docURL string) string { + u, err := url.Parse(docURL) if err != nil { - return u + return docURL } - p.RawQuery = "" - return p.String() + u.Path = path.Clean(u.Path) + return u.String() } -func serviceMethodFromNode(node ast.Node) string { - decl, ok := node.(*ast.FuncDecl) - if !ok || decl.Recv == nil || len(decl.Recv.List) != 1 { +// nodeServiceMethod returns the name of the service method represented by fn, or "" if fn is not a service method. +// Name is in the form of "Receiver.Function", for example "IssuesService.Create". +func nodeServiceMethod(fn *ast.FuncDecl) string { + if fn.Recv == nil || len(fn.Recv.List) != 1 { return "" } - recv := decl.Recv.List[0] + recv := fn.Recv.List[0] se, ok := recv.Type.(*ast.StarExpr) if !ok { return "" @@ -572,9 +512,9 @@ func serviceMethodFromNode(node ast.Node) string { } // We only want exported methods on exported types where the type name ends in "Service". - if !id.IsExported() || !decl.Name.IsExported() || !strings.HasSuffix(id.Name, "Service") { + if !id.IsExported() || !fn.Name.IsExported() || !strings.HasSuffix(id.Name, "Service") { return "" } - return id.Name + "." + decl.Name.Name + return id.Name + "." + fn.Name.Name } diff --git a/tools/metadata/metadata_test.go b/tools/metadata/metadata_test.go new file mode 100644 index 00000000000..c7073e40bda --- /dev/null +++ b/tools/metadata/metadata_test.go @@ -0,0 +1,23 @@ +package main + +import ( + "testing" +) + +func Test_normalizedOpName(t *testing.T) { + for _, td := range []struct { + name string + want string + }{ + {name: "", want: ""}, + {name: "get /foo/{id}", want: "GET /foo/*"}, + {name: "get foo", want: "GET /foo"}, + } { + t.Run(td.name, func(t *testing.T) { + got := normalizedOpName(td.name) + if got != td.want { + t.Errorf("normalizedOpName() = %v, want %v", got, td.want) + } + }) + } +} diff --git a/tools/metadata/testdata/canonize/metadata.yaml b/tools/metadata/testdata/canonize/metadata.yaml deleted file mode 100644 index 85ff691b046..00000000000 --- a/tools/metadata/testdata/canonize/metadata.yaml +++ /dev/null @@ -1,13 +0,0 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id_noncanonical} - - name: BService.GetC - operations: - - get - /b/%s/c/%s -openapi_operations: - - name: GET /a/{a_id} - documentation_url: https://docs.github.com/rest/a/a#get-a - - name: GET /b/{b_id}/c/{c_id} - documentation_url: https://docs.github.com/rest/b/b#get-c diff --git a/tools/metadata/testdata/format/metadata.yaml b/tools/metadata/testdata/format/metadata.yaml deleted file mode 100644 index 36f27d86d5e..00000000000 --- a/tools/metadata/testdata/format/metadata.yaml +++ /dev/null @@ -1,33 +0,0 @@ - -operations: - - name: POST /a/{a_id} - documentation_url: https://docs.github.com/rest/a/a#update-a -openapi_operations: - - name: GET /a/{a_id} - documentation_url: https://docs.github.com/rest/a/a#get-a - - name: GET /undocumented/{undocumented_id} -operation_overrides: - - name: GET /a/{a_id_noncanonical2} - documentation_url: https://docs.github.com/rest/a/a#overridden-get-a - - name: GET /fake/{a_id} - documentation_url: https://docs.github.com/rest/a/a#overridden-get-a - - -methods: - - name: AService.Get - operations: - - GET /a/{a_id_noncanonical} - - name: AService.Undocumented - operations: - - GET /undocumented/{undocumented_id} - - name: AService.OutdatedLinks - operations: - - POST /a/{a_id} - - name: AService.AcceptableLinks - operations: - - POST /a/{a_id} - - GET /a/{a_id} - - name: AService.Uncommented - operations: - - GET /a/{a_id} -openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d diff --git a/tools/metadata/testdata/validate_invalid/metadata.yaml b/tools/metadata/testdata/format/openapi_operations.yaml similarity index 52% rename from tools/metadata/testdata/validate_invalid/metadata.yaml rename to tools/metadata/testdata/format/openapi_operations.yaml index 71ccd120b78..abaafeb9aa8 100644 --- a/tools/metadata/testdata/validate_invalid/metadata.yaml +++ b/tools/metadata/testdata/format/openapi_operations.yaml @@ -1,21 +1,4 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id_noncanonical} - - name: AService.Undocumented - operations: - - GET /undocumented/{undocumented_id} - - name: AService.OutdatedLinks - operations: - - POST /a/{a_id} - - name: AService.AcceptableLinks - operations: - - POST /a/{a_id} - - GET /a/{a_id} - - name: AService.Uncommented - operations: - - GET /a/{a_id} -openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d + operations: - name: POST /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#update-a @@ -23,8 +6,11 @@ openapi_operations: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a - name: GET /undocumented/{undocumented_id} + operation_overrides: - - name: GET /a/{a_id_noncanonical2} + - name: GET /a/{a_id_noncanonical2} # this comment will disappear documentation_url: https://docs.github.com/rest/a/a#overridden-get-a - name: GET /fake/{a_id} documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + +openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d diff --git a/tools/metadata/testdata/golden/TestCanonize/metadata.yaml b/tools/metadata/testdata/golden/TestCanonize/metadata.yaml deleted file mode 100644 index d83accde60e..00000000000 --- a/tools/metadata/testdata/golden/TestCanonize/metadata.yaml +++ /dev/null @@ -1,12 +0,0 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id} - - name: BService.GetC - operations: - - GET /b/{b_id}/c/{c_id} -openapi_operations: - - name: GET /a/{a_id} - documentation_url: https://docs.github.com/rest/a/a#get-a - - name: GET /b/{b_id}/c/{c_id} - documentation_url: https://docs.github.com/rest/b/b#get-c diff --git a/tools/metadata/testdata/golden/TestFormat/metadata.yaml b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml similarity index 56% rename from tools/metadata/testdata/golden/TestFormat/metadata.yaml rename to tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml index f09099654ae..524d56817fb 100644 --- a/tools/metadata/testdata/golden/TestFormat/metadata.yaml +++ b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml @@ -1,20 +1,3 @@ -methods: - - name: AService.AcceptableLinks - operations: - - GET /a/{a_id} - - POST /a/{a_id} - - name: AService.Get - operations: - - GET /a/{a_id_noncanonical} - - name: AService.OutdatedLinks - operations: - - POST /a/{a_id} - - name: AService.Uncommented - operations: - - GET /a/{a_id} - - name: AService.Undocumented - operations: - - GET /undocumented/{undocumented_id} operations: - name: POST /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#update-a diff --git a/tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go b/tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go deleted file mode 100644 index fd481d4b3ff..00000000000 --- a/tools/metadata/testdata/golden/TestUpdateDocURLs/github/a.go +++ /dev/null @@ -1,32 +0,0 @@ -package github - -type AService struct{} - -// Get gets an A -// -// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a -func (s *AService) Get() {} - -// MissingFromMetadata isn't mentioned in metadata.yaml -func (s *AService) MissingFromMetadata() {} - -// Undocumented uses an undocumented operation -// -// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". -func (s *AService) Undocumented() {} - -// OutdatedLinks has links that are outdated or wrong -// -// GitHub API docs: https://docs.github.com/rest/a/a#update-a -func (s *AService) OutdatedLinks() {} - -// AcceptableLinks has links that resolve to the same link as the metadata -// -// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a -// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a -func (s *AService) AcceptableLinks() {} - -// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a -func (s *AService) Uncommented() { - // has no pre-existing comment -} diff --git a/tools/metadata/testdata/validate_valid/github/a.go b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go similarity index 64% rename from tools/metadata/testdata/validate_valid/github/a.go rename to tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go index 608c6548b05..571c1eb2da9 100644 --- a/tools/metadata/testdata/validate_valid/github/a.go +++ b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go @@ -5,25 +5,33 @@ type AService struct{} // Get gets an A // // GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +// +//meta:operation GET /a/{a_id} func (s *AService) Get() {} // Undocumented uses an undocumented operation // // Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +// +//meta:operation GET /undocumented/{undocumented_id} func (s *AService) Undocumented() {} // OutdatedLinks has links that are outdated or wrong // // GitHub API docs: https://docs.github.com/rest/a/a#update-a +// +//meta:operation POST /a/{a_id} func (s *AService) OutdatedLinks() {} -// AcceptableLinks has links that resolve to the same link as the metadata +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a // -// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a -// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a -func (s *AService) AcceptableLinks() {} +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} -// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a -func (s *AService) Uncommented() { - // has no pre-existing comment -} +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} + +func (i *internalService) Get() {} diff --git a/tools/metadata/testdata/golden/TestUpdateOpenAPI/metadata.yaml b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml similarity index 87% rename from tools/metadata/testdata/golden/TestUpdateOpenAPI/metadata.yaml rename to tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml index 6c58990cdb5..c1e3cf4cbd6 100644 --- a/tools/metadata/testdata/golden/TestUpdateOpenAPI/metadata.yaml +++ b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml @@ -1,7 +1,3 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id} operations: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a diff --git a/tools/metadata/testdata/unused/github/a.go b/tools/metadata/testdata/unused/github/a.go new file mode 100644 index 00000000000..0169531b2b6 --- /dev/null +++ b/tools/metadata/testdata/unused/github/a.go @@ -0,0 +1,8 @@ +package github + +type AService struct{} + +// PostABC +// +//meta:operation POST /a/b/c/{a_id} +func (a *AService) PostABC() {} diff --git a/tools/metadata/testdata/update-doc-urls/metadata.yaml b/tools/metadata/testdata/unused/openapi_operations.yaml similarity index 57% rename from tools/metadata/testdata/update-doc-urls/metadata.yaml rename to tools/metadata/testdata/unused/openapi_operations.yaml index a3a15879d86..c5c3772b1f3 100644 --- a/tools/metadata/testdata/update-doc-urls/metadata.yaml +++ b/tools/metadata/testdata/unused/openapi_operations.yaml @@ -1,25 +1,10 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id} - - name: AService.Undocumented - operations: - - GET /undocumented/{undocumented_id} - - name: AService.OutdatedLinks - operations: - - POST /a/{a_id} - - name: AService.AcceptableLinks - operations: - - POST /a/{a_id} - - GET /a/{a_id} - - name: AService.Uncommented - operations: - - GET /a/{a_id} openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d operations: - name: POST /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#update-a openapi_operations: + - name: POST /a/b/c/{a_id} + documentation_url: https://docs.github.com/rest/a/b/c#update-a - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a - name: GET /undocumented/{undocumented_id} diff --git a/tools/metadata/testdata/update-go/invalid/github/a.go b/tools/metadata/testdata/update-go/invalid/github/a.go new file mode 100644 index 00000000000..ceef5fb5963 --- /dev/null +++ b/tools/metadata/testdata/update-go/invalid/github/a.go @@ -0,0 +1,24 @@ +package github + +type AService struct{} + +// NoOperation has no operation +func (*AService) NoOperation() {} + +func (*AService) NoComment() {} + +// Ambiguous has an operation that could resolve to multiple operations +// +//meta:operation GET /ambiguous/{} +func (*AService) Ambiguous() {} + +// MissingOperation has an operation that is missing from the OpenAPI spec +// +//meta:operation GET /missing/{id} +func (*AService) MissingOperation() {} + +// DuplicateOperations has duplicate operations +//meta:operation GET /a/{a_id} +//meta:operation POST /a/{a_id} +//meta:operation GET /a/{a_id} +func (*AService) DuplicateOperations() {} diff --git a/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml b/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml new file mode 100644 index 00000000000..07b0c3e5013 --- /dev/null +++ b/tools/metadata/testdata/update-go/invalid/openapi_operations.yaml @@ -0,0 +1,16 @@ +operations: + - name: POST /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#update-a +openapi_operations: + - name: GET /ambiguous/{id} + documentation_url: https://docs.github.com/rest/ambiguous/ + - name: GET /ambiguous/{name} + documentation_url: https://docs.github.com/rest/ambiguous/ + - name: GET /undocumented/{undocumented_id} + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +operation_overrides: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/update-doc-urls/github/a.go b/tools/metadata/testdata/update-go/valid/github/a.go similarity index 53% rename from tools/metadata/testdata/update-doc-urls/github/a.go rename to tools/metadata/testdata/update-go/valid/github/a.go index bb1721e9ede..7885efd8c79 100644 --- a/tools/metadata/testdata/update-doc-urls/github/a.go +++ b/tools/metadata/testdata/update-go/valid/github/a.go @@ -3,12 +3,11 @@ package github type AService struct{} // Get gets an A +//meta:operation GET /a/{non-canonical-id} func (s *AService) Get() {} -// MissingFromMetadata isn't mentioned in metadata.yaml -func (s *AService) MissingFromMetadata() {} - // Undocumented uses an undocumented operation +//meta:operation GET /undocumented/{undocumented_id} func (s *AService) Undocumented() {} // OutdatedLinks has links that are outdated or wrong @@ -16,14 +15,17 @@ func (s *AService) Undocumented() {} // GitHub API docs: https://docs.github.com/rest/a/a#get-a // GitHub API docs: https://example.com // Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". +// +//meta:operation post a/{a_id} func (s *AService) OutdatedLinks() {} -// AcceptableLinks has links that resolve to the same link as the metadata -// -// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a -// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a -func (s *AService) AcceptableLinks() {} +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} + +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} -func (s *AService) Uncommented() { - // has no pre-existing comment -} +func (i *internalService) Get() {} diff --git a/tools/metadata/testdata/update-go/valid/github/ignoreme.txt b/tools/metadata/testdata/update-go/valid/github/ignoreme.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/metadata/testdata/validate_valid/metadata.yaml b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml similarity index 51% rename from tools/metadata/testdata/validate_valid/metadata.yaml rename to tools/metadata/testdata/update-go/valid/openapi_operations.yaml index 7f5baa60708..ed401c0d283 100644 --- a/tools/metadata/testdata/validate_valid/metadata.yaml +++ b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml @@ -1,20 +1,3 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id} - - name: AService.Undocumented - operations: - - GET /undocumented/{undocumented_id} - - name: AService.OutdatedLinks - operations: - - POST /a/{a_id} - - name: AService.AcceptableLinks - operations: - - POST /a/{a_id} - - GET /a/{a_id} - - name: AService.Uncommented - operations: - - GET /a/{a_id} openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d operations: - name: POST /a/{a_id} @@ -26,3 +9,5 @@ openapi_operations: operation_overrides: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#overridden-get-a + - name: GET /fake/{a_id} + documentation_url: https://docs.github.com/rest/a/a#overridden-get-a diff --git a/tools/metadata/testdata/update-openapi/metadata.yaml b/tools/metadata/testdata/update-openapi/openapi_operations.yaml similarity index 62% rename from tools/metadata/testdata/update-openapi/metadata.yaml rename to tools/metadata/testdata/update-openapi/openapi_operations.yaml index f96b22445a2..1577e739ab6 100644 --- a/tools/metadata/testdata/update-openapi/metadata.yaml +++ b/tools/metadata/testdata/update-openapi/openapi_operations.yaml @@ -1,7 +1,3 @@ -methods: - - name: AService.Get - operations: - - GET /a/{a_id} operations: - name: GET /a/{a_id} documentation_url: https://docs.github.com/rest/a/a#get-a diff --git a/tools/metadata/testdata/validate_invalid/github/a.go b/tools/metadata/testdata/validate_invalid/github/a.go deleted file mode 100644 index fd481d4b3ff..00000000000 --- a/tools/metadata/testdata/validate_invalid/github/a.go +++ /dev/null @@ -1,32 +0,0 @@ -package github - -type AService struct{} - -// Get gets an A -// -// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a -func (s *AService) Get() {} - -// MissingFromMetadata isn't mentioned in metadata.yaml -func (s *AService) MissingFromMetadata() {} - -// Undocumented uses an undocumented operation -// -// Note: Undocumented uses the undocumented GitHub API endpoint "GET /undocumented/{undocumented_id}". -func (s *AService) Undocumented() {} - -// OutdatedLinks has links that are outdated or wrong -// -// GitHub API docs: https://docs.github.com/rest/a/a#update-a -func (s *AService) OutdatedLinks() {} - -// AcceptableLinks has links that resolve to the same link as the metadata -// -// GitHub API docs: https://docs.github.com/en/rest/a/a#update-a -// GitHub API docs: https://docs.github.com/en/rest/a/a#overridden-get-a -func (s *AService) AcceptableLinks() {} - -// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a -func (s *AService) Uncommented() { - // has no pre-existing comment -} diff --git a/tools/metadata/validate.go b/tools/metadata/validate.go deleted file mode 100644 index e8937f63806..00000000000 --- a/tools/metadata/validate.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "context" - "fmt" - "go/ast" - "go/parser" - "go/token" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/google/go-github/v56/github" -) - -// validateMetadata returns a list of issues with the metadata file. An error means -// there was an error validating the file, not that there are issues with the file. -// -// validations: -// - Methods in the github package must exist in metadata.yaml -// - Methods in metadata.yaml must exist in github package -// - Methods in metadata.yaml must have unique names -// - Methods in metadata.yaml must have at least one operation -// - Methods in metadata.yaml may not have duplicate operations -// - Methods in metadata.yaml must use the canonical operation name -// - All operations mapped from a method must exist in either ManualOps or OpenAPIOps -// - No operations are duplicated between ManualOps and OpenAPIOps -// - All operations in OverrideOps must exist in either ManualOps or OpenAPIOps -func validateMetadata(dir string, meta *metadata) ([]string, error) { - serviceMethods, err := getServiceMethods(dir) - if err != nil { - return nil, err - } - var result []string - result = validateServiceMethodsExist(result, meta, serviceMethods) - result = validateMetadataMethods(result, meta, serviceMethods) - result = validateOperations(result, meta) - return result, nil -} - -// validateGitCommit validates that building meta.OpenapiOps from the commit at meta.GitCommit -// results in the same operations as meta.OpenapiOps. -func validateGitCommit(ctx context.Context, client *github.Client, meta *metadata) (string, error) { - ops, err := getOpsFromGithub(ctx, client, meta.GitCommit) - if err != nil { - return "", err - } - if !operationsEqual(ops, meta.OpenapiOps) { - msg := fmt.Sprintf("openapi_operations does not match operations from git commit %s", meta.GitCommit) - return msg, nil - } - return "", nil -} - -func validateMetadataMethods(result []string, meta *metadata, serviceMethods []string) []string { - smLookup := map[string]bool{} - for _, method := range serviceMethods { - smLookup[method] = true - } - seenMethods := map[string]bool{} - for _, method := range meta.Methods { - if seenMethods[method.Name] { - msg := fmt.Sprintf("Method %s is duplicated in metadata.yaml.", method.Name) - result = append(result, msg) - continue - } - seenMethods[method.Name] = true - if !smLookup[method.Name] { - msg := fmt.Sprintf("Method %s in metadata.yaml does not exist in github package.", method.Name) - result = append(result, msg) - } - result = validateMetaMethodOperations(result, meta, method) - } - return result -} - -func validateMetaMethodOperations(result []string, meta *metadata, method *method) []string { - if len(method.OpNames) == 0 { - msg := fmt.Sprintf("Method %s in metadata.yaml does not have any operations.", method.Name) - result = append(result, msg) - } - seenOps := map[string]bool{} - for _, opName := range method.OpNames { - if seenOps[opName] { - msg := fmt.Sprintf("Method %s in metadata.yaml has duplicate operation: %s.", method.Name, opName) - result = append(result, msg) - } - seenOps[opName] = true - if meta.getOperation(opName) != nil { - continue - } - normalizedMatch := meta.getOperationsWithNormalizedName(opName) - if len(normalizedMatch) > 0 { - msg := fmt.Sprintf("Method %s has operation which is does not use the canonical name. You may be able to automatically fix this by running 'script/metadata.sh canonize': %s.", method.Name, opName) - result = append(result, msg) - continue - } - msg := fmt.Sprintf("Method %s has operation which is not defined in metadata.yaml: %s.", method.Name, opName) - result = append(result, msg) - } - return result -} - -func validateServiceMethodsExist(result []string, meta *metadata, serviceMethods []string) []string { - for _, method := range serviceMethods { - if meta.getMethod(method) == nil { - msg := fmt.Sprintf("Method %s does not exist in metadata.yaml. Please add it.", method) - result = append(result, msg) - } - } - return result -} - -func validateOperations(result []string, meta *metadata) []string { - names := map[string]bool{} - openapiNames := map[string]bool{} - overrideNames := map[string]bool{} - for _, op := range meta.OpenapiOps { - if openapiNames[op.Name] { - msg := fmt.Sprintf("Name duplicated in openapi_operations: %s", op.Name) - result = append(result, msg) - } - openapiNames[op.Name] = true - } - for _, op := range meta.ManualOps { - if names[op.Name] { - msg := fmt.Sprintf("Name duplicated in operations: %s", op.Name) - result = append(result, msg) - } - names[op.Name] = true - if openapiNames[op.Name] { - msg := fmt.Sprintf("Name exists in both operations and openapi_operations: %s", op.Name) - result = append(result, msg) - } - } - for _, op := range meta.OverrideOps { - if overrideNames[op.Name] { - msg := fmt.Sprintf("Name duplicated in override_operations: %s", op.Name) - result = append(result, msg) - } - overrideNames[op.Name] = true - if !names[op.Name] && !openapiNames[op.Name] { - msg := fmt.Sprintf("Name in override_operations does not exist in operations or openapi_operations: %s", op.Name) - result = append(result, msg) - } - } - return result -} - -func getServiceMethods(dir string) ([]string, error) { - dirEntries, err := os.ReadDir(dir) - if err != nil { - return nil, err - } - var serviceMethods []string - for _, filename := range dirEntries { - var sm []string - sm, err = getServiceMethodsFromFile(filepath.Join(dir, filename.Name())) - if err != nil { - return nil, err - } - serviceMethods = append(serviceMethods, sm...) - } - sort.Strings(serviceMethods) - return serviceMethods, nil -} - -// getServiceMethodsFromFile returns the service methods in filename. -func getServiceMethodsFromFile(filename string) ([]string, error) { - if !strings.HasSuffix(filename, ".go") || - strings.HasSuffix(filename, "_test.go") { - return nil, nil - } - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) - if err != nil { - return nil, err - } - - // Only look at the github package - if f.Name.Name != "github" { - return nil, nil - } - var serviceMethods []string - ast.Inspect(f, func(n ast.Node) bool { - sm := serviceMethodFromNode(n) - if sm == "" { - return true - } - serviceMethods = append(serviceMethods, sm) - return false - }) - return serviceMethods, nil -} From ffd73b60bfe5b7046bc22a17395b7eb668178cdb Mon Sep 17 00:00:00 2001 From: Will Roden Date: Thu, 19 Oct 2023 13:52:57 -0500 Subject: [PATCH 28/34] revert accidental test changes --- github/admin_users_test.go | 4 ++-- github/github_test.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/github/admin_users_test.go b/github/admin_users_test.go index 4c2af156305..2dac611709e 100644 --- a/github/admin_users_test.go +++ b/github/admin_users_test.go @@ -90,7 +90,7 @@ func TestUserImpersonation_Create(t *testing.T) { "url": "https://git.company.com/api/v3/authorizations/1234", "app": { "name": "GitHub Site Administrator", - "url": "https://docs.github.com/rest/enterprise/users/", + "url": "https://docs.github.com/en/rest/enterprise/users/", "client_id": "1234" }, "token": "1234", @@ -119,7 +119,7 @@ func TestUserImpersonation_Create(t *testing.T) { URL: String("https://git.company.com/api/v3/authorizations/1234"), App: &OAuthAPP{ Name: String("GitHub Site Administrator"), - URL: String("https://docs.github.com/rest/enterprise/users/"), + URL: String("https://docs.github.com/en/rest/enterprise/users/"), ClientID: String("1234"), }, Token: String("1234"), diff --git a/github/github_test.go b/github/github_test.go index a7a5f59f8f7..7d92946dfd0 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -1226,7 +1226,7 @@ func TestDo_rateLimit_rateLimitError(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1268,7 +1268,7 @@ func TestDo_rateLimit_noNetworkCall(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1328,7 +1328,7 @@ func TestDo_rateLimit_ignoredFromCache(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1370,7 +1370,7 @@ func TestDo_rateLimit_abuseRateLimitError(t *testing.T) { // there is no "Retry-After" header. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1405,7 +1405,7 @@ func TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) { // url changes between versions but follows roughly the same format. fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1436,7 +1436,7 @@ func TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1493,7 +1493,7 @@ func TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) { w.WriteHeader(http.StatusForbidden) fmt.Fprintln(w, `{ "message": "You have triggered an abuse detection mechanism ...", - "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits" + "documentation_url": "https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits" }`) }) @@ -1634,7 +1634,7 @@ func TestCheckResponse_AbuseRateLimit(t *testing.T) { Request: &http.Request{}, StatusCode: http.StatusForbidden, Body: io.NopCloser(strings.NewReader(`{"message":"m", - "documentation_url": "docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), + "documentation_url": "docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits"}`)), } err := CheckResponse(res).(*AbuseRateLimitError) From a2bff7b2e5eb3990b3e88ce35542abac64d1f103 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:29:53 -0500 Subject: [PATCH 29/34] Apply suggestions from code review Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- CONTRIBUTING.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f7170ef98c..6414d171126 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,7 +112,7 @@ description. ## Metadata GitHub publishes [OpenAPI descriptions of their API][]. We use these -descriptions to keep documentation links up to date and to track of which +descriptions to keep documentation links up to date and to keep track of which methods call which endpoints via the `//meta:operation` comments described above. GitHub's descriptions are far too large to keep in this repository or to pull down every time we generate code, so we keep only the metadata we need @@ -126,8 +126,7 @@ may be useful to know what it is. Its sections are: - `openapi_operations` - is the metadata that comes from GitHub's OpenAPI descriptions. It is generated by `script/metadata.sh update-openapi` and should not be edited by hand. In the rare case where it needs to be - overridden, use the - `operation_overrides` section instead. + overridden, use the `operation_overrides` section instead. An operation consists of `name`, `documentation_url`, and `openapi_files`. `openapi_files` is the list of files where the operation @@ -191,7 +190,7 @@ tasks. **script/lint.sh** runs linters on the project and checks generated files are current. -**script/metadata.sh** runs tools/metadata. See the [Metadata](#metadata) +**script/metadata.sh** runs `tools/metadata`. See the [Metadata](#metadata) section for more information. **script/test.sh** runs tests on all modules. From 4183cf5a469ec694d933636964c54067c48d3780 Mon Sep 17 00:00:00 2001 From: WillAbides <233500+WillAbides@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:34:22 -0500 Subject: [PATCH 30/34] Apply suggestions from code review Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- tools/metadata/main.go | 2 ++ tools/metadata/metadata_test.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 4c852785eb4..0b0562948f0 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -3,6 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// metadata is a command-line tool used to check and update this repo. +// See CONTRIBUTING.md for details. package main import ( diff --git a/tools/metadata/metadata_test.go b/tools/metadata/metadata_test.go index c7073e40bda..c3ad0a788f9 100644 --- a/tools/metadata/metadata_test.go +++ b/tools/metadata/metadata_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 main import ( From b6d3af603af8b74158dd30564577a8fe5621e42b Mon Sep 17 00:00:00 2001 From: Will Roden Date: Thu, 19 Oct 2023 14:50:43 -0500 Subject: [PATCH 31/34] return AtoI errors --- tools/metadata/openapi.go | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 1b0c26c96cb..4b858481f5e 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -128,20 +128,29 @@ func getDescriptions(ctx context.Context, client *github.Client, gitRef string) if m == nil { continue } - plan := m[pattern.SubexpIndex("plan")] - major, _ := strconv.Atoi(m[pattern.SubexpIndex("major")]) - minor, _ := strconv.Atoi(m[pattern.SubexpIndex("minor")]) - if plan == "ghes" && major < 3 { + file := openapiFile{ + filename: fmt.Sprintf("descriptions/%s/%s.json", d.GetName(), d.GetName()), + plan: m[pattern.SubexpIndex("plan")], + planIdx: i, + } + rawMajor := m[pattern.SubexpIndex("major")] + if rawMajor != "" { + file.releaseMajor, err = strconv.Atoi(rawMajor) + if err != nil { + return nil, err + } + } + rawMinor := m[pattern.SubexpIndex("minor")] + if rawMinor != "" { + file.releaseMinor, err = strconv.Atoi(rawMinor) + if err != nil { + return nil, err + } + } + if file.plan == "ghes" && file.releaseMajor < 3 { continue } - filename := fmt.Sprintf("descriptions/%s/%s.json", d.GetName(), d.GetName()) - files = append(files, &openapiFile{ - filename: filename, - plan: plan, - planIdx: i, - releaseMajor: major, - releaseMinor: minor, - }) + files = append(files, &file) break } } From 6e4d263e4158ac61487354ec892c03335d4cc202 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Thu, 19 Oct 2023 14:52:31 -0500 Subject: [PATCH 32/34] update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6414d171126..e1fdbef5abe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -166,7 +166,7 @@ Its subcommands are: in `openapi_commit`. `update-openapi --validate` is called by `script/lint.sh`. -- `update-go` - updates go files with documentation urls and formats comments. +- `update-go` - updates Go files with documentation URLs and formats comments. It is used by `script/generate.sh`. - `format` - formats whitespace in `openapi_operations.yaml` and sorts its From 66a203520ba109602b7a97612766c3126733933f Mon Sep 17 00:00:00 2001 From: Will Roden Date: Mon, 23 Oct 2023 11:18:32 -0500 Subject: [PATCH 33/34] add meta for RateLimitService.Get --- github/rate_limit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/github/rate_limit.go b/github/rate_limit.go index 4243a144033..f89c4d04808 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -59,6 +59,10 @@ func (r RateLimits) String() string { } // RateLimits returns the rate limits for the current client. +// +// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +// +//meta:operation GET /rate_limit func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) { req, err := s.client.NewRequest("GET", "rate_limit", nil) if err != nil { From 4a065a9c209995f45edbbb4a36dcb9f6cbfad1a2 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 3 Nov 2023 09:21:03 -0500 Subject: [PATCH 34/34] fix .golangci.yml exclusion for tools --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 1770bd2e417..79d8481fd63 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -50,4 +50,4 @@ issues: # We don't care about file inclusion via variable in examples or internal tools. - linters: [ gosec ] text: 'G304: Potential file inclusion via variable' - path: '^(example|update-urls)\/' + path: '^(example|tools)\/'