Skip to content

Commit 0b8fe4d

Browse files
Commit via running ake Sources/code-scanning
1 parent ed0cef5 commit 0b8fe4d

File tree

2 files changed

+116
-112
lines changed

2 files changed

+116
-112
lines changed

Sources/code-scanning/Client.swift

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public struct Client: APIProtocol {
4242
///
4343
/// Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
4444
///
45-
/// To use this endpoint, you must be an owner or security manager for the organization, and you must use an access token with the `repo` scope or `security_events` scope.
45+
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
4646
///
47-
/// For public repositories, you may instead use the `public_repo` scope.
47+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
4848
///
4949
/// - Remark: HTTP `GET /orgs/{org}/code-scanning/alerts`.
5050
/// - Remark: Generated from `#/paths//orgs/{org}/code-scanning/alerts/get(code-scanning/list-alerts-for-org)`.
@@ -232,12 +232,12 @@ public struct Client: APIProtocol {
232232
///
233233
/// Lists code scanning alerts.
234234
///
235-
/// To use this endpoint, you must use an access token with the `security_events` scope or, for alerts from public repositories only, an access token with the `public_repo` scope.
236-
///
237235
/// The response includes a `most_recent_instance` object.
238236
/// This provides details of the most recent instance of this alert
239237
/// for the default branch (or for the specified Git reference if you used `ref` in the request).
240238
///
239+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
240+
///
241241
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts`.
242242
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/get(code-scanning/list-alerts-for-repo)`.
243243
public func code_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_repo(_ input: Operations.code_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_repo.Input) async throws -> Operations.code_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_repo.Output {
@@ -432,7 +432,9 @@ public struct Client: APIProtocol {
432432
}
433433
/// Get a code scanning alert
434434
///
435-
/// Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint with private repositories, the `public_repo` scope also grants permission to read security events on public repositories only.
435+
/// Gets a single code scanning alert.
436+
///
437+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
436438
///
437439
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}`.
438440
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/get(code-scanning/get-alert)`.
@@ -566,7 +568,8 @@ public struct Client: APIProtocol {
566568
}
567569
/// Update a code scanning alert
568570
///
569-
/// Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint with private repositories. You can also use tokens with the `public_repo` scope for public repositories only.
571+
/// Updates the status of a single code scanning alert.
572+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
570573
///
571574
/// - Remark: HTTP `PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}`.
572575
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/patch(code-scanning/update-alert)`.
@@ -708,8 +711,8 @@ public struct Client: APIProtocol {
708711
/// List instances of a code scanning alert
709712
///
710713
/// Lists all instances of the specified code scanning alert.
711-
/// You must use an access token with the `security_events` scope to use this endpoint with private repositories,
712-
/// the `public_repo` scope also grants permission to read security events on public repositories only.
714+
///
715+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
713716
///
714717
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances`.
715718
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances/get(code-scanning/list-alert-instances)`.
@@ -873,12 +876,11 @@ public struct Client: APIProtocol {
873876
/// For very old analyses this data is not available,
874877
/// and `0` is returned in this field.
875878
///
876-
/// You must use an access token with the `security_events` scope to use this endpoint with private repositories,
877-
/// the `public_repo` scope also grants permission to read security events on public repositories only.
878-
///
879879
/// **Deprecation notice**:
880880
/// The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.
881881
///
882+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
883+
///
882884
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/analyses`.
883885
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/analyses/get(code-scanning/list-recent-analyses)`.
884886
public func code_hyphen_scanning_sol_list_hyphen_recent_hyphen_analyses(_ input: Operations.code_hyphen_scanning_sol_list_hyphen_recent_hyphen_analyses.Input) async throws -> Operations.code_hyphen_scanning_sol_list_hyphen_recent_hyphen_analyses.Output {
@@ -1066,9 +1068,6 @@ public struct Client: APIProtocol {
10661068
///
10671069
/// Gets a specified code scanning analysis for a repository.
10681070
///
1069-
/// You must use an access token with the `security_events` scope to use this endpoint with private repositories,
1070-
/// the `public_repo` scope also grants permission to read security events on public repositories only.
1071-
///
10721071
/// The default JSON response contains fields that describe the analysis.
10731072
/// This includes the Git reference and commit SHA to which the analysis relates,
10741073
/// the datetime of the analysis, the name of the code scanning tool,
@@ -1083,6 +1082,8 @@ public struct Client: APIProtocol {
10831082
///
10841083
/// - **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.
10851084
///
1085+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
1086+
///
10861087
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}`.
10871088
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}/get(code-scanning/get-analysis)`.
10881089
public func code_hyphen_scanning_sol_get_hyphen_analysis(_ input: Operations.code_hyphen_scanning_sol_get_hyphen_analysis.Input) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_analysis.Output {
@@ -1222,10 +1223,7 @@ public struct Client: APIProtocol {
12221223
}
12231224
/// Delete a code scanning analysis from a repository
12241225
///
1225-
/// Deletes a specified code scanning analysis from a repository. For
1226-
/// private repositories, you must use an access token with the `repo` scope. For public repositories,
1227-
/// you must use an access token with `public_repo` scope.
1228-
/// GitHub Apps must have the `security_events` write permission to use this endpoint.
1226+
/// Deletes a specified code scanning analysis from a repository.
12291227
///
12301228
/// You can delete one analysis at a time.
12311229
/// To delete a series of analyses, start with the most recent analysis and work backwards.
@@ -1288,6 +1286,8 @@ public struct Client: APIProtocol {
12881286
///
12891287
/// The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.
12901288
///
1289+
/// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
1290+
///
12911291
/// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}`.
12921292
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}/delete(code-scanning/delete-analysis)`.
12931293
public func code_hyphen_scanning_sol_delete_hyphen_analysis(_ input: Operations.code_hyphen_scanning_sol_delete_hyphen_analysis.Input) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_analysis.Output {
@@ -1458,8 +1458,7 @@ public struct Client: APIProtocol {
14581458
///
14591459
/// Lists the CodeQL databases that are available in a repository.
14601460
///
1461-
/// For private repositories, you must use an access token with the `security_events` scope.
1462-
/// For public repositories, you can use tokens with the `security_events` or `public_repo` scope.
1461+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
14631462
///
14641463
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`.
14651464
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`.
@@ -1598,8 +1597,7 @@ public struct Client: APIProtocol {
15981597
/// your HTTP client is configured to follow redirects or use the `Location` header
15991598
/// to make a second request to get the redirect URL.
16001599
///
1601-
/// For private repositories, you must use an access token with the `security_events` scope.
1602-
/// For public repositories, you can use tokens with the `security_events` or `public_repo` scope.
1600+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
16031601
///
16041602
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`.
16051603
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`.
@@ -1734,8 +1732,8 @@ public struct Client: APIProtocol {
17341732
/// Get a code scanning default setup configuration
17351733
///
17361734
/// Gets a code scanning default setup configuration.
1737-
/// You must use an access token with the `repo` scope to use this endpoint with private repositories or the `public_repo`
1738-
/// scope for public repositories.
1735+
///
1736+
/// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
17391737
///
17401738
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/default-setup`.
17411739
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/get(code-scanning/get-default-setup)`.
@@ -1867,8 +1865,8 @@ public struct Client: APIProtocol {
18671865
/// Update a code scanning default setup configuration
18681866
///
18691867
/// Updates a code scanning default setup configuration.
1870-
/// You must use an access token with the `repo` scope to use this endpoint with private repositories or the `public_repo`
1871-
/// scope for public repositories.
1868+
///
1869+
/// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
18721870
///
18731871
/// - Remark: HTTP `PATCH /repos/{owner}/{repo}/code-scanning/default-setup`.
18741872
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)`.
@@ -2052,7 +2050,7 @@ public struct Client: APIProtocol {
20522050
}
20532051
/// Upload an analysis as SARIF data
20542052
///
2055-
/// Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint for private repositories. You can also use tokens with the `public_repo` scope for public repositories only. GitHub Apps must have the `security_events` write permission to use this endpoint. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."
2053+
/// Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."
20562054
///
20572055
/// There are two places where you can upload code scanning results.
20582056
/// - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
@@ -2083,6 +2081,8 @@ public struct Client: APIProtocol {
20832081
/// You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.
20842082
/// For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."
20852083
///
2084+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
2085+
///
20862086
/// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/sarifs`.
20872087
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/post(code-scanning/upload-sarif)`.
20882088
public func code_hyphen_scanning_sol_upload_hyphen_sarif(_ input: Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Input) async throws -> Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Output {
@@ -2225,7 +2225,8 @@ public struct Client: APIProtocol {
22252225
}
22262226
/// Get information about a SARIF upload
22272227
///
2228-
/// Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint with private repositories, the `public_repo` scope also grants permission to read security events on public repositories only.
2228+
/// Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."
2229+
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
22292230
///
22302231
/// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}`.
22312232
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}/get(code-scanning/get-sarif)`.

0 commit comments

Comments
 (0)