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/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 98a1f5de8be..f9d6d7e4639 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -14,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/.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)\/' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 451924ce4c3..e1fdbef5abe 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,7 +72,112 @@ 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 -## 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 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 +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. @@ -86,6 +190,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 ## @@ -104,7 +211,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 9592d9ab62f..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) @@ -217,7 +229,9 @@ 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 +// +//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 1d97fc91b4f..7e10444af47 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 d55a2d45a61..1a31e4c6f1b 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, // RemoveEnabledReposInOrg 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 3566eb9d207..b89741a82a1 100644 --- a/github/actions_required_workflows.go +++ b/github/actions_required_workflows.go @@ -67,7 +67,9 @@ 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 +// +//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) @@ -91,7 +93,9 @@ 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 +// +//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) @@ -110,7 +114,9 @@ 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 +// +//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) @@ -130,7 +136,9 @@ 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 +// +//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) @@ -149,7 +157,9 @@ 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 +// +//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) @@ -161,7 +171,9 @@ 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 +// +//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) @@ -184,7 +196,9 @@ 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 +// +//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"` @@ -200,7 +214,9 @@ 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 +// +//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) @@ -212,7 +228,9 @@ 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 +// +//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) @@ -224,7 +242,9 @@ 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 +// +//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 00b9b6ce091..a1f453f3c67 100644 --- a/github/actions_runner_groups.go +++ b/github/actions_runner_groups.go @@ -80,7 +80,9 @@ 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 +// +//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) @@ -104,7 +106,9 @@ 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 +// +//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) @@ -123,7 +127,9 @@ 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 +// +//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) @@ -137,7 +143,9 @@ 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 +// +//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) @@ -156,7 +164,9 @@ 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 +// +//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) @@ -175,7 +185,9 @@ 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 +// +//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) @@ -200,7 +212,9 @@ 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 +// +//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) @@ -215,7 +229,9 @@ 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 +// +//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) @@ -230,7 +246,9 @@ 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 +// +//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) @@ -244,7 +262,9 @@ 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 +// +//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) @@ -269,7 +289,9 @@ 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 +// +//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) @@ -283,7 +305,9 @@ 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 +// +//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) @@ -298,7 +322,9 @@ 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 +// +//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 29445edd042..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) @@ -170,7 +192,9 @@ 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 +// +//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 d57e4887db1..bc7afe9e944 100644 --- a/github/actions_workflow_runs.go +++ b/github/actions_workflow_runs.go @@ -133,7 +133,9 @@ 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 +// +//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) @@ -141,7 +143,9 @@ 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 +// +//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) @@ -149,7 +153,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) @@ -173,7 +179,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) @@ -193,7 +201,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) @@ -217,7 +227,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) @@ -237,7 +249,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) @@ -251,7 +265,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) @@ -265,7 +281,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) @@ -279,7 +297,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) @@ -293,7 +313,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) @@ -313,7 +335,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) @@ -327,7 +351,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) @@ -341,7 +367,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) @@ -361,7 +389,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 9cd9f9b71d7..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. @@ -57,6 +57,10 @@ 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 +// +//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 03476c2e2c3..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) @@ -102,7 +106,9 @@ 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 +// +//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 1b28ef64c7d..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. @@ -82,7 +82,9 @@ 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 +// +//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) @@ -101,7 +103,9 @@ 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 +// +//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 448e51f631e..c734d4de12f 100644 --- a/github/admin_orgs.go +++ b/github/admin_orgs.go @@ -22,7 +22,9 @@ 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 +// +//meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { u := "admin/organizations" @@ -59,14 +61,18 @@ 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 +// +//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) } // 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 +// +//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 17e568f62b2..aa23f5d1995 100644 --- a/github/admin_stats.go +++ b/github/admin_stats.go @@ -152,7 +152,9 @@ 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 +// +//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 d756a77e20d..3916a470b04 100644 --- a/github/admin_users.go +++ b/github/admin_users.go @@ -19,7 +19,9 @@ 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 +// +//meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, login, email string) (*User, *Response, error) { u := "admin/users" @@ -44,7 +46,9 @@ 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 +// +//meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { u := "admin/users/" + username @@ -95,7 +99,9 @@ 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 +// +//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) @@ -115,7 +121,9 @@ 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 +// +//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/apps.go b/github/apps.go index 8965e66815c..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) @@ -326,7 +345,9 @@ 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 +// +//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,28 +370,36 @@ 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)) } // 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". +// +//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 e3bd2afc032..6046827ef06 100644 --- a/github/apps_hooks.go +++ b/github/apps_hooks.go @@ -12,7 +12,9 @@ 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 +// +//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 { @@ -31,7 +33,9 @@ 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 +// +//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 32889abd240..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 } @@ -89,7 +89,11 @@ 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 +// +//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) @@ -113,7 +117,11 @@ 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 +// +//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) @@ -137,7 +145,11 @@ 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 +// +//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)) @@ -157,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 ea0897e3627..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) @@ -249,7 +257,9 @@ 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 +// +//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) @@ -269,7 +279,9 @@ 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 +// +//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 7a76bf86fda..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. @@ -62,7 +62,9 @@ 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 +// +//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) @@ -81,7 +83,9 @@ 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 +// +//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) @@ -101,7 +105,9 @@ 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 +// +//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) @@ -120,7 +126,9 @@ 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 +// +//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) @@ -144,7 +152,9 @@ 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 +// +//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) @@ -163,7 +173,9 @@ 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 +// +//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) @@ -183,7 +195,9 @@ 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 +// +//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 0ae269be676..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) @@ -317,7 +323,9 @@ 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 +// +//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 11e1fb38df0..7d7f9ef8188 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 { @@ -56,6 +58,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 f2e6a284cf0..608370503f6 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 e11c679c668..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) @@ -312,7 +348,9 @@ 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 +// +//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 e578965cc12..86a1fe48b98 100644 --- a/github/dependency_graph.go +++ b/github/dependency_graph.go @@ -61,7 +61,9 @@ 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 +// +//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 5a2c86baa38..93ef232f6c7 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 6fc30d50258..4a6e6b52c10 100644 --- a/github/enterprise_actions_runners.go +++ b/github/enterprise_actions_runners.go @@ -12,7 +12,9 @@ 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 +// +//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) @@ -51,7 +55,9 @@ 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 +// +//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) @@ -71,7 +77,9 @@ 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 +// +//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) @@ -95,7 +103,9 @@ 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 +// +//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 40648673385..058a7d17786 100644 --- a/github/enterprise_audit_log.go +++ b/github/enterprise_audit_log.go @@ -12,7 +12,9 @@ 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 +// +//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 3980a86aa4b..af8eb0ffb2f 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -20,7 +20,9 @@ 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 +// +//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) @@ -40,7 +42,9 @@ 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 +// +//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 c270f6bcf0a..6ff1eb84851 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 1a683bc34c9..573d38be528 100644 --- a/github/git_commits.go +++ b/github/git_commits.go @@ -82,7 +82,9 @@ 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 +// +//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 834aa86bc6a..9c1bf084d35 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.sh update-go package github @@ -131,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/ @@ -994,7 +995,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 @@ -1004,7 +1005,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"` } @@ -1132,7 +1133,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 @@ -1195,7 +1196,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 @@ -1309,7 +1310,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. @@ -1323,17 +1324,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 } @@ -1377,7 +1378,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/gitignore.go b/github/gitignore.go index a20a868b44a..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. @@ -28,7 +28,9 @@ 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 +// +//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 { @@ -46,7 +48,9 @@ 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 +// +//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 04899772bd1..4f06371085e 100644 --- a/github/issue_import.go +++ b/github/issue_import.go @@ -70,7 +70,9 @@ 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 +// +//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) @@ -99,7 +101,9 @@ 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 +// +//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) @@ -121,7 +125,9 @@ 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 +// +//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 44364811d3f..1db99328b51 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 0877b6d1831..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. @@ -60,7 +60,9 @@ 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 +// +//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 { @@ -78,7 +80,9 @@ 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 +// +//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 0d9811549c2..72edbd9feef 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 3e9743b00cb..1da8fcf1326 100644 --- a/github/meta.go +++ b/github/meta.go @@ -72,6 +72,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 { @@ -98,6 +100,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 != "" { @@ -131,6 +135,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 0c7e361b3fc..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) @@ -223,7 +230,9 @@ 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}". +// +//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 e2f8fc24ffd..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`. @@ -135,7 +135,9 @@ 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 +// +//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 7c1b2d6292d..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"` @@ -30,7 +30,9 @@ 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 +// +//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) @@ -59,7 +61,9 @@ 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 +// +//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) @@ -80,7 +84,9 @@ 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 +// +//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) @@ -101,7 +107,9 @@ 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 +// +//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 449b3dd3e91..4fb9a63b428 100644 --- a/github/orgs_packages.go +++ b/github/orgs_packages.go @@ -12,7 +12,9 @@ import ( // ListPackages lists 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 +// +//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) @@ -36,7 +38,9 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt // GetPackage gets 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 +// +//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) @@ -55,7 +59,9 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, // DeletePackage deletes 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 +// +//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) @@ -68,7 +74,9 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy // RestorePackage restores 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 +// +//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) @@ -81,7 +89,9 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT // PackageGetAllVersions gets 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 +// +//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) @@ -105,7 +115,9 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p // PackageGetVersion gets 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 +// +//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) @@ -124,7 +136,9 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa // PackageDeleteVersion deletes 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 +// +//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) @@ -137,7 +151,9 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa // PackageRestoreVersion restores 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 +// +//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 1c336540b81..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) @@ -44,7 +46,9 @@ 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 +// +//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/rate_limit.go b/github/rate_limit.go index 838c3ba7966..0fc15f815e2 100644 --- a/github/rate_limit.go +++ b/github/rate_limit.go @@ -59,6 +59,10 @@ func (r RateLimits) String() string { } // Get returns the rate limits for the current client. +// +// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +// +//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 { diff --git a/github/reactions.go b/github/reactions.go index f06a8ef3dbc..1aa7ac38f2a 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. @@ -60,7 +60,9 @@ 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 +// +//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) @@ -90,7 +92,9 @@ 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 +// +//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) @@ -114,7 +118,9 @@ 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 +// +//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) @@ -123,7 +129,9 @@ 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 +// +//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) @@ -132,7 +140,9 @@ 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 +// +//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) @@ -162,7 +172,9 @@ 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 +// +//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) @@ -186,7 +198,9 @@ 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 +// +//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) @@ -195,7 +209,9 @@ 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 +// +//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) @@ -204,7 +220,9 @@ 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 +// +//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) @@ -234,7 +252,9 @@ 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 +// +//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) @@ -258,7 +278,9 @@ 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 +// +//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) @@ -267,7 +289,9 @@ 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 +// +//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) @@ -276,7 +300,9 @@ 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 +// +//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) @@ -306,7 +332,9 @@ 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 +// +//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) @@ -330,7 +358,9 @@ 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 +// +//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) @@ -339,7 +369,9 @@ 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 +// +//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) @@ -348,7 +380,9 @@ 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 +// +//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) @@ -375,7 +409,9 @@ 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 +// +//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) @@ -398,7 +434,9 @@ 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 +// +//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) @@ -407,7 +445,9 @@ 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 +// +//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) @@ -416,7 +456,9 @@ 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 +// +//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) @@ -442,7 +484,9 @@ 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 +// +//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) @@ -465,7 +509,9 @@ 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 +// +//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) @@ -474,7 +520,9 @@ 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 +// +//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) @@ -498,7 +546,9 @@ 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 +// +//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 60ff9b41347..e158562e69d 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/en/rest/repos/repos#update-a-repository +// 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) @@ -566,7 +582,9 @@ 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}". +// +//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) @@ -1251,7 +1293,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) @@ -1277,7 +1321,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)) @@ -1308,7 +1354,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} @@ -1330,7 +1378,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) @@ -1357,7 +1407,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) @@ -1381,7 +1433,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) @@ -1404,7 +1458,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) @@ -1428,7 +1484,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) @@ -1443,7 +1501,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) @@ -1468,7 +1528,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) @@ -1492,7 +1554,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) @@ -1510,7 +1574,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) @@ -1531,7 +1597,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,7 +1612,9 @@ 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 +// +//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) @@ -1565,7 +1635,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) @@ -1590,7 +1662,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) @@ -1615,7 +1689,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)) @@ -1644,7 +1720,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) @@ -1659,7 +1737,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) @@ -1681,7 +1761,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) @@ -1702,7 +1784,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) @@ -1720,7 +1804,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) @@ -1742,7 +1828,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{ @@ -1773,9 +1861,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) @@ -1795,9 +1885,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) } @@ -1810,7 +1902,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) @@ -1834,7 +1928,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) @@ -1858,7 +1954,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) @@ -1880,7 +1978,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) @@ -1905,7 +2005,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) @@ -1929,7 +2031,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) @@ -1953,7 +2057,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) @@ -1975,7 +2081,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,7 +2108,9 @@ 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/en/rest/branches/branch-protection#set-team-access-restrictions +// 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,7 +2134,9 @@ 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/en/rest/branches/branch-protection#add-team-access-restrictions +// 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,7 +2160,9 @@ 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/en/rest/branches/branch-protection#remove-team-access-restrictions +// 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) @@ -2080,7 +2194,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) @@ -2109,7 +2225,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) @@ -2137,7 +2255,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) @@ -2157,7 +2277,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 d1fb577c61c..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,8 +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-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 +// +//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) @@ -173,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) @@ -202,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)) @@ -227,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) @@ -258,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) @@ -291,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 cfb4a6da22f..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) @@ -130,6 +132,10 @@ 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 +// +//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) @@ -164,6 +170,10 @@ 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 +// +//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) @@ -200,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 @@ -240,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) @@ -260,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) @@ -280,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) @@ -312,7 +330,11 @@ 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 +// +//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 e22ca5cd1be..ed81e3a1f95 100644 --- a/github/repos_environments.go +++ b/github/repos_environments.go @@ -107,7 +107,9 @@ 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 +// +//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 ba229e7bca8..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) @@ -202,7 +216,9 @@ 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 +// +//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 { @@ -214,7 +230,9 @@ 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 +// +//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 42c5de49709..cc86f8bbd09 100644 --- a/github/repos_keys.go +++ b/github/repos_keys.go @@ -14,7 +14,9 @@ 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 +// +//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) @@ -38,7 +40,9 @@ 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 +// +//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) @@ -58,7 +62,9 @@ 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 +// +//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) @@ -78,7 +84,9 @@ 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 +// +//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 6ac2e5a8778..f0153c08086 100644 --- a/github/repos_lfs.go +++ b/github/repos_lfs.go @@ -12,7 +12,9 @@ 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 +// +//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) @@ -31,7 +33,9 @@ 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 +// +//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 060f6eb8b1d..6b9ba76e44d 100644 --- a/github/repos_pages.go +++ b/github/repos_pages.go @@ -103,7 +103,9 @@ 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 +// +//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) @@ -153,7 +155,9 @@ 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 +// +//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) @@ -172,7 +176,9 @@ 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 +// +//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) @@ -188,7 +194,9 @@ 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 +// +//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) @@ -207,7 +215,9 @@ 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 +// +//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) @@ -231,7 +241,9 @@ 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 +// +//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) @@ -250,7 +262,9 @@ 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 +// +//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) @@ -269,7 +283,9 @@ 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 +// +//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) @@ -288,7 +304,9 @@ func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo // GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages. // -// GitHub API docs: https://docs.github.com/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 +// +//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 1ce6478d33b..e8361383f57 100644 --- a/github/repos_prereceive_hooks.go +++ b/github/repos_prereceive_hooks.go @@ -24,7 +24,9 @@ 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 +// +//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) @@ -51,7 +53,9 @@ 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 +// +//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) @@ -73,7 +77,9 @@ 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 +// +//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) @@ -95,7 +101,9 @@ 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 +// +//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 2c24f8c27b3..b47b37038ed 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 7deee6be4b5..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.) @@ -81,7 +81,9 @@ 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 +// +//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) @@ -105,7 +107,9 @@ 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 +// +//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) @@ -123,7 +127,9 @@ 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 +// +//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) @@ -142,7 +148,9 @@ 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 +// +//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.) @@ -175,7 +183,9 @@ 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 +// +//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) @@ -193,7 +203,9 @@ 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 +// +//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 adb832d0d8f..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. @@ -72,7 +72,9 @@ 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 +// +//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/en/rest/search#search-topics +// 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) @@ -142,7 +146,9 @@ 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 +// +//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) @@ -162,7 +168,9 @@ 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 +// +//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) @@ -182,7 +190,9 @@ 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 +// +//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) @@ -235,7 +245,9 @@ 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 +// +//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) @@ -270,7 +282,9 @@ 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 +// +//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 ddcbfc1b667..9b2ad8cd0d2 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 } @@ -95,7 +95,9 @@ 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 +// +//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) @@ -122,7 +124,9 @@ 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 +// +//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) @@ -149,7 +153,9 @@ 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 +// +//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) @@ -176,7 +182,9 @@ 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 +// +//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) @@ -199,7 +207,9 @@ 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 +// +//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) @@ -222,7 +232,9 @@ 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 +// +//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 681d0cd4bd5..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) @@ -97,7 +101,9 @@ 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 +// +//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 0ee7c200792..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) @@ -752,7 +807,9 @@ 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 +// +//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) @@ -777,7 +834,9 @@ 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 +// +//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) @@ -798,7 +857,9 @@ 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 +// +//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) @@ -819,7 +880,9 @@ 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 +// +//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) @@ -840,7 +903,9 @@ 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 +// +//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 1b0670103b3..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 != "" { @@ -104,7 +107,9 @@ 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}". +// +//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 aef947ec451..02cb894bc3b 100644 --- a/github/users_administration.go +++ b/github/users_administration.go @@ -12,7 +12,9 @@ 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 +// +//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) @@ -26,7 +28,9 @@ 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 +// +//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) @@ -45,7 +49,9 @@ 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 +// +//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) @@ -59,7 +65,9 @@ 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 +// +//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 54189b83077..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) @@ -95,7 +100,9 @@ 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 +// +//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 c3ffc6ab074..3ccf68a1696 100644 --- a/github/users_packages.go +++ b/github/users_packages.go @@ -13,8 +13,11 @@ import ( // ListPackages lists the packages for a user. Passing the empty string for "user" will // list packages for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -44,8 +47,11 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack // GetPackage gets a package by name for a user. Passing the empty string for "user" will // get the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -71,8 +77,11 @@ func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packag // DeletePackage deletes a package from a user. Passing the empty string for "user" will // delete the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -92,8 +101,11 @@ func (s *UsersService) DeletePackage(ctx context.Context, user, packageType, pac // RestorePackage restores a package to a user. Passing the empty string for "user" will // restore the package for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -113,8 +125,11 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // PackageGetAllVersions gets 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 +// +//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 != "" { @@ -144,8 +159,11 @@ func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageT // PackageGetVersion gets a specific version of a package for a user. Passing the empty string for "user" will // get the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -171,8 +189,11 @@ func (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, // PackageDeleteVersion deletes a package version for a user. Passing the empty string for "user" will // delete the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 != "" { @@ -192,8 +213,11 @@ func (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageTy // PackageRestoreVersion restores a package version to a user. Passing the empty string for "user" will // restore the version for the authenticated user. // -// GitHub API docs: https://docs.github.com/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 +// +//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 23e4c36aea3..fcc930be628 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 // DeleteSSHSigningKey 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/openapi_operations.yaml b/openapi_operations.yaml new file mode 100644 index 00000000000..f2b1af28843 --- /dev/null +++ b/openapi_operations.yaml @@ -0,0 +1,6291 @@ +operations: + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics + documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics + openapi_files: + - descriptions/ghec/ghec.json + - name: DELETE /enterprise/announcement + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/announcement#remove-the-global-announcement-banner + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - name: GET /repos/{owner}/{repo}/pages/health + documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/pre-receive-hooks + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} + documentation_url: https://docs.github.com/enterprise-server@3.10/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository + openapi_files: + - descriptions/ghes-3.10/ghes-3.10.json + - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting + documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 + - 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 diff --git a/script/lint.sh b/script/lint.sh index af5ae991006..b76758a47d4 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 openapi_operations.yaml is consistent with the +#/ descriptions from github.com/github/rest-api-description. set -e @@ -10,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" @@ -28,11 +37,17 @@ for dir in $MOD_DIRS; do else "$BIN"/golangci-lint run --path-prefix "$dir" fi - ) || FAILED=1 + ) || fail "failed linting $dir" done -script/generate.sh --check || FAILED=1 - -if [ -n "$FAILED" ]; then - exit 1 +if [ -n "$CHECK_GITHUB_OPENAPI" ]; then + 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 || fail "failed validating generated files" + +[ -z "$FAILED" ] || exit 1 + +exit "$EXIT_CODE" diff --git a/script/metadata.sh b/script/metadata.sh new file mode 100755 index 00000000000..3b7c7fbeb8b --- /dev/null +++ b/script/metadata.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#/ script/metadata.sh runs ./tools/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/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/go.mod b/tools/go.mod new file mode 100644 index 00000000000..8085d1a1ce9 --- /dev/null +++ b/tools/go.mod @@ -0,0 +1,24 @@ +module tools + +go 1.20 + +require ( + github.com/alecthomas/kong v0.8.1 + github.com/getkin/kin-openapi v0.120.0 + github.com/google/go-cmp v0.6.0 + github.com/google/go-github/v56 v56.0.0 + golang.org/x/sync v0.4.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + 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.5 // indirect + github.com/stretchr/testify v1.8.4 // indirect +) diff --git a/tools/go.sum b/tools/go.sum new file mode 100644 index 00000000000..46bc40af389 --- /dev/null +++ b/tools/go.sum @@ -0,0 +1,61 @@ +github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +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/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.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= +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/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= +github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +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.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= +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= +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= +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/metadata/main.go b/tools/metadata/main.go new file mode 100644 index 00000000000..0b0562948f0 --- /dev/null +++ b/tools/metadata/main.go @@ -0,0 +1,194 @@ +// 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. + +// metadata is a command-line tool used to check and update this repo. +// See CONTRIBUTING.md for details. +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "path/filepath" + + "github.com/alecthomas/kong" + "github.com/google/go-github/v56/github" +) + +var helpVars = kong.Vars{ + "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 { + UpdateOpenAPI updateOpenAPICmd `kong:"cmd,name=update-openapi,help=${update_openapi_help}"` + UpdateGo updateGoCmd `kong:"cmd,help=${update_go_help}"` + Format formatCmd `kong:"cmd,help=${format_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) opsFile() (string, *operationsFile, error) { + filename := filepath.Join(c.WorkingDir, "openapi_operations.yaml") + opsFile, err := loadOperationsFile(filename) + if err != nil { + return "", nil, err + } + return filename, opsFile, nil +} + +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 github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, "") +} + +type updateOpenAPICmd struct { + 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() + 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 + } + 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 + } + 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, opsFile, err := root.opsFile() + if err != nil { + return err + } + return opsFile.saveFile(filename) +} + +type updateGoCmd struct{} + +func (c *updateGoCmd) Run(root *rootCmd) error { + _, opsFile, err := root.opsFile() + if err != nil { + return err + } + err = updateDocs(opsFile, filepath.Join(root.WorkingDir, "github")) + return err +} + +type unusedCmd struct { + JSON bool `kong:"help=${output_json_help}"` +} + +func (c *unusedCmd) Run(root *rootCmd, k *kong.Context) error { + _, opsFile, err := root.opsFile() + if err != nil { + return err + } + unused, err := unusedOps(opsFile, filepath.Join(root.WorkingDir, "github")) + if err != nil { + return err + } + if c.JSON { + enc := json.NewEncoder(k.Stdout) + enc.SetIndent("", " ") + return enc.Encode(unused) + } + fmt.Fprintf(k.Stdout, "Found %d unused operations\n", len(unused)) + if len(unused) == 0 { + return nil + } + fmt.Fprintln(k.Stdout, "") + for _, op := range unused { + fmt.Fprintln(k.Stdout, op.Name) + if op.DocumentationURL != "" { + fmt.Fprintf(k.Stdout, "doc: %s\n", op.DocumentationURL) + } + fmt.Fprintln(k.Stdout, "") + } + return nil +} + +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 + 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..39fe5357d0f --- /dev/null +++ b/tools/metadata/main_test.go @@ -0,0 +1,422 @@ +// 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 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("invalid", func(t *testing.T) { + res := runTest(t, "testdata/update-go/invalid", "update-go") + res.assertOutput("", "") + 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{ + 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-openapi", "update-openapi", "--github-url", testServer.URL) + 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() + 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() { + 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() + 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 { + 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 + } + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } + 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 + } + if !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) { + golden = false + } + 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 + } + golden = false + 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.TrimSpace(r.err.Error()) != strings.TrimSpace(want) { + r.t.Errorf("unexpected error:\nwant:\n%s\ngot:\n%s", 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) bool { + t.Helper() + wantBytes, err := os.ReadFile(want) + if !assertNilError(t, err) { + return false + } + wantBytes = bytes.ReplaceAll(wantBytes, []byte("\r\n"), []byte("\n")) + gotBytes, err := os.ReadFile(got) + if !assertNilError(t, err) { + return false + } + gotBytes = bytes.ReplaceAll(gotBytes, []byte("\r\n"), []byte("\n")) + 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 + } + return true +} + +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..c60a1cfe215 --- /dev/null +++ b/tools/metadata/metadata.go @@ -0,0 +1,520 @@ +// 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" + "errors" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" + "net/url" + "os" + "path" + "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 + }) +} + +// normalizeOpPath returns an endpoint with all templated path parameters replaced with *. +func normalizeOpPath(opPath string) string { + if !strings.ContainsAny(opPath, "{%") { + return opPath + } + segments := strings.Split(opPath, "/") + for i, segment := range segments { + if len(segment) == 0 { + continue + } + if segment[0] == '{' || segment[0] == '%' { + segments[i] = "*" + } + } + return strings.Join(segments, "/") +} + +func normalizedOpName(name string) string { + verb, u := parseOpName(name) + 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) { + match := opNameRe.FindStringSubmatch(id) + if match == nil { + return "", "" + } + u := strings.TrimSpace(match[2]) + if !strings.HasPrefix(u, "/") { + u = "/" + u + } + return strings.ToUpper(match[1]), u +} + +type operationsFile struct { + 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 *operationsFile) 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 *operationsFile) saveFile(filename string) (errOut error) { + sortOperations(m.ManualOps) + sortOperations(m.OverrideOps) + sortOperations(m.OpenapiOps) + f, err := os.Create(filename) + if err != nil { + return err + } + defer func() { + e := f.Close() + if errOut == nil { + errOut = e + } + }() + 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 { + 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, + }) +} + +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 + } + var result []*operation + opsFile.resolve() + for opName, op := range opsFile.resolvedOps { + if !usedOps[opName] { + result = append(result, op) + } + } + sortOperations(result) + return result, 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{} + + ops, err := methodOps(opsFile, cmap, fn) + if err != nil { + return err + } + if len(ops) == 0 { + return fmt.Errorf("no operations defined for %s", serviceMethod) + } + + 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) + } + + 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) + } + + // 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) + } + sort.Strings(docLinks) + + for _, dl := range docLinks { + group.List = append( + group.List, + &ast.Comment{ + Text: "// GitHub API docs: " + cleanURLPath(dl), + }, + ) + } + _, 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}) + } + for _, op := range ops { + group.List = append(group.List, &ast.Comment{ + Text: fmt.Sprintf("//meta:operation %s", op.Name), + }) + } + group.List[0].Slash = fn.Pos() - 1 + for i := 1; i < len(group.List); i++ { + group.List[i].Slash = token.NoPos + } + return nil + } +} + +// 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)) +} + +type nodeVisitor func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error + +// 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 + } + for _, dirEntry := range dirEntries { + filename := filepath.Join(dir, dirEntry.Name()) + if dirEntry.IsDir() || + !strings.HasSuffix(filename, ".go") || + strings.HasSuffix(filename, "_test.go") { + continue + } + err = errors.Join(err, visitFileMethods(writeFiles, filename, visit)) + } + return err +} + +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")) + + fset := token.NewFileSet() + fileNode, err := parser.ParseFile(fset, "", content, parser.ParseComments) + if err != nil { + return err + } + cmap := ast.NewCommentMap(fset, fileNode, fileNode.Comments) + + ast.Inspect(fileNode, func(n ast.Node) bool { + fn, ok := n.(*ast.FuncDecl) + if !ok { + return true + } + serviceMethod := nodeServiceMethod(fn) + if serviceMethod == "" { + return true + } + e := visit(serviceMethod, fn, cmap) + err = errors.Join(err, e) + return true + }) + if err != nil { + return err + } + if !updateFile { + return nil + } + fileNode.Comments = cmap.Filter(fileNode).Comments() + var buf bytes.Buffer + err = printer.Fprint(&buf, fset, fileNode) + if err != nil { + return err + } + updatedContent, err := format.Source(buf.Bytes()) + if err != nil { + return err + } + if bytes.Equal(content, updatedContent) { + return nil + } + return os.WriteFile(filename, updatedContent, 0600) +} + +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:`) +) + +// 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)) + } + } + } + sortOperations(ops) + return ops, err +} + +// 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 docURL + } + u.Path = path.Clean(u.Path) + return u.String() +} + +// 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 := fn.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() || !fn.Name.IsExported() || !strings.HasSuffix(id.Name, "Service") { + return "" + } + + 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..c3ad0a788f9 --- /dev/null +++ b/tools/metadata/metadata_test.go @@ -0,0 +1,28 @@ +// 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 ( + "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/openapi.go b/tools/metadata/openapi.go new file mode 100644 index 00000000000..4b858481f5e --- /dev/null +++ b/tools/metadata/openapi.go @@ -0,0 +1,172 @@ +// 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" + "io" + "regexp" + "sort" + "strconv" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/google/go-github/v56/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 +} + +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 *github.Client, gitRef string) error { + contents, resp, err := client.Repositories.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 + } + 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 { + 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 *github.Client, gitRef string) ([]*openapiFile, error) { + _, dir, resp, err := client.Repositories.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 + } + 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 + } + files = append(files, &file) + 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/metadata/testdata/format/openapi_operations.yaml b/tools/metadata/testdata/format/openapi_operations.yaml new file mode 100644 index 00000000000..abaafeb9aa8 --- /dev/null +++ b/tools/metadata/testdata/format/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 /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} # 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/TestFormat/openapi_operations.yaml b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml new file mode 100644 index 00000000000..524d56817fb --- /dev/null +++ b/tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml @@ -0,0 +1,13 @@ +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/TestUpdateGo/valid/github/a.go b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go new file mode 100644 index 00000000000..571c1eb2da9 --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go @@ -0,0 +1,37 @@ +package github + +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() {} + +// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a +// +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} + +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} + +func (i *internalService) Get() {} diff --git a/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml new file mode 100644 index 00000000000..c1e3cf4cbd6 --- /dev/null +++ b/tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml @@ -0,0 +1,14 @@ +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/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/unused/openapi_operations.yaml b/tools/metadata/testdata/unused/openapi_operations.yaml new file mode 100644 index 00000000000..c5c3772b1f3 --- /dev/null +++ b/tools/metadata/testdata/unused/openapi_operations.yaml @@ -0,0 +1,15 @@ +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} +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-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-go/valid/github/a.go b/tools/metadata/testdata/update-go/valid/github/a.go new file mode 100644 index 00000000000..7885efd8c79 --- /dev/null +++ b/tools/metadata/testdata/update-go/valid/github/a.go @@ -0,0 +1,31 @@ +package github + +type AService struct{} + +// Get gets an A +//meta:operation GET /a/{non-canonical-id} +func (s *AService) Get() {} + +// Undocumented uses an undocumented operation +//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#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() {} + +//meta:operation GET /a/{a_id} +func (s *AService) Uncommented() {} + +func (s *AService) unexported() {} + +func NotAMethod() {} + +type internalService struct{} + +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/update-go/valid/openapi_operations.yaml b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml new file mode 100644 index 00000000000..ed401c0d283 --- /dev/null +++ b/tools/metadata/testdata/update-go/valid/openapi_operations.yaml @@ -0,0 +1,13 @@ +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/update-openapi/openapi_operations.yaml b/tools/metadata/testdata/update-openapi/openapi_operations.yaml new file mode 100644 index 00000000000..1577e739ab6 --- /dev/null +++ b/tools/metadata/testdata/update-openapi/openapi_operations.yaml @@ -0,0 +1,4 @@ +operations: + - name: GET /a/{a_id} + documentation_url: https://docs.github.com/rest/a/a#get-a +openapi_commit: s 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 81d9a3a5848..00000000000 --- a/update-urls/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/google/go-github/v56/update-urls - -go 1.16 - -require ( - github.com/google/go-cmp v0.6.0 - 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 ddc1bfa1ce9..00000000000 --- a/update-urls/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -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/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 -
-
- -
-
-
-
- - - - - -
- -