diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 26a285de274..d92c5ad8035 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,8 +11,7 @@ updates: schedule: interval: "weekly" -# FIXME: Need other way to update OAS. - # - package-ecosystem: "gitsubmodule" - # directory: "/" - # schedule: - # interval: "weekly" + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/CI-Dependabot.yml similarity index 88% rename from .github/workflows/Dependabot.yml rename to .github/workflows/CI-Dependabot.yml index 8083e4d1339..df8e19bae5d 100644 --- a/.github/workflows/Dependabot.yml +++ b/.github/workflows/CI-Dependabot.yml @@ -31,13 +31,13 @@ jobs: os: ${{ matrix.os }} - name: "Sync code base" env: - PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr checkout ${{ github.event.pull_request.number }} git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - make install + make -j 3 install git push gh pr merge --auto --merge "$PR_URL" gh pr review --approve "$PR_URL" diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 00000000000..1fdf097face --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + schedule: + - cron: '0 0 1 * *' # 每月的第一天 00:00 UTC + workflow_dispatch: # 允許手動觸發工作流 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + + create-git-branch-release: + runs-on: ubuntu-latest + permissions: + contents: write + env: + RELEASE_BRANCH: release + outputs: + branch: ${{ env.RELEASE_BRANCH }} + steps: + - uses: actions/checkout@v4 + + - name: Create release branch + run: git checkout -B $RELEASE_BRANCH + + - name: Remove submodule (if exists) + env: + SUBMODULE_PATH: Submodule/github/rest-api-description + run: | + if [ -d "$SUBMODULE_PATH" ]; then + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git submodule deinit -f $SUBMODULE_PATH || true + git rm -f $SUBMODULE_PATH || true + rm -rf .git/modules/$SUBMODULE_PATH || true + git commit -m "Remove submodule" + else + echo "Submodule not found, skipping removal." + fi + + - name: Push release branch + run: git push --force --set-upstream origin $RELEASE_BRANCH + + create-github-release: + needs: create-git-branch-release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: Wei18/GitHubSwiftActions/Actions/Release@1.0.3 + with: + owner: ${{ github.repository_owner }} + repo: ${{ github.event.repository.name }} + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ needs.create-git-branch-release.outputs.branch }} + type: "patch" diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.spi.yml b/.spi.yml index c5f8ce72eeb..f829d7e353b 100644 --- a/.spi.yml +++ b/.spi.yml @@ -31,6 +31,7 @@ builder: - GitHubRestAPIOidc - GitHubRestAPIOrgs - GitHubRestAPIPackages + - GitHubRestAPIPrivate_Registries - GitHubRestAPIProjects - GitHubRestAPIPulls - GitHubRestAPIRate_Limit diff --git a/Makefile b/Makefile index f608a353573..00ec777e20d 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,9 @@ commit: Sources/%: Sources/%/Client.swift Sources/%/Types.swift @$(MAKE) commit file="$@" +# Prevent submodule update from running in parallel with other jobs +.NOTPARALLEL: Submodule + # Update openapi specification if needed .PHONY: Submodule Submodule: diff --git a/Package.swift b/Package.swift index abb5eac1ca7..be43e368b45 100644 --- a/Package.swift +++ b/Package.swift @@ -40,6 +40,7 @@ let package = Package( .library(name: "GitHubRestAPIOidc", targets: ["GitHubRestAPIOidc"]), .library(name: "GitHubRestAPIOrgs", targets: ["GitHubRestAPIOrgs"]), .library(name: "GitHubRestAPIPackages", targets: ["GitHubRestAPIPackages"]), + .library(name: "GitHubRestAPIPrivate_Registries", targets: ["GitHubRestAPIPrivate_Registries"]), .library(name: "GitHubRestAPIProjects", targets: ["GitHubRestAPIProjects"]), .library(name: "GitHubRestAPIPulls", targets: ["GitHubRestAPIPulls"]), .library(name: "GitHubRestAPIRate_Limit", targets: ["GitHubRestAPIRate_Limit"]), @@ -288,6 +289,14 @@ let package = Package( ], path: "Sources/packages" ), + .target( + name: "GitHubRestAPIPrivate_Registries", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/private-registries" + ), .target( name: "GitHubRestAPIProjects", dependencies: [ diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index add941952b2..904b4653304 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -779,6 +779,804 @@ public struct Client: APIProtocol { } ) } + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "visible_to_repository", + value: input.query.visible_to_repository + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public func actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.runner_hyphen_groups_hyphen_org.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public func actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.runner_hyphen_groups_hyphen_org.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public func actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.runner_hyphen_groups_hyphen_org.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public func actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org(_ input: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input) async throws -> Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repository access to a self-hosted runner group in an organization + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/repositories", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set repository access for a self-hosted runner group in an organization + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/repositories", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add repository access to a self-hosted runner group in an organization + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.runner_group_id, + input.path.repository_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove repository access to a self-hosted runner group in an organization + /// + /// 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`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.runner_group_id, + input.path.repository_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public func actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners", + parameters: [ + input.path.org, + input.path.runner_group_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public func actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + parameters: [ + input.path.org, + input.path.runner_group_id, + input.path.runner_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public func actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + parameters: [ + input.path.org, + input.path.runner_group_id, + input.path.runner_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List self-hosted runners for an organization /// /// Lists all self-hosted runners configured in an organization. diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index b81f0496849..220613fe563 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -126,6 +126,123 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. func actions_sol_set_hyphen_github_hyphen_actions_hyphen_default_hyphen_workflow_hyphen_permissions_hyphen_organization(_ input: Operations.actions_sol_set_hyphen_github_hyphen_actions_hyphen_default_hyphen_workflow_hyphen_permissions_hyphen_organization.Input) async throws -> Operations.actions_sol_set_hyphen_github_hyphen_actions_hyphen_default_hyphen_workflow_hyphen_permissions_hyphen_organization.Output + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + func actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + func actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + func actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + func actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org(_ input: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input) async throws -> Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Output + /// List repository access to a self-hosted runner group in an organization + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + func actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output + /// Set repository access for a self-hosted runner group in an organization + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + func actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output + /// Add repository access to a self-hosted runner group in an organization + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + func actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output + /// Remove repository access to a self-hosted runner group in an organization + /// + /// 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`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + func actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(_ input: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input) async throws -> Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + func actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + func actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Output + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + func actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Output /// List self-hosted runners for an organization /// /// Lists all self-hosted runners configured in an organization. @@ -1595,6 +1712,207 @@ extension APIProtocol { body: body )) } + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org( + path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output { + try await actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public func actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public func actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public func actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public func actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org(path: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input.Path) async throws -> Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Output { + try await actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org(Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input(path: path)) + } + /// List repository access to a self-hosted runner group in an organization + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org( + path: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set repository access for a self-hosted runner group in an organization + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org( + path: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path, + body: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input( + path: path, + body: body + )) + } + /// Add repository access to a self-hosted runner group in an organization + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(path: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path) async throws -> Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input(path: path)) + } + /// Remove repository access to a self-hosted runner group in an organization + /// + /// 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`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public func actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(path: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path) async throws -> Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output { + try await actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org(Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input(path: path)) + } + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public func actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public func actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + body: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + body: body + )) + } + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public func actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org(path: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input.Path) async throws -> Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input(path: path)) + } + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public func actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org(path: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input.Path) async throws -> Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input(path: path)) + } /// List self-hosted runners for an organization /// /// Lists all self-hosted runners configured in an organization. @@ -3775,6 +4093,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -3799,6 +4119,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -3820,7 +4141,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -3843,6 +4165,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -3866,6 +4189,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -3982,6 +4306,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -4006,6 +4332,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -4027,7 +4354,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -4050,6 +4378,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -4073,6 +4402,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Scim Error @@ -4421,7 +4751,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -4609,7 +4939,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -5550,6 +5880,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -5558,18 +5910,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -5577,6 +5932,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -6424,6 +6780,103 @@ public enum Components { case can_approve_pull_request_reviews } } + /// - Remark: Generated from `#/components/schemas/runner-groups-org`. + public struct runner_hyphen_groups_hyphen_org: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/runner-groups-org/id`. + public var id: Swift.Double + /// - Remark: Generated from `#/components/schemas/runner-groups-org/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/runner-groups-org/visibility`. + public var visibility: Swift.String + /// - Remark: Generated from `#/components/schemas/runner-groups-org/default`. + public var _default: Swift.Bool + /// Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` + /// + /// - Remark: Generated from `#/components/schemas/runner-groups-org/selected_repositories_url`. + public var selected_repositories_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/runner-groups-org/runners_url`. + public var runners_url: Swift.String + /// - Remark: Generated from `#/components/schemas/runner-groups-org/hosted_runners_url`. + public var hosted_runners_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/runner-groups-org/inherited`. + public var inherited: Swift.Bool + /// - Remark: Generated from `#/components/schemas/runner-groups-org/inherited_allows_public_repositories`. + public var inherited_allows_public_repositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/runner-groups-org/allows_public_repositories`. + public var allows_public_repositories: Swift.Bool + /// If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. + /// + /// - Remark: Generated from `#/components/schemas/runner-groups-org/workflow_restrictions_read_only`. + public var workflow_restrictions_read_only: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/components/schemas/runner-groups-org/restricted_to_workflows`. + public var restricted_to_workflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/components/schemas/runner-groups-org/selected_workflows`. + public var selected_workflows: [Swift.String]? + /// Creates a new `runner_hyphen_groups_hyphen_org`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - visibility: + /// - _default: + /// - selected_repositories_url: Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` + /// - runners_url: + /// - hosted_runners_url: + /// - inherited: + /// - inherited_allows_public_repositories: + /// - allows_public_repositories: + /// - workflow_restrictions_read_only: If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. + /// - restricted_to_workflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + public init( + id: Swift.Double, + name: Swift.String, + visibility: Swift.String, + _default: Swift.Bool, + selected_repositories_url: Swift.String? = nil, + runners_url: Swift.String, + hosted_runners_url: Swift.String? = nil, + inherited: Swift.Bool, + inherited_allows_public_repositories: Swift.Bool? = nil, + allows_public_repositories: Swift.Bool, + workflow_restrictions_read_only: Swift.Bool? = nil, + restricted_to_workflows: Swift.Bool? = nil, + selected_workflows: [Swift.String]? = nil + ) { + self.id = id + self.name = name + self.visibility = visibility + self._default = _default + self.selected_repositories_url = selected_repositories_url + self.runners_url = runners_url + self.hosted_runners_url = hosted_runners_url + self.inherited = inherited + self.inherited_allows_public_repositories = inherited_allows_public_repositories + self.allows_public_repositories = allows_public_repositories + self.workflow_restrictions_read_only = workflow_restrictions_read_only + self.restricted_to_workflows = restricted_to_workflows + self.selected_workflows = selected_workflows + } + public enum CodingKeys: String, CodingKey { + case id + case name + case visibility + case _default = "default" + case selected_repositories_url + case runners_url + case hosted_runners_url + case inherited + case inherited_allows_public_repositories + case allows_public_repositories + case workflow_restrictions_read_only + case restricted_to_workflows + case selected_workflows + } + } /// A label for a self hosted runner /// /// - Remark: Generated from `#/components/schemas/runner-label`. @@ -9035,6 +9488,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias repository_hyphen_id = Swift.Int + /// Only return runner groups that are allowed to be used by this repository. + /// + /// - Remark: Generated from `#/components/parameters/visible-to-repository`. + public typealias visible_hyphen_to_hyphen_repository = Swift.String + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/components/parameters/runner-group-id`. + public typealias runner_hyphen_group_hyphen_id = Swift.Int /// Unique identifier of the self-hosted runner. /// /// - Remark: Generated from `#/components/parameters/runner-id`. @@ -11038,6 +11499,1797 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public enum actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/list-self-hosted-runner-groups-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/page`. + public var page: Components.Parameters.page? + /// Only return runner groups that are allowed to be used by this repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/visible_to_repository`. + public var visible_to_repository: Components.Parameters.visible_hyphen_to_hyphen_repository? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - visible_to_repository: Only return runner groups that are allowed to be used by this repository. + public init( + per_page: Components.Parameters.per_hyphen_page? = nil, + page: Components.Parameters.page? = nil, + visible_to_repository: Components.Parameters.visible_hyphen_to_hyphen_repository? = nil + ) { + self.per_page = per_page + self.page = page + self.visible_to_repository = visible_to_repository + } + } + public var query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/runner_groups`. + public var runner_groups: [Components.Schemas.runner_hyphen_groups_hyphen_org] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - runner_groups: + public init( + total_count: Swift.Double, + runner_groups: [Components.Schemas.runner_hyphen_groups_hyphen_org] + ) { + self.total_count = total_count + self.runner_groups = runner_groups + } + public enum CodingKeys: String, CodingKey { + case total_count + case runner_groups + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_groups_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public enum actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/create-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + public var visibility: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload.visibilityPayload? + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int]? + /// List of runner IDs to add to the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/runners`. + public var runners: [Swift.Int]? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/allows_public_repositories`. + public var allows_public_repositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/restricted_to_workflows`. + public var restricted_to_workflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_workflows`. + public var selected_workflows: [Swift.String]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// - selected_repository_ids: List of repository IDs that can access the runner group. + /// - runners: List of runner IDs to add to the runner group. + /// - allows_public_repositories: Whether the runner group can be used by `public` repositories. + /// - restricted_to_workflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + public init( + name: Swift.String, + visibility: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload.visibilityPayload? = nil, + selected_repository_ids: [Swift.Int]? = nil, + runners: [Swift.Int]? = nil, + allows_public_repositories: Swift.Bool? = nil, + restricted_to_workflows: Swift.Bool? = nil, + selected_workflows: [Swift.String]? = nil + ) { + self.name = name + self.visibility = visibility + self.selected_repository_ids = selected_repository_ids + self.runners = runners + self.allows_public_repositories = allows_public_repositories + self.restricted_to_workflows = restricted_to_workflows + self.selected_workflows = selected_workflows + } + public enum CodingKeys: String, CodingKey { + case name + case visibility + case selected_repository_ids + case runners + case allows_public_repositories + case restricted_to_workflows + case selected_workflows + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. + case json(Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content/application\/json`. + case json(Components.Schemas.runner_hyphen_groups_hyphen_org) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.runner_hyphen_groups_hyphen_org { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.actions_sol_create_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public enum actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.runner_hyphen_groups_hyphen_org) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.runner_hyphen_groups_hyphen_org { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.actions_sol_get_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public enum actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/update-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload.visibilityPayload? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/allows_public_repositories`. + public var allows_public_repositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/restricted_to_workflows`. + public var restricted_to_workflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. + public var selected_workflows: [Swift.String]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// - allows_public_repositories: Whether the runner group can be used by `public` repositories. + /// - restricted_to_workflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selected_workflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + public init( + name: Swift.String, + visibility: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload.visibilityPayload? = nil, + allows_public_repositories: Swift.Bool? = nil, + restricted_to_workflows: Swift.Bool? = nil, + selected_workflows: [Swift.String]? = nil + ) { + self.name = name + self.visibility = visibility + self.allows_public_repositories = allows_public_repositories + self.restricted_to_workflows = restricted_to_workflows + self.selected_workflows = selected_workflows + } + public enum CodingKeys: String, CodingKey { + case name + case visibility + case allows_public_repositories + case restricted_to_workflows + case selected_workflows + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.runner_hyphen_groups_hyphen_org) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.runner_hyphen_groups_hyphen_org { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.actions_sol_update_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public enum actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org { + public static let id: Swift.String = "actions/delete-self-hosted-runner-group-from-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_delete_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_from_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List repository access to a self-hosted runner group in an organization + /// + /// Lists the repositories with access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public enum actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org { + public static let id: Swift.String = "actions/list-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil + ) { + self.page = page + self.per_page = per_page + } + } + public var query: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.minimal_hyphen_repository] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - repositories: + public init( + total_count: Swift.Double, + repositories: [Components.Schemas.minimal_hyphen_repository] + ) { + self.total_count = total_count + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case total_count + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.actions_sol_list_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set repository access for a self-hosted runner group in an organization + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public enum actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org { + public static let id: Swift.String = "actions/set-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - selected_repository_ids: List of repository IDs that can access the runner group. + public init(selected_repository_ids: [Swift.Int]) { + self.selected_repository_ids = selected_repository_ids + } + public enum CodingKeys: String, CodingKey { + case selected_repository_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path, + body: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_set_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add repository access to a self-hosted runner group in an organization + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public enum actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org { + public static let id: Swift.String = "actions/add-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/repository_id`. + public var repository_id: Components.Parameters.repository_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + /// - repository_id: The unique identifier of the repository. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id, + repository_id: Components.Parameters.repository_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + self.repository_id = repository_id + } + } + public var path: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_add_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove repository access to a self-hosted runner group in an organization + /// + /// 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`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public enum actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org { + public static let id: Swift.String = "actions/remove-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repository_id: Components.Parameters.repository_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + /// - repository_id: The unique identifier of the repository. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id, + repository_id: Components.Parameters.repository_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + self.repository_id = repository_id + } + } + public var path: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_remove_hyphen_repo_hyphen_access_hyphen_to_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_group_hyphen_in_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public enum actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/list-self-hosted-runners-in-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/page`. + public var page: Components.Parameters.page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + per_page: Components.Parameters.per_hyphen_page? = nil, + page: Components.Parameters.page? = nil + ) { + self.per_page = per_page + self.page = page + } + } + public var query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.runner] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - runners: + public init( + total_count: Swift.Double, + runners: [Components.Schemas.runner] + ) { + self.total_count = total_count + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case total_count + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.actions_sol_list_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public enum actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/set-self-hosted-runners-in-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + } + } + public var path: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// List of runner IDs to add to the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json/runners`. + public var runners: [Swift.Int] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - runners: List of runner IDs to add to the runner group. + public init(runners: [Swift.Int]) { + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/content/application\/json`. + case json(Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + body: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_set_hyphen_self_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public enum actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/add-self-hosted-runner-to-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_id`. + public var runner_id: Components.Parameters.runner_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + /// - runner_id: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id, + runner_id: Components.Parameters.runner_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + self.runner_id = runner_id + } + } + public var path: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_add_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_to_hyphen_group_hyphen_for_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public enum actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/remove-self-hosted-runner-from-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_group_id`. + public var runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_id`. + public var runner_id: Components.Parameters.runner_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runner_group_id: Unique identifier of the self-hosted runner group. + /// - runner_id: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.org, + runner_group_id: Components.Parameters.runner_hyphen_group_hyphen_id, + runner_id: Components.Parameters.runner_hyphen_id + ) { + self.org = org + self.runner_group_id = runner_group_id + self.runner_id = runner_id + } + } + public var path: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.actions_sol_remove_hyphen_self_hyphen_hosted_hyphen_runner_hyphen_from_hyphen_group_hyphen_for_hyphen_org.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } /// List self-hosted runners for an organization /// /// Lists all self-hosted runners configured in an organization. diff --git a/Sources/activity/Client.swift b/Sources/activity/Client.swift index b052b53df12..7cbcb22f697 100644 --- a/Sources/activity/Client.swift +++ b/Sources/activity/Client.swift @@ -2616,7 +2616,7 @@ public struct Client: APIProtocol { } /// 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. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index e764875c002..2b16781dd87 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -219,7 +219,7 @@ public protocol APIProtocol: Sendable { func activity_sol_list_hyphen_watched_hyphen_repos_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.activity_sol_list_hyphen_watched_hyphen_repos_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.activity_sol_list_hyphen_watched_hyphen_repos_hyphen_for_hyphen_authenticated_hyphen_user.Output /// 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. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. @@ -694,7 +694,7 @@ extension APIProtocol { } /// 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. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. @@ -889,6 +889,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -913,6 +915,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -934,7 +937,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -957,6 +961,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -980,6 +985,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1065,6 +1071,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1089,6 +1097,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1110,7 +1119,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1133,6 +1143,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1156,6 +1167,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1580,7 +1592,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -1768,7 +1780,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -3547,6 +3559,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -3555,18 +3589,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -3574,6 +3611,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -9727,7 +9765,7 @@ public enum Operations { } /// 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. + /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read). /// /// > [!NOTE] /// > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. diff --git a/Sources/apps/Client.swift b/Sources/apps/Client.swift index dfae4f8f131..e464bebe456 100644 --- a/Sources/apps/Client.swift +++ b/Sources/apps/Client.swift @@ -383,13 +383,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1087,8 +1080,6 @@ public struct Client: APIProtocol { /// /// Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted. /// - /// When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported. - /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// /// - Remark: HTTP `POST /app/installations/{installation_id}/access_tokens`. diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index cf1b9cc4451..e91faf1ea61 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -114,8 +114,6 @@ public protocol APIProtocol: Sendable { /// /// Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted. /// - /// When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported. - /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// /// - Remark: HTTP `POST /app/installations/{installation_id}/access_tokens`. @@ -521,8 +519,6 @@ extension APIProtocol { /// /// Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted. /// - /// When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported. - /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// /// - Remark: HTTP `POST /app/installations/{installation_id}/access_tokens`. @@ -1027,6 +1023,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -1051,6 +1049,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1072,7 +1071,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1095,6 +1095,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1118,6 +1119,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1234,6 +1236,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1258,6 +1262,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1279,7 +1284,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1302,6 +1308,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1325,6 +1332,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. @@ -2654,13 +2662,13 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organization_custom_properties: Components.Schemas.app_hyphen_permissions.organization_custom_propertiesPayload? - /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. @frozen public enum organization_copilot_seat_managementPayload: String, Codable, Hashable, Sendable { case write = "write" } - /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. public var organization_copilot_seat_management: Components.Schemas.app_hyphen_permissions.organization_copilot_seat_managementPayload? @@ -2728,7 +2736,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_plan`. public var organization_plan: Components.Schemas.app_hyphen_permissions.organization_planPayload? - /// The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_projects`. @frozen public enum organization_projectsPayload: String, Codable, Hashable, Sendable { @@ -2736,7 +2744,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_projects`. public var organization_projects: Components.Schemas.app_hyphen_permissions.organization_projectsPayload? @@ -2902,14 +2910,14 @@ public enum Components { /// - organization_custom_roles: The level of permission to grant the access token for custom repository roles management. /// - organization_custom_org_roles: The level of permission to grant the access token for custom organization roles management. /// - organization_custom_properties: The level of permission to grant the access token for custom property management. - /// - organization_copilot_seat_management: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// - organization_copilot_seat_management: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organization_announcement_banners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organization_events: The level of permission to grant the access token to view events triggered by an activity in an organization. /// - organization_hooks: The level of permission to grant the access token to manage the post-receive hooks for an organization. /// - organization_personal_access_tokens: The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. /// - organization_personal_access_token_requests: The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. /// - organization_plan: The level of permission to grant the access token for viewing an organization's plan. - /// - organization_projects: The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// - organization_projects: The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// - organization_packages: The level of permission to grant the access token for organization packages published to GitHub Packages. /// - organization_secrets: The level of permission to grant the access token to manage organization secrets. /// - organization_self_hosted_runners: The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. @@ -3560,7 +3568,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -3748,7 +3756,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -5716,22 +5724,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.apps_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query @@ -6894,8 +6897,6 @@ public enum Operations { /// /// Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted. /// - /// When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported. - /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// /// - Remark: HTTP `POST /app/installations/{installation_id}/access_tokens`. diff --git a/Sources/billing/Client.swift b/Sources/billing/Client.swift index 73aa1fdf2c1..ca1a2b7197c 100644 --- a/Sources/billing/Client.swift +++ b/Sources/billing/Client.swift @@ -38,6 +38,197 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public func billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org(_ input: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input) async throws -> Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/usage", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hour", + value: input.query.hour + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.billing_usage_report_org.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.billing_hyphen_usage_hyphen_report.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.bad_request.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.scim_hyphen_error.self, + from: responseBody, + transforming: { value in + .application_scim_plus_json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get GitHub Actions billing for an organization /// /// Gets the summary of the free and paid GitHub Actions minutes used. diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 9d26a792521..6ad744b92e7 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -11,6 +11,15 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + func billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org(_ input: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input) async throws -> Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Output /// Get GitHub Actions billing for an organization /// /// Gets the summary of the free and paid GitHub Actions minutes used. @@ -81,6 +90,25 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public func billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org( + path: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Path, + query: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Query = .init(), + headers: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Output { + try await billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org(Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } /// Get GitHub Actions billing for an organization /// /// Gets the summary of the free and paid GitHub Actions minutes used. @@ -211,6 +239,208 @@ public enum Servers { public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. public enum Schemas { + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct basic_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentation_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `basic_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentation_url: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case url + case status + } + } + /// Scim Error + /// + /// - Remark: Generated from `#/components/schemas/scim-error`. + public struct scim_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/scim-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/documentation_url`. + public var documentation_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/detail`. + public var detail: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/status`. + public var status: Swift.Int? + /// - Remark: Generated from `#/components/schemas/scim-error/scimType`. + public var scimType: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/schemas`. + public var schemas: [Swift.String]? + /// Creates a new `scim_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - detail: + /// - status: + /// - scimType: + /// - schemas: + public init( + message: Swift.String? = nil, + documentation_url: Swift.String? = nil, + detail: Swift.String? = nil, + status: Swift.Int? = nil, + scimType: Swift.String? = nil, + schemas: [Swift.String]? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.detail = detail + self.status = status + self.scimType = scimType + self.schemas = schemas + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case detail + case status + case scimType + case schemas + } + } + /// - Remark: Generated from `#/components/schemas/billing-usage-report`. + public struct billing_hyphen_usage_hyphen_report: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload`. + public struct usageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Date of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/date`. + public var date: Swift.String + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/sku`. + public var sku: Swift.String + /// Quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/quantity`. + public var quantity: Swift.Int + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Name of the organization. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/organizationName`. + public var organizationName: Swift.String + /// Name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItemsPayload/repositoryName`. + public var repositoryName: Swift.String? + /// Creates a new `usageItemsPayloadPayload`. + /// + /// - Parameters: + /// - date: Date of the usage line item. + /// - product: Product name. + /// - sku: SKU name. + /// - quantity: Quantity of the usage line item. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netAmount: Net amount of the usage line item. + /// - organizationName: Name of the organization. + /// - repositoryName: Name of the repository. + public init( + date: Swift.String, + product: Swift.String, + sku: Swift.String, + quantity: Swift.Int, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossAmount: Swift.Double, + discountAmount: Swift.Double, + netAmount: Swift.Double, + organizationName: Swift.String, + repositoryName: Swift.String? = nil + ) { + self.date = date + self.product = product + self.sku = sku + self.quantity = quantity + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossAmount = grossAmount + self.discountAmount = discountAmount + self.netAmount = netAmount + self.organizationName = organizationName + self.repositoryName = repositoryName + } + public enum CodingKeys: String, CodingKey { + case date + case product + case sku + case quantity + case unitType + case pricePerUnit + case grossAmount + case discountAmount + case netAmount + case organizationName + case repositoryName + } + } + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItems`. + public typealias usageItemsPayload = [Components.Schemas.billing_hyphen_usage_hyphen_report.usageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-usage-report/usageItems`. + public var usageItems: Components.Schemas.billing_hyphen_usage_hyphen_report.usageItemsPayload? + /// Creates a new `billing_hyphen_usage_hyphen_report`. + /// + /// - Parameters: + /// - usageItems: + public init(usageItems: Components.Schemas.billing_hyphen_usage_hyphen_report.usageItemsPayload? = nil) { + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case usageItems + } + } /// - Remark: Generated from `#/components/schemas/actions-billing-usage`. public struct actions_hyphen_billing_hyphen_usage: Codable, Hashable, Sendable { /// The sum of the free and paid GitHub Actions minutes used. @@ -460,6 +690,22 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias org = Swift.String + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2024`. Default value is the current year. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. + public typealias billing_hyphen_usage_hyphen_report_hyphen_year = Swift.Int + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. + public typealias billing_hyphen_usage_hyphen_report_hyphen_month = Swift.Int + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. + public typealias billing_hyphen_usage_hyphen_report_hyphen_day = Swift.Int + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. + public typealias billing_hyphen_usage_hyphen_report_hyphen_hour = Swift.Int /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. @@ -468,13 +714,452 @@ public enum Components { /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} + public enum Responses { + public struct bad_request: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case application_scim_plus_json(Components.Schemas.scim_hyphen_error) + /// The associated value of the enum case if `self` is `.application_scim_plus_json`. + /// + /// - Throws: An error if `self` is not `.application_scim_plus_json`. + /// - SeeAlso: `.application_scim_plus_json`. + public var application_scim_plus_json: Components.Schemas.scim_hyphen_error { + get throws { + switch self { + case let .application_scim_plus_json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.bad_request.Body + /// Creates a new `bad_request`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.bad_request.Body) { + self.body = body + } + } + public struct forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body + } + } + public struct internal_error: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.internal_error.Body) { + self.body = body + } + } + public struct service_unavailable: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`. + public var documentation_url: Swift.String? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - documentation_url: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + documentation_url: Swift.String? = nil + ) { + self.code = code + self.message = message + self.documentation_url = documentation_url + } + public enum CodingKeys: String, CodingKey { + case code + case message + case documentation_url + } + } + /// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`. + case json(Components.Responses.service_unavailable.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Responses.service_unavailable.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.service_unavailable.Body + /// Creates a new `service_unavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.service_unavailable.Body) { + self.body = body + } + } + public struct billing_usage_report_org: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content/application\/json`. + case json(Components.Schemas.billing_hyphen_usage_hyphen_report) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.billing_hyphen_usage_hyphen_report { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.billing_usage_report_org.Body + /// Creates a new `billing_usage_report_org`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.billing_usage_report_org.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public enum billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org { + public static let id: Swift.String = "billing/get-github-billing-usage-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2024`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/year`. + public var year: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_year? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/month`. + public var month: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_month? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/day`. + public var day: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_day? + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/hour`. + public var hour: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_hour? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2024`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. + /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. + public init( + year: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_year? = nil, + month: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_month? = nil, + day: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_day? = nil, + hour: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_hour? = nil + ) { + self.year = year + self.month = month + self.day = day + self.hour = hour + } + } + public var query: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Path, + query: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Query = .init(), + headers: Operations.billing_sol_get_hyphen_github_hyphen_billing_hyphen_usage_hyphen_report_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Billing usage report response for an organization + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.billing_usage_report_org) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.billing_usage_report_org { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.bad_request) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case application_scim_plus_json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .application_scim_plus_json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .application_scim_plus_json: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .application_scim_plus_json + ] + } + } + } /// Get GitHub Actions billing for an organization /// /// Gets the summary of the free and paid GitHub Actions minutes used. diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index ab0d2c93dc3..5a86e0e5cf2 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -463,6 +463,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -487,6 +489,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -508,7 +511,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -531,6 +535,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -554,6 +559,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -639,6 +645,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -663,6 +671,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -684,7 +693,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -707,6 +717,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -730,6 +741,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Code Of Conduct @@ -1124,6 +1136,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -1132,18 +1166,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -1151,6 +1188,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -2445,7 +2483,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/check-suite`. public struct check_hyphen_suite: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/check-suite/id`. - public var id: Swift.Int + public var id: Swift.Int64 /// - Remark: Generated from `#/components/schemas/check-suite/node_id`. public var node_id: Swift.String /// - Remark: Generated from `#/components/schemas/check-suite/head_branch`. @@ -2533,7 +2571,7 @@ public enum Components { /// - rerequestable: /// - runs_rerequestable: public init( - id: Swift.Int, + id: Swift.Int64, node_id: Swift.String, head_branch: Swift.String? = nil, head_sha: Swift.String, @@ -2802,116 +2840,26 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json`. @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1/status`. - public var status: OpenAPIRuntime.OpenAPIValueContainer - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - status: - /// - additionalProperties: A container of undocumented properties. - public init( - status: OpenAPIRuntime.OpenAPIValueContainer, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.status = status - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case status - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - status = try container.decode( - OpenAPIRuntime.OpenAPIValueContainer.self, - forKey: .status - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "status" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - status, - forKey: .status - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`. - case case1(Operations.checks_sol_create.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2/status`. - public var status: OpenAPIRuntime.OpenAPIValueContainer? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - status: - /// - additionalProperties: A container of undocumented properties. - public init( - status: OpenAPIRuntime.OpenAPIValueContainer? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.status = status - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case status - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - status = try container.decodeIfPresent( - OpenAPIRuntime.OpenAPIValueContainer.self, - forKey: .status - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "status" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - status, - forKey: .status - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } + public enum CodingKeys: String, CodingKey { + case status } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`. - case case2(Operations.checks_sol_create.Input.Body.jsonPayload.Case2Payload) public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: .status ) + switch discriminator { + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys.status, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } } public func encode(to encoder: any Encoder) throws { switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try value.encode(to: encoder) } } } diff --git a/Sources/classroom/Client.swift b/Sources/classroom/Client.swift index d1897771cd4..783acbf5322 100644 --- a/Sources/classroom/Client.swift +++ b/Sources/classroom/Client.swift @@ -129,11 +129,11 @@ public struct Client: APIProtocol { /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. - /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`. - public func classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output { + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + public func classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output { try await client.send( input: input, - forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.id, + forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.id, serializer: { input in let path = try converter.renderedPath( template: "/assignments/{}/accepted_assignments", @@ -170,7 +170,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body + let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ diff --git a/Sources/classroom/Types.swift b/Sources/classroom/Types.swift index 64f7c02223f..27a08163617 100644 --- a/Sources/classroom/Types.swift +++ b/Sources/classroom/Types.swift @@ -23,8 +23,8 @@ public protocol APIProtocol: Sendable { /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. - /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`. - func classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + func classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output /// Get assignment grades /// /// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. @@ -77,13 +77,13 @@ extension APIProtocol { /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. - /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`. - public func classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment( - path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path, - query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query = .init(), - headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers = .init() - ) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output { - try await classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment(Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input( + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + public func classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment( + path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path, + query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query = .init(), + headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers = .init() + ) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output { + try await classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment(Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input( path: path, query: query, headers: headers @@ -1168,9 +1168,9 @@ public enum Operations { /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. - /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`. - public enum classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment { - public static let id: Swift.String = "classroom/list-accepted-assigments-for-an-assignment" + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + public enum classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment { + public static let id: Swift.String = "classroom/list-accepted-assignments-for-an-assignment" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/assignments/{assignment_id}/accepted_assignments/GET/path`. public struct Path: Sendable, Hashable { @@ -1186,7 +1186,7 @@ public enum Operations { self.assignment_id = assignment_id } } - public var path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path + public var path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path /// - Remark: Generated from `#/paths/assignments/{assignment_id}/accepted_assignments/GET/query`. public struct Query: Sendable, Hashable { /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." @@ -1210,19 +1210,19 @@ public enum Operations { self.per_page = per_page } } - public var query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query + public var query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query /// - Remark: Generated from `#/paths/assignments/{assignment_id}/accepted_assignments/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers + public var headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -1230,9 +1230,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path, - query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query = .init(), - headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers = .init() + path: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Path, + query: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Query = .init(), + headers: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input.Headers = .init() ) { self.path = path self.query = query @@ -1259,26 +1259,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body + public var body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body) { + public init(body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)/responses/200`. + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok) + case ok(Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok { + public var ok: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok { get throws { switch self { case let .ok(response): diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 4f1ba064bfe..694f4025f5c 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -292,6 +292,13 @@ public struct Client: APIProtocol { name: "ref", value: input.query.ref ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "pr", + value: input.query.pr + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -299,6 +306,20 @@ public struct Client: APIProtocol { name: "direction", value: input.query.direction ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -755,6 +776,13 @@ public struct Client: APIProtocol { name: "ref", value: input.query.ref ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "pr", + value: input.query.pr + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -877,7 +905,7 @@ public struct Client: APIProtocol { /// and `0` is returned in this field. /// /// > [!WARNING] - /// > **Deprecation notice:** 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. + /// > **Closing down notice:** The `tool_name` field is closing down 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. /// /// 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. /// @@ -928,6 +956,13 @@ public struct Client: APIProtocol { name: "per_page", value: input.query.per_page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "pr", + value: input.query.pr + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1458,7 +1493,7 @@ public struct Client: APIProtocol { /// /// Lists the CodeQL databases that are available in a repository. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -1597,7 +1632,7 @@ public struct Client: APIProtocol { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -1729,6 +1764,120 @@ public struct Client: APIProtocol { } ) } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// 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. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-scanning/codeql/databases/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.language + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.code_scanning_forbidden_write.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 098effdac07..ee84b6fa5d8 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -75,7 +75,7 @@ public protocol APIProtocol: Sendable { /// and `0` is returned in this field. /// /// > [!WARNING] - /// > **Deprecation notice:** 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. + /// > **Closing down notice:** The `tool_name` field is closing down 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. /// /// 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. /// @@ -179,7 +179,7 @@ public protocol APIProtocol: Sendable { /// /// Lists the CodeQL databases that are available in a repository. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -194,11 +194,20 @@ public protocol APIProtocol: Sendable { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. func code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database.Output + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// 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. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. @@ -413,7 +422,7 @@ extension APIProtocol { /// and `0` is returned in this field. /// /// > [!WARNING] - /// > **Deprecation notice:** 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. + /// > **Closing down notice:** The `tool_name` field is closing down 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. /// /// 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. /// @@ -545,7 +554,7 @@ extension APIProtocol { /// /// Lists the CodeQL databases that are available in a repository. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -568,7 +577,7 @@ extension APIProtocol { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -581,6 +590,23 @@ extension APIProtocol { headers: headers )) } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// 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. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database( + path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path, + headers: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output { + try await code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input( + path: path, + headers: headers + )) + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. @@ -803,6 +829,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -827,6 +855,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -848,7 +877,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -871,6 +901,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -894,6 +925,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -979,6 +1011,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1003,6 +1037,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1024,7 +1059,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1047,6 +1083,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1070,6 +1107,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Scim Error @@ -1631,10 +1669,22 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule-summary/description`. public var description: Swift.String? + /// A description of the rule used to detect the alert. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule-summary/full_description`. + public var full_description: Swift.String? /// A set of tags applicable for the rule. /// /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule-summary/tags`. public var tags: [Swift.String]? + /// Detailed documentation for the rule as GitHub Flavored Markdown. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule-summary/help`. + public var help: Swift.String? + /// A link to the documentation for the rule used to detect the alert. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule-summary/help_uri`. + public var help_uri: Swift.String? /// Creates a new `code_hyphen_scanning_hyphen_alert_hyphen_rule_hyphen_summary`. /// /// - Parameters: @@ -1643,21 +1693,30 @@ public enum Components { /// - severity: The severity of the alert. /// - security_severity_level: The security severity of the alert. /// - description: A short description of the rule used to detect the alert. + /// - full_description: A description of the rule used to detect the alert. /// - tags: A set of tags applicable for the rule. + /// - help: Detailed documentation for the rule as GitHub Flavored Markdown. + /// - help_uri: A link to the documentation for the rule used to detect the alert. public init( id: Swift.String? = nil, name: Swift.String? = nil, severity: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_rule_hyphen_summary.severityPayload? = nil, security_severity_level: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_rule_hyphen_summary.security_severity_levelPayload? = nil, description: Swift.String? = nil, - tags: [Swift.String]? = nil + full_description: Swift.String? = nil, + tags: [Swift.String]? = nil, + help: Swift.String? = nil, + help_uri: Swift.String? = nil ) { self.id = id self.name = name self.severity = severity self.security_severity_level = security_severity_level self.description = description + self.full_description = full_description self.tags = tags + self.help = help + self.help_uri = help_uri } public enum CodingKeys: String, CodingKey { case id @@ -1665,7 +1724,10 @@ public enum Components { case severity case security_severity_level case description + case full_description case tags + case help + case help_uri } } /// The version of the tool used to generate the code scanning analysis. @@ -1874,7 +1936,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/instances_url`. public var instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/state`. - public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state + public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/fixed_at`. public var fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/dismissed_by`. @@ -1919,7 +1981,7 @@ public enum Components { url: Components.Schemas.alert_hyphen_url, html_url: Components.Schemas.alert_hyphen_html_hyphen_url, instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url, - state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state, + state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? = nil, fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? = nil, dismissed_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, dismissed_at: Components.Schemas.alert_hyphen_dismissed_hyphen_at? = nil, @@ -1981,7 +2043,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/instances_url`. public var instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/state`. - public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state + public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/fixed_at`. public var fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/dismissed_by`. @@ -2023,7 +2085,7 @@ public enum Components { url: Components.Schemas.alert_hyphen_url, html_url: Components.Schemas.alert_hyphen_html_hyphen_url, instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url, - state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state, + state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? = nil, fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? = nil, dismissed_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, dismissed_at: Components.Schemas.alert_hyphen_dismissed_hyphen_at? = nil, @@ -2107,7 +2169,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule/description`. public var description: Swift.String? - /// description of the rule used to detect the alert. + /// A description of the rule used to detect the alert. /// /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule/full_description`. public var full_description: Swift.String? @@ -2131,7 +2193,7 @@ public enum Components { /// - severity: The severity of the alert. /// - security_severity_level: The security severity of the alert. /// - description: A short description of the rule used to detect the alert. - /// - full_description: description of the rule used to detect the alert. + /// - full_description: A description of the rule used to detect the alert. /// - tags: A set of tags applicable for the rule. /// - help: Detailed documentation for the rule as GitHub Flavored Markdown. /// - help_uri: A link to the documentation for the rule used to detect the alert. @@ -2183,7 +2245,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/code-scanning-alert/instances_url`. public var instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url /// - Remark: Generated from `#/components/schemas/code-scanning-alert/state`. - public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state + public var state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? /// - Remark: Generated from `#/components/schemas/code-scanning-alert/fixed_at`. public var fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? /// - Remark: Generated from `#/components/schemas/code-scanning-alert/dismissed_by`. @@ -2225,7 +2287,7 @@ public enum Components { url: Components.Schemas.alert_hyphen_url, html_url: Components.Schemas.alert_hyphen_html_hyphen_url, instances_url: Components.Schemas.alert_hyphen_instances_hyphen_url, - state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state, + state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state? = nil, fixed_at: Components.Schemas.alert_hyphen_fixed_hyphen_at? = nil, dismissed_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, dismissed_at: Components.Schemas.alert_hyphen_dismissed_hyphen_at? = nil, @@ -3272,6 +3334,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/git-ref`. public typealias git_hyphen_ref = Components.Schemas.code_hyphen_scanning_hyphen_ref + /// The number of the pull request for the results you want to list. + /// + /// - Remark: Generated from `#/components/parameters/pr-alias`. + public typealias pr_hyphen_alias = Swift.Int /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. /// /// - Remark: Generated from `#/components/parameters/alert-number`. @@ -3875,6 +3941,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/ref`. public var ref: Components.Parameters.git_hyphen_ref? + /// The number of the pull request for the results you want to list. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/pr`. + public var pr: Components.Parameters.pr_hyphen_alias? /// - Remark: Generated from `#/components/parameters/direction`. @frozen public enum direction: String, Codable, Hashable, Sendable { case asc = "asc" @@ -3884,6 +3954,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/direction`. public var direction: Components.Parameters.direction? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/before`. + public var before: Components.Parameters.pagination_hyphen_before? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/GET/query/sort`. @frozen public enum sortPayload: String, Codable, Hashable, Sendable { case created = "created" @@ -3909,7 +3987,10 @@ public enum Operations { /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - ref: The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + /// - pr: The number of the pull request for the results you want to list. /// - direction: The direction to sort the results by. + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - sort: The property by which to sort the results. /// - state: If specified, only code scanning alerts with this state will be returned. /// - severity: If specified, only code scanning alerts with this severity will be returned. @@ -3919,7 +4000,10 @@ public enum Operations { page: Components.Parameters.page? = nil, per_page: Components.Parameters.per_hyphen_page? = nil, ref: Components.Parameters.git_hyphen_ref? = nil, + pr: Components.Parameters.pr_hyphen_alias? = nil, direction: Components.Parameters.direction? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil, sort: Operations.code_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_repo.Input.Query.sortPayload? = nil, state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_state_hyphen_query? = nil, severity: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_severity? = nil @@ -3929,7 +4013,10 @@ public enum Operations { self.page = page self.per_page = per_page self.ref = ref + self.pr = pr self.direction = direction + self.before = before + self.after = after self.sort = sort self.state = state self.severity = severity @@ -4693,20 +4780,27 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances/GET/query/ref`. public var ref: Components.Parameters.git_hyphen_ref? + /// The number of the pull request for the results you want to list. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances/GET/query/pr`. + public var pr: Components.Parameters.pr_hyphen_alias? /// Creates a new `Query`. /// /// - Parameters: /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - ref: The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + /// - pr: The number of the pull request for the results you want to list. public init( page: Components.Parameters.page? = nil, per_page: Components.Parameters.per_hyphen_page? = nil, - ref: Components.Parameters.git_hyphen_ref? = nil + ref: Components.Parameters.git_hyphen_ref? = nil, + pr: Components.Parameters.pr_hyphen_alias? = nil ) { self.page = page self.per_page = per_page self.ref = ref + self.pr = pr } } public var query: Operations.code_hyphen_scanning_sol_list_hyphen_alert_hyphen_instances.Input.Query @@ -4904,7 +4998,7 @@ public enum Operations { /// and `0` is returned in this field. /// /// > [!WARNING] - /// > **Deprecation notice:** 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. + /// > **Closing down notice:** The `tool_name` field is closing down 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. /// /// 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. /// @@ -4955,6 +5049,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/GET/query/per_page`. public var per_page: Components.Parameters.per_hyphen_page? + /// The number of the pull request for the results you want to list. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/GET/query/pr`. + public var pr: Components.Parameters.pr_hyphen_alias? /// The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/analyses/GET/query/ref`. @@ -4987,6 +5085,7 @@ public enum Operations { /// - tool_guid: The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - pr: The number of the pull request for the results you want to list. /// - ref: The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. /// - sarif_id: Filter analyses belonging to the same SARIF upload. /// - direction: The direction to sort the results by. @@ -4996,6 +5095,7 @@ public enum Operations { tool_guid: Components.Parameters.tool_hyphen_guid? = nil, page: Components.Parameters.page? = nil, per_page: Components.Parameters.per_hyphen_page? = nil, + pr: Components.Parameters.pr_hyphen_alias? = nil, ref: Components.Schemas.code_hyphen_scanning_hyphen_ref? = nil, sarif_id: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_sarif_hyphen_id? = nil, direction: Components.Parameters.direction? = nil, @@ -5005,6 +5105,7 @@ public enum Operations { self.tool_guid = tool_guid self.page = page self.per_page = per_page + self.pr = pr self.ref = ref self.sarif_id = sarif_id self.direction = direction @@ -5786,7 +5887,7 @@ public enum Operations { /// /// Lists the CodeQL databases that are available in a repository. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -6004,7 +6105,7 @@ public enum Operations { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// 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. + /// 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. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -6242,6 +6343,201 @@ public enum Operations { } } } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// 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. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public enum code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database { + public static let id: Swift.String = "code-scanning/delete-codeql-database" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/path/owner`. + public var owner: Components.Parameters.owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/path/repo`. + public var repo: Components.Parameters.repo + /// The language of the CodeQL database. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/path/language`. + public var language: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - language: The language of the CodeQL database. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + language: Swift.String + ) { + self.owner = owner + self.repo = repo + self.language = language + } + } + public var path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path, + headers: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.code_scanning_forbidden_write) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.code_scanning_forbidden_write { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index 76d78c0936f..488a692044a 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -435,6 +435,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -459,6 +461,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -480,7 +483,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -503,6 +507,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -526,6 +531,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1011,6 +1017,7 @@ public enum Components { @frozen public enum target_typePayload: String, Codable, Hashable, Sendable { case global = "global" case organization = "organization" + case enterprise = "enterprise" } /// The type of the code security configuration. /// @@ -1138,6 +1145,79 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_push_protection`. public var secret_scanning_push_protection: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_push_protectionPayload? + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass`. + @frozen public enum secret_scanning_delegated_bypassPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass`. + public var secret_scanning_delegated_bypass: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypassPayload? + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options`. + public struct secret_scanning_delegated_bypass_optionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewersPayload`. + public struct reviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_id`. + public var reviewer_id: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + @frozen public enum reviewer_typePayload: String, Codable, Hashable, Sendable { + case TEAM = "TEAM" + case ROLE = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + public var reviewer_type: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + /// Creates a new `reviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewer_id: The ID of the team or role selected as a bypass reviewer + /// - reviewer_type: The type of the bypass reviewer + public init( + reviewer_id: Swift.Int, + reviewer_type: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + ) { + self.reviewer_id = reviewer_id + self.reviewer_type = reviewer_type + } + public enum CodingKeys: String, CodingKey { + case reviewer_id + case reviewer_type + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewers`. + public typealias reviewersPayload = [Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? + /// Creates a new `secret_scanning_delegated_bypass_optionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_bypass_options`. + public var secret_scanning_delegated_bypass_options: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload? /// The enablement status of secret scanning validity checks /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_validity_checks`. @@ -1150,6 +1230,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_validity_checks`. public var secret_scanning_validity_checks: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_validity_checksPayload? + /// The enablement status of secret scanning non-provider patterns + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_non_provider_patterns`. + @frozen public enum secret_scanning_non_provider_patternsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning non-provider patterns + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_non_provider_patterns`. + public var secret_scanning_non_provider_patterns: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_non_provider_patternsPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. @@ -1201,7 +1293,10 @@ public enum Components { /// - code_scanning_default_setup: The enablement status of code scanning default setup /// - secret_scanning: The enablement status of secret scanning /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - secret_scanning_delegated_bypass: The enablement status of secret scanning delegated bypass + /// - secret_scanning_delegated_bypass_options: Feature options for secret scanning delegated bypass /// - secret_scanning_validity_checks: The enablement status of secret scanning validity checks + /// - secret_scanning_non_provider_patterns: The enablement status of secret scanning non-provider patterns /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration /// - url: The URL of the configuration @@ -1222,7 +1317,10 @@ public enum Components { code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? = nil, secret_scanning: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_push_protectionPayload? = nil, + secret_scanning_delegated_bypass: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypassPayload? = nil, + secret_scanning_delegated_bypass_options: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_bypass_optionsPayload? = nil, secret_scanning_validity_checks: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_validity_checksPayload? = nil, + secret_scanning_non_provider_patterns: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_non_provider_patternsPayload? = nil, private_vulnerability_reporting: Components.Schemas.code_hyphen_security_hyphen_configuration.private_vulnerability_reportingPayload? = nil, enforcement: Components.Schemas.code_hyphen_security_hyphen_configuration.enforcementPayload? = nil, url: Swift.String? = nil, @@ -1243,7 +1341,10 @@ public enum Components { self.code_scanning_default_setup = code_scanning_default_setup self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_delegated_bypass = secret_scanning_delegated_bypass + self.secret_scanning_delegated_bypass_options = secret_scanning_delegated_bypass_options self.secret_scanning_validity_checks = secret_scanning_validity_checks + self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns self.private_vulnerability_reporting = private_vulnerability_reporting self.enforcement = enforcement self.url = url @@ -1265,7 +1366,10 @@ public enum Components { case code_scanning_default_setup case secret_scanning case secret_scanning_push_protection + case secret_scanning_delegated_bypass + case secret_scanning_delegated_bypass_options case secret_scanning_validity_checks + case secret_scanning_non_provider_patterns case private_vulnerability_reporting case enforcement case url @@ -1992,6 +2096,79 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_push_protection`. public var secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass`. + @frozen public enum secret_scanning_delegated_bypassPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass`. + public var secret_scanning_delegated_bypass: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload? + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options`. + public struct secret_scanning_delegated_bypass_optionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload`. + public struct reviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_id`. + public var reviewer_id: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + @frozen public enum reviewer_typePayload: String, Codable, Hashable, Sendable { + case TEAM = "TEAM" + case ROLE = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + public var reviewer_type: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + /// Creates a new `reviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewer_id: The ID of the team or role selected as a bypass reviewer + /// - reviewer_type: The type of the bypass reviewer + public init( + reviewer_id: Swift.Int, + reviewer_type: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + ) { + self.reviewer_id = reviewer_id + self.reviewer_type = reviewer_type + } + public enum CodingKeys: String, CodingKey { + case reviewer_id + case reviewer_type + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewers`. + public typealias reviewersPayload = [Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? + /// Creates a new `secret_scanning_delegated_bypass_optionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_bypass_options`. + public var secret_scanning_delegated_bypass_options: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload? /// The enablement status of secret scanning validity checks /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_validity_checks`. @@ -2004,6 +2181,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_validity_checks`. public var secret_scanning_validity_checks: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? + /// The enablement status of secret scanning non provider patterns + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_non_provider_patterns`. + @frozen public enum secret_scanning_non_provider_patternsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning non provider patterns + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_non_provider_patterns`. + public var secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. @@ -2041,7 +2230,10 @@ public enum Operations { /// - code_scanning_default_setup: The enablement status of code scanning default setup /// - secret_scanning: The enablement status of secret scanning /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - secret_scanning_delegated_bypass: The enablement status of secret scanning delegated bypass + /// - secret_scanning_delegated_bypass_options: Feature options for secret scanning delegated bypass /// - secret_scanning_validity_checks: The enablement status of secret scanning validity checks + /// - secret_scanning_non_provider_patterns: The enablement status of secret scanning non provider patterns /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -2056,7 +2248,10 @@ public enum Operations { code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, secret_scanning: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? = nil, secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + secret_scanning_delegated_bypass: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload? = nil, + secret_scanning_delegated_bypass_options: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload? = nil, secret_scanning_validity_checks: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? = nil, + secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? = nil, private_vulnerability_reporting: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil, enforcement: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.enforcementPayload? = nil ) { @@ -2071,7 +2266,10 @@ public enum Operations { self.code_scanning_default_setup = code_scanning_default_setup self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_delegated_bypass = secret_scanning_delegated_bypass + self.secret_scanning_delegated_bypass_options = secret_scanning_delegated_bypass_options self.secret_scanning_validity_checks = secret_scanning_validity_checks + self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns self.private_vulnerability_reporting = private_vulnerability_reporting self.enforcement = enforcement } @@ -2087,7 +2285,10 @@ public enum Operations { case code_scanning_default_setup case secret_scanning case secret_scanning_push_protection + case secret_scanning_delegated_bypass + case secret_scanning_delegated_bypass_options case secret_scanning_validity_checks + case secret_scanning_non_provider_patterns case private_vulnerability_reporting case enforcement } @@ -2137,10 +2338,22 @@ public enum Operations { Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, forKey: .secret_scanning_push_protection ) + secret_scanning_delegated_bypass = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload.self, + forKey: .secret_scanning_delegated_bypass + ) + secret_scanning_delegated_bypass_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.self, + forKey: .secret_scanning_delegated_bypass_options + ) secret_scanning_validity_checks = try container.decodeIfPresent( Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload.self, forKey: .secret_scanning_validity_checks ) + secret_scanning_non_provider_patterns = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, + forKey: .secret_scanning_non_provider_patterns + ) private_vulnerability_reporting = try container.decodeIfPresent( Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, forKey: .private_vulnerability_reporting @@ -2161,7 +2374,10 @@ public enum Operations { "code_scanning_default_setup", "secret_scanning", "secret_scanning_push_protection", + "secret_scanning_delegated_bypass", + "secret_scanning_delegated_bypass_options", "secret_scanning_validity_checks", + "secret_scanning_non_provider_patterns", "private_vulnerability_reporting", "enforcement" ]) @@ -3111,6 +3327,79 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_push_protection`. public var secret_scanning_push_protection: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass`. + @frozen public enum secret_scanning_delegated_bypassPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass`. + public var secret_scanning_delegated_bypass: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload? + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options`. + public struct secret_scanning_delegated_bypass_optionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload`. + public struct reviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_id`. + public var reviewer_id: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + @frozen public enum reviewer_typePayload: String, Codable, Hashable, Sendable { + case TEAM = "TEAM" + case ROLE = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewersPayload/reviewer_type`. + public var reviewer_type: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + /// Creates a new `reviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewer_id: The ID of the team or role selected as a bypass reviewer + /// - reviewer_type: The type of the bypass reviewer + public init( + reviewer_id: Swift.Int, + reviewer_type: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload.reviewer_typePayload + ) { + self.reviewer_id = reviewer_id + self.reviewer_type = reviewer_type + } + public enum CodingKeys: String, CodingKey { + case reviewer_id + case reviewer_type + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewers`. + public typealias reviewersPayload = [Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? + /// Creates a new `secret_scanning_delegated_bypass_optionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.reviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// Feature options for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_bypass_options`. + public var secret_scanning_delegated_bypass_options: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload? /// The enablement status of secret scanning validity checks /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_validity_checks`. @@ -3123,6 +3412,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_validity_checks`. public var secret_scanning_validity_checks: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? + /// The enablement status of secret scanning non-provider patterns + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_non_provider_patterns`. + @frozen public enum secret_scanning_non_provider_patternsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning non-provider patterns + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_non_provider_patterns`. + public var secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. @@ -3160,7 +3461,10 @@ public enum Operations { /// - code_scanning_default_setup: The enablement status of code scanning default setup /// - secret_scanning: The enablement status of secret scanning /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - secret_scanning_delegated_bypass: The enablement status of secret scanning delegated bypass + /// - secret_scanning_delegated_bypass_options: Feature options for secret scanning delegated bypass /// - secret_scanning_validity_checks: The enablement status of secret scanning validity checks + /// - secret_scanning_non_provider_patterns: The enablement status of secret scanning non-provider patterns /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -3175,7 +3479,10 @@ public enum Operations { code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, secret_scanning: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? = nil, secret_scanning_push_protection: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + secret_scanning_delegated_bypass: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload? = nil, + secret_scanning_delegated_bypass_options: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload? = nil, secret_scanning_validity_checks: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? = nil, + secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? = nil, private_vulnerability_reporting: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil, enforcement: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.enforcementPayload? = nil ) { @@ -3190,7 +3497,10 @@ public enum Operations { self.code_scanning_default_setup = code_scanning_default_setup self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_delegated_bypass = secret_scanning_delegated_bypass + self.secret_scanning_delegated_bypass_options = secret_scanning_delegated_bypass_options self.secret_scanning_validity_checks = secret_scanning_validity_checks + self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns self.private_vulnerability_reporting = private_vulnerability_reporting self.enforcement = enforcement } @@ -3206,7 +3516,10 @@ public enum Operations { case code_scanning_default_setup case secret_scanning case secret_scanning_push_protection + case secret_scanning_delegated_bypass + case secret_scanning_delegated_bypass_options case secret_scanning_validity_checks + case secret_scanning_non_provider_patterns case private_vulnerability_reporting case enforcement } @@ -3256,10 +3569,22 @@ public enum Operations { Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, forKey: .secret_scanning_push_protection ) + secret_scanning_delegated_bypass = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypassPayload.self, + forKey: .secret_scanning_delegated_bypass + ) + secret_scanning_delegated_bypass_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_bypass_optionsPayload.self, + forKey: .secret_scanning_delegated_bypass_options + ) secret_scanning_validity_checks = try container.decodeIfPresent( Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload.self, forKey: .secret_scanning_validity_checks ) + secret_scanning_non_provider_patterns = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, + forKey: .secret_scanning_non_provider_patterns + ) private_vulnerability_reporting = try container.decodeIfPresent( Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, forKey: .private_vulnerability_reporting @@ -3280,7 +3605,10 @@ public enum Operations { "code_scanning_default_setup", "secret_scanning", "secret_scanning_push_protection", + "secret_scanning_delegated_bypass", + "secret_scanning_delegated_bypass_options", "secret_scanning_validity_checks", + "secret_scanning_non_provider_patterns", "private_vulnerability_reporting", "enforcement" ]) @@ -3693,6 +4021,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json/scope`. @frozen public enum scopePayload: String, Codable, Hashable, Sendable { case all = "all" + case all_without_configurations = "all_without_configurations" case _public = "public" case private_or_internal = "private_or_internal" case selected = "selected" diff --git a/Sources/codespaces/Client.swift b/Sources/codespaces/Client.swift index afcb24fb1a8..3857cc6486d 100644 --- a/Sources/codespaces/Client.swift +++ b/Sources/codespaces/Client.swift @@ -3072,8 +3072,6 @@ public struct Client: APIProtocol { /// 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, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/codespaces/secrets/public-key`. diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 1ecce119c17..8c76b52204a 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -238,8 +238,6 @@ public protocol APIProtocol: Sendable { /// 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, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/codespaces/secrets/public-key`. @@ -939,8 +937,6 @@ extension APIProtocol { /// 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, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/codespaces/secrets/public-key`. @@ -1449,6 +1445,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -1473,6 +1471,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1494,7 +1493,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1517,6 +1517,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1540,6 +1541,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1625,6 +1627,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1649,6 +1653,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1670,7 +1675,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1693,6 +1699,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1716,6 +1723,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Scim Error @@ -2189,7 +2197,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -2377,7 +2385,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -2844,6 +2852,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2852,18 +2882,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2871,6 +2904,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -4293,7 +4327,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -4481,7 +4515,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -10562,7 +10596,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/codespaces/POST/requestBody/json/location`. public var location: Swift.String? - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/codespaces/POST/requestBody/json/geo`. @frozen public enum geoPayload: String, Codable, Hashable, Sendable { @@ -10571,7 +10605,7 @@ public enum Operations { case UsEast = "UsEast" case UsWest = "UsWest" } - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/codespaces/POST/requestBody/json/geo`. public var geo: Operations.codespaces_sol_create_hyphen_with_hyphen_repo_hyphen_for_hyphen_authenticated_hyphen_user.Input.Body.jsonPayload.geoPayload? @@ -10612,7 +10646,7 @@ public enum Operations { /// - Parameters: /// - ref: Git ref (typically a branch name) for this codespace /// - location: The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. - /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// - client_ip: IP for location auto-detection when proxying a request /// - machine: Machine type to use for this codespace /// - devcontainer_path: Path to devcontainer.json config to use for this codespace @@ -12384,8 +12418,6 @@ public enum Operations { /// 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, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/codespaces/secrets/public-key`. @@ -13035,7 +13067,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/codespaces/POST/requestBody/json/location`. public var location: Swift.String? - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/codespaces/POST/requestBody/json/geo`. @frozen public enum geoPayload: String, Codable, Hashable, Sendable { @@ -13044,7 +13076,7 @@ public enum Operations { case UsEast = "UsEast" case UsWest = "UsWest" } - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/codespaces/POST/requestBody/json/geo`. public var geo: Operations.codespaces_sol_create_hyphen_with_hyphen_pr_hyphen_for_hyphen_authenticated_hyphen_user.Input.Body.jsonPayload.geoPayload? @@ -13084,7 +13116,7 @@ public enum Operations { /// /// - Parameters: /// - location: The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. - /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// - client_ip: IP for location auto-detection when proxying a request /// - machine: Machine type to use for this codespace /// - devcontainer_path: Path to devcontainer.json config to use for this codespace @@ -13706,7 +13738,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case1/location`. public var location: Swift.String? - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case1/geo`. @frozen public enum geoPayload: String, Codable, Hashable, Sendable { @@ -13715,7 +13747,7 @@ public enum Operations { case UsEast = "UsEast" case UsWest = "UsWest" } - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case1/geo`. public var geo: Operations.codespaces_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input.Body.jsonPayload.Case1Payload.geoPayload? @@ -13757,7 +13789,7 @@ public enum Operations { /// - repository_id: Repository id for this codespace /// - ref: Git ref (typically a branch name) for this codespace /// - location: The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. - /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// - client_ip: IP for location auto-detection when proxying a request /// - machine: Machine type to use for this codespace /// - devcontainer_path: Path to devcontainer.json config to use for this codespace @@ -13849,7 +13881,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case2/location`. public var location: Swift.String? - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case2/geo`. @frozen public enum geoPayload: String, Codable, Hashable, Sendable { @@ -13858,7 +13890,7 @@ public enum Operations { case UsEast = "UsEast" case UsWest = "UsWest" } - /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// /// - Remark: Generated from `#/paths/user/codespaces/POST/requestBody/json/case2/geo`. public var geo: Operations.codespaces_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input.Body.jsonPayload.Case2Payload.geoPayload? @@ -13883,7 +13915,7 @@ public enum Operations { /// - Parameters: /// - pull_request: Pull request number for this codespace /// - location: The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. - /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. + /// - geo: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down. /// - machine: Machine type to use for this codespace /// - devcontainer_path: Path to devcontainer.json config to use for this codespace /// - working_directory: Working directory for this codespace diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 601629eab90..bbde87f6ae3 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -41,13 +41,16 @@ public struct Client: APIProtocol { /// List all Copilot seat assignments for an enterprise /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. /// /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. /// /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. /// @@ -223,32 +226,28 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for enterprise members - /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Get Copilot metrics for an enterprise /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, - /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// - /// Only owners and billing managers can view Copilot usage metrics for the enterprise. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.id, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/enterprises/{}/copilot/usage", + template: "/enterprises/{}/copilot/metrics", parameters: [ input.path.enterprise ] @@ -296,7 +295,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -306,7 +305,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, from: responseBody, transforming: { value in .json(value) @@ -338,9 +337,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.requires_authentication.Body + let body: Components.Responses.forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -359,10 +358,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.forbidden.Body + let body: Components.Responses.not_found.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -381,10 +380,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Components.Responses.usage_metrics_api_disabled.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -403,7 +402,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -416,38 +415,36 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for an enterprise team + /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. - /// See the response schema tab for detailed metrics definitions. + /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, + /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. /// /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// - /// > [!NOTE] - /// > This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. /// - /// Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team. + /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/enterprises/{}/team/{}/copilot/usage", + template: "/enterprises/{}/copilot/usage", parameters: [ - input.path.enterprise, - input.path.team_slug + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -493,7 +490,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -613,30 +610,34 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot seat information and settings for an organization + /// Get Copilot metrics for an enterprise team /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Gets information about an organization's Copilot subscription, including seat breakdown - /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. - public func copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.id, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing", + template: "/enterprises/{}/team/{}/copilot/metrics", parameters: [ - input.path.org + input.path.enterprise, + input.path.team_slug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -644,6 +645,34 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -654,7 +683,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output.Ok.Body + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -664,7 +693,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.copilot_hyphen_organization_hyphen_details.self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, from: responseBody, transforming: { value in .json(value) @@ -696,9 +725,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.requires_authentication.Body + let body: Components.Responses.forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -717,10 +746,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.forbidden.Body + let body: Components.Responses.not_found.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -739,10 +768,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Components.Responses.usage_metrics_api_disabled.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -761,9 +790,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -776,27 +803,38 @@ public struct Client: APIProtocol { } ) } - /// List all Copilot seat assignments for an organization + /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. - /// Only organization owners can view assigned seats. + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. - public func copilot_sol_list_hyphen_copilot_hyphen_seats(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output { + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.id, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/seats", + template: "/enterprises/{}/team/{}/copilot/usage", parameters: [ - input.path.org + input.path.enterprise, + input.path.team_slug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -804,6 +842,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -827,13 +879,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -843,7 +890,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body.jsonPayload.self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, from: responseBody, transforming: { value in .json(value) @@ -852,10 +899,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -956,62 +1000,48 @@ public struct Client: APIProtocol { } ) } - /// Add teams to the Copilot subscription for an organization + /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. - /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// Only organization owners can add Copilot seats for their organization members. + /// > This endpoint is in public preview and is subject to change. /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// Gets information about an organization's Copilot subscription, including seat breakdown + /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. - public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. + public func copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.id, + forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/orgs/{}/copilot/billing", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body + let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1021,7 +1051,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body.jsonPayload.self, + Components.Schemas.copilot_hyphen_organization_hyphen_details.self, from: responseBody, transforming: { value in .json(value) @@ -1030,7 +1060,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1133,60 +1163,67 @@ public struct Client: APIProtocol { } ) } - /// Remove teams from the Copilot subscription for an organization + /// List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. - /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// > This endpoint is in public preview and is subject to change. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. + /// Only organization owners can view assigned seats. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. - public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. + public func copilot_sol_list_hyphen_copilot_hyphen_seats(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.id, + forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/orgs/{}/copilot/billing/seats", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body + let body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1196,7 +1233,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body.jsonPayload.self, + Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1205,7 +1242,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1294,8 +1334,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1308,33 +1346,33 @@ public struct Client: APIProtocol { } ) } - /// Add users to the Copilot subscription for an organization + /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. - public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output { + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. + public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.id, + forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] @@ -1363,7 +1401,7 @@ public struct Client: APIProtocol { switch response.status.code { case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body + let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1373,7 +1411,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body.jsonPayload.self, + Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1485,31 +1523,33 @@ public struct Client: APIProtocol { } ) } - /// Remove users from the Copilot subscription for an organization + /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. - public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. + public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.id, + forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] @@ -1538,7 +1578,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body + let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1548,7 +1588,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body.jsonPayload.self, + Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1660,80 +1700,62 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for organization members + /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. - /// See the response schema tab for detailed metrics definitions. + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, - /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, - /// they must have telemetry enabled in their IDE. + /// Only organization owners can add Copilot seats for their organization members. /// - /// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics. + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. + public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.id, + forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/usage", + template: "/orgs/{}/copilot/billing/selected_users", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "since", - value: input.query.since - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "until", - value: input.query.until - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.per_page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output.Ok.Body + let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1743,7 +1765,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, + Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1752,7 +1774,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1841,6 +1863,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1853,47 +1877,62 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot seat assignment details for a user + /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. /// - /// Only organization owners can view Copilot seat assignment details for members of their organization. + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// - /// - Remark: HTTP `GET /orgs/{org}/members/{username}/copilot`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/copilot/get(copilot/get-copilot-seat-details-for-user)`. - public func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output { + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response will contain the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. + public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.id, + forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/members/{}/copilot", + template: "/orgs/{}/copilot/billing/selected_users", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output.Ok.Body + let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1903,7 +1942,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.copilot_hyphen_seat_hyphen_details.self, + Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2015,10 +2054,753 @@ public struct Client: APIProtocol { } ) } + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/metrics", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.usage_metrics_api_disabled.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a summary of Copilot usage for organization members + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/usage", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.requires_authentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot seat assignment details for a user + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. + /// + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// + /// Only organization owners can view Copilot seat assignment details for members of their organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/members/{username}/copilot`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/copilot/get(copilot/get-copilot-seat-details-for-user)`. + public func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/members/{}/copilot", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.copilot_hyphen_seat_hyphen_details.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.requires_authentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot metrics for a team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/team/{}/copilot/metrics", + parameters: [ + input.path.org, + input.path.team_slug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.usage_metrics_api_disabled.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 1b9fd1199b9..772b9ff8fea 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -14,13 +14,16 @@ public protocol APIProtocol: Sendable { /// List all Copilot seat assignments for an enterprise /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. /// /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. /// /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. /// @@ -29,10 +32,26 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output + /// Get Copilot metrics for an enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, @@ -42,6 +61,8 @@ public protocol APIProtocol: Sendable { /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. + /// /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. @@ -49,10 +70,29 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output + /// Get Copilot metrics for an enterprise team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -75,11 +115,11 @@ public protocol APIProtocol: Sendable { /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Gets information about an organization's Copilot subscription, including seat breakdown /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// @@ -91,11 +131,14 @@ public protocol APIProtocol: Sendable { /// List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. /// Only organization owners can view assigned seats. /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. @@ -104,16 +147,16 @@ public protocol APIProtocol: Sendable { /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -125,17 +168,19 @@ public protocol APIProtocol: Sendable { /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. @@ -144,16 +189,16 @@ public protocol APIProtocol: Sendable { /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -165,26 +210,47 @@ public protocol APIProtocol: Sendable { /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output /// Get a summary of Copilot usage for organization members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -204,9 +270,12 @@ public protocol APIProtocol: Sendable { /// Get Copilot seat assignment details for a user /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. + /// + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -215,10 +284,29 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/members/{username}/copilot`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/copilot/get(copilot/get-copilot-seat-details-for-user)`. func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output + /// Get Copilot metrics for a team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output /// Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -245,13 +333,16 @@ extension APIProtocol { /// List all Copilot seat assignments for an enterprise /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. /// /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. /// /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. /// @@ -270,10 +361,36 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot metrics for an enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, @@ -283,6 +400,8 @@ extension APIProtocol { /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. + /// /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. @@ -300,10 +419,39 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot metrics for an enterprise team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -336,11 +484,11 @@ extension APIProtocol { /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Gets information about an organization's Copilot subscription, including seat breakdown /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// @@ -360,11 +508,14 @@ extension APIProtocol { /// List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. /// Only organization owners can view assigned seats. /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. @@ -383,16 +534,16 @@ extension APIProtocol { /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -414,17 +565,19 @@ extension APIProtocol { /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. @@ -443,16 +596,16 @@ extension APIProtocol { /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -474,17 +627,19 @@ extension APIProtocol { /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. @@ -500,10 +655,39 @@ extension APIProtocol { body: body )) } + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for organization members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -533,9 +717,12 @@ extension APIProtocol { /// Get Copilot seat assignment details for a user /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. + /// + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -552,10 +739,39 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot metrics for a team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -647,6 +863,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -671,6 +889,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -692,7 +911,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -715,6 +935,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -738,6 +959,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -779,33 +1001,33 @@ public enum Components { } /// A GitHub organization. /// - /// - Remark: Generated from `#/components/schemas/organization-simple`. - public struct organization_hyphen_simple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-simple/login`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple`. + public struct nullable_hyphen_organization_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/login`. public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/id`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/repos_url`. public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/events_url`. public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/hooks_url`. public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/issues_url`. public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/members_url`. public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/public_members_url`. public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/description`. + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/description`. public var description: Swift.String? - /// Creates a new `organization_hyphen_simple`. + /// Creates a new `nullable_hyphen_organization_hyphen_simple`. /// /// - Parameters: /// - login: @@ -1122,7 +1344,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. public var sync_to_organizations: Swift.String /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var group_id: Swift.Int? + public var group_id: Swift.String? /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. public var html_url: Swift.String /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. @@ -1150,7 +1372,7 @@ public enum Components { slug: Swift.String, url: Swift.String, sync_to_organizations: Swift.String, - group_id: Swift.Int? = nil, + group_id: Swift.String? = nil, html_url: Swift.String, members_url: Swift.String, created_at: Foundation.Date, @@ -1184,68 +1406,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. public struct copilot_hyphen_seat_hyphen_details: Codable, Hashable, Sendable { - /// The assignee that has been granted access to GitHub Copilot. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - @frozen public enum assigneePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee/case1`. - case simple_hyphen_user(Components.Schemas.simple_hyphen_user) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .simple_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .simple_hyphen_user(value): - try value.encode(to: encoder) - } - } - } - /// The assignee that has been granted access to GitHub Copilot. - /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - public var assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload - /// The organization to which this seat belongs. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - @frozen public enum organizationPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization/case1`. - case organization_hyphen_simple(Components.Schemas.organization_hyphen_simple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .organization_hyphen_simple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .organization_hyphen_simple(value): - try value.encode(to: encoder) - } - } - } - /// The organization to which this seat belongs. - /// + public var assignee: Components.Schemas.simple_hyphen_user /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - public var organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? + public var organization: Components.Schemas.nullable_hyphen_organization_hyphen_simple? /// The team through which the assignee is granted access to GitHub Copilot, if applicable. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. @@ -1307,26 +1471,40 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. public var updated_at: Foundation.Date? + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. + @frozen public enum plan_typePayload: String, Codable, Hashable, Sendable { + case business = "business" + case enterprise = "enterprise" + case unknown = "unknown" + } + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/plan_type`. + public var plan_type: Components.Schemas.copilot_hyphen_seat_hyphen_details.plan_typePayload? /// Creates a new `copilot_hyphen_seat_hyphen_details`. /// /// - Parameters: - /// - assignee: The assignee that has been granted access to GitHub Copilot. - /// - organization: The organization to which this seat belongs. + /// - assignee: + /// - organization: /// - assigning_team: The team through which the assignee is granted access to GitHub Copilot, if applicable. /// - pending_cancellation_date: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. /// - last_activity_at: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. /// - last_activity_editor: Last editor that was used by the user for a GitHub Copilot completion. /// - created_at: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// - updated_at: Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - plan_type: The Copilot plan of the organization, or the parent enterprise, when applicable. public init( - assignee: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload, - organization: Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload? = nil, + assignee: Components.Schemas.simple_hyphen_user, + organization: Components.Schemas.nullable_hyphen_organization_hyphen_simple? = nil, assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? = nil, pending_cancellation_date: Swift.String? = nil, last_activity_at: Foundation.Date? = nil, last_activity_editor: Swift.String? = nil, created_at: Foundation.Date, - updated_at: Foundation.Date? = nil + updated_at: Foundation.Date? = nil, + plan_type: Components.Schemas.copilot_hyphen_seat_hyphen_details.plan_typePayload? = nil ) { self.assignee = assignee self.organization = organization @@ -1336,6 +1514,7 @@ public enum Components { self.last_activity_editor = last_activity_editor self.created_at = created_at self.updated_at = updated_at + self.plan_type = plan_type } public enum CodingKeys: String, CodingKey { case assignee @@ -1346,15 +1525,16 @@ public enum Components { case last_activity_editor case created_at case updated_at + case plan_type } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) assignee = try container.decode( - Components.Schemas.copilot_hyphen_seat_hyphen_details.assigneePayload.self, + Components.Schemas.simple_hyphen_user.self, forKey: .assignee ) organization = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_seat_hyphen_details.organizationPayload.self, + Components.Schemas.nullable_hyphen_organization_hyphen_simple.self, forKey: .organization ) assigning_team = try container.decodeIfPresent( @@ -1381,6 +1561,10 @@ public enum Components { Foundation.Date.self, forKey: .updated_at ) + plan_type = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_seat_hyphen_details.plan_typePayload.self, + forKey: .plan_type + ) try decoder.ensureNoAdditionalProperties(knownKeys: [ "assignee", "organization", @@ -1389,541 +1573,1454 @@ public enum Components { "last_activity_at", "last_activity_editor", "created_at", - "updated_at" + "updated_at", + "plan_type" ]) } } - /// Summary of Copilot usage. + /// Usage metrics for Copilot editor code completions in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. - public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { - /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. - public var day: Swift.String - /// The total number of Copilot code completion suggestions shown to users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. - public var total_suggestions_count: Swift.Int? - /// The total number of Copilot code completion suggestions accepted by users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. - public var total_acceptances_count: Swift.Int? - /// The total number of lines of code completions suggested by Copilot. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. - public var total_lines_suggested: Swift.Int? - /// The total number of lines of code completions accepted by users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. - public var total_lines_accepted: Swift.Int? - /// The total number of users who were shown Copilot code completion suggestions during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. - public var total_active_users: Swift.Int? - /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. - public var total_chat_acceptances: Swift.Int? - /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_turns`. - public var total_chat_turns: Swift.Int? - /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions`. + public struct copilot_hyphen_ide_hyphen_code_hyphen_completions: Codable, Hashable, Sendable { + /// Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. - public var total_active_chat_users: Swift.Int? - /// Breakdown of Copilot usage by editor for this language + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Usage metrics for a given language for the given editor for Copilot code completions. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. - public struct breakdownPayloadPayload: Codable, Hashable, Sendable { - /// The language in which Copilot suggestions were shown to users in the specified editor. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languagesPayload`. + public struct languagesPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/language`. - public var language: Swift.String? - /// The editor in which Copilot suggestions were shown to users for the specified language. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languagesPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/editor`. - public var editor: Swift.String? - /// The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languagesPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Creates a new `languagesPayloadPayload`. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. - public var suggestions_count: Swift.Int? - /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions. + /// - total_engaged_users: Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. + public init( + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + } + } + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public typealias languagesPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayloadPayload] + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public var languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload? + /// Copilot code completion metrics for active editors. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload`. + public struct editorsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the given editor. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/acceptances_count`. - public var acceptances_count: Swift.Int? - /// The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. - public var lines_suggested: Swift.Int? - /// The number of lines of code accepted by users in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/is_custom_model`. + public var is_custom_model: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/custom_model_training_date`. + public var custom_model_training_date: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Usage metrics for a given language for the given editor for Copilot code completions. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload`. + public struct languagesPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/name`. + public var name: Swift.String? + /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// The number of Copilot code suggestions generated for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/total_code_suggestions`. + public var total_code_suggestions: Swift.Int? + /// The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/total_code_acceptances`. + public var total_code_acceptances: Swift.Int? + /// The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/total_code_lines_suggested`. + public var total_code_lines_suggested: Swift.Int? + /// The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languagesPayload/total_code_lines_accepted`. + public var total_code_lines_accepted: Swift.Int? + /// Creates a new `languagesPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - total_engaged_users: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. + /// - total_code_suggestions: The number of Copilot code suggestions generated for the given editor, for the given language. + /// - total_code_acceptances: The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + /// - total_code_lines_suggested: The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + /// - total_code_lines_accepted: The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. + public init( + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + total_code_suggestions: Swift.Int? = nil, + total_code_acceptances: Swift.Int? = nil, + total_code_lines_suggested: Swift.Int? = nil, + total_code_lines_accepted: Swift.Int? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.total_code_suggestions = total_code_suggestions + self.total_code_acceptances = total_code_acceptances + self.total_code_lines_suggested = total_code_lines_suggested + self.total_code_lines_accepted = total_code_lines_accepted + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case total_code_suggestions + case total_code_acceptances + case total_code_lines_suggested + case total_code_lines_accepted + } + } + /// Code completion metrics for active languages, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languages`. + public typealias languagesPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload.languagesPayloadPayload] + /// Code completion metrics for active languages, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload/languages`. + public var languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload.languagesPayload? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_engaged_users: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. + /// - languages: Code completion metrics for active languages, for the given editor. + public init( + name: Swift.String? = nil, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload.languagesPayload? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.languages = languages + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case languages + } + } + /// List of model metrics for custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. - public var lines_accepted: Swift.Int? - /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload] + /// List of model metrics for custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. - public var active_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/models`. + public var models: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload? /// A container of undocumented properties. public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `breakdownPayloadPayload`. + /// Creates a new `editorsPayloadPayload`. /// /// - Parameters: - /// - language: The language in which Copilot suggestions were shown to users in the specified editor. - /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. - /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. - /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. - /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. - /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. - /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - name: Name of the given editor. + /// - total_engaged_users: Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. + /// - models: List of model metrics for custom models and the default model. /// - additionalProperties: A container of undocumented properties. public init( - language: Swift.String? = nil, - editor: Swift.String? = nil, - suggestions_count: Swift.Int? = nil, - acceptances_count: Swift.Int? = nil, - lines_suggested: Swift.Int? = nil, - lines_accepted: Swift.Int? = nil, - active_users: Swift.Int? = nil, + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.language = language - self.editor = editor - self.suggestions_count = suggestions_count - self.acceptances_count = acceptances_count - self.lines_suggested = lines_suggested - self.lines_accepted = lines_accepted - self.active_users = active_users + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case language - case editor - case suggestions_count - case acceptances_count - case lines_suggested - case lines_accepted - case active_users + case name + case total_engaged_users + case models } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - language = try container.decodeIfPresent( - Swift.String.self, - forKey: .language - ) - editor = try container.decodeIfPresent( + name = try container.decodeIfPresent( Swift.String.self, - forKey: .editor - ) - suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .suggestions_count - ) - acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .acceptances_count - ) - lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .lines_suggested + forKey: .name ) - lines_accepted = try container.decodeIfPresent( + total_engaged_users = try container.decodeIfPresent( Swift.Int.self, - forKey: .lines_accepted + forKey: .total_engaged_users ) - active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .active_users + models = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload.self, + forKey: .models ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "language", - "editor", - "suggestions_count", - "acceptances_count", - "lines_suggested", - "lines_accepted", - "active_users" + "name", + "total_engaged_users", + "models" ]) } public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( - language, - forKey: .language - ) - try container.encodeIfPresent( - editor, - forKey: .editor - ) - try container.encodeIfPresent( - suggestions_count, - forKey: .suggestions_count - ) - try container.encodeIfPresent( - acceptances_count, - forKey: .acceptances_count - ) - try container.encodeIfPresent( - lines_suggested, - forKey: .lines_suggested + name, + forKey: .name ) try container.encodeIfPresent( - lines_accepted, - forKey: .lines_accepted + total_engaged_users, + forKey: .total_engaged_users ) try container.encodeIfPresent( - active_users, - forKey: .active_users + models, + forKey: .models ) try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? - /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public typealias editorsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public var editors: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_ide_hyphen_code_hyphen_completions`. /// /// - Parameters: - /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. - /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. - /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. - /// - total_lines_accepted: The total number of lines of code completions accepted by users. - /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. - /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). - /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. - /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. - /// - breakdown: Breakdown of Copilot code completions usage by language and editor + /// - total_engaged_users: Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. + /// - languages: Code completion metrics for active languages. + /// - editors: + /// - additionalProperties: A container of undocumented properties. public init( - day: Swift.String, - total_suggestions_count: Swift.Int? = nil, - total_acceptances_count: Swift.Int? = nil, - total_lines_suggested: Swift.Int? = nil, - total_lines_accepted: Swift.Int? = nil, - total_active_users: Swift.Int? = nil, - total_chat_acceptances: Swift.Int? = nil, - total_chat_turns: Swift.Int? = nil, - total_active_chat_users: Swift.Int? = nil, - breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil + total_engaged_users: Swift.Int? = nil, + languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload? = nil, + editors: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.day = day - self.total_suggestions_count = total_suggestions_count - self.total_acceptances_count = total_acceptances_count - self.total_lines_suggested = total_lines_suggested - self.total_lines_accepted = total_lines_accepted - self.total_active_users = total_active_users - self.total_chat_acceptances = total_chat_acceptances - self.total_chat_turns = total_chat_turns - self.total_active_chat_users = total_active_chat_users - self.breakdown = breakdown + self.total_engaged_users = total_engaged_users + self.languages = languages + self.editors = editors + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case day - case total_suggestions_count - case total_acceptances_count - case total_lines_suggested - case total_lines_accepted - case total_active_users - case total_chat_acceptances - case total_chat_turns - case total_active_chat_users - case breakdown + case total_engaged_users + case languages + case editors } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - day = try container.decode( - Swift.String.self, - forKey: .day - ) - total_suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_suggestions_count - ) - total_acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_acceptances_count - ) - total_lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_lines_suggested - ) - total_lines_accepted = try container.decodeIfPresent( + total_engaged_users = try container.decodeIfPresent( Swift.Int.self, - forKey: .total_lines_accepted + forKey: .total_engaged_users ) - total_active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_users + languages = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload.self, + forKey: .languages ) - total_chat_acceptances = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_acceptances + editors = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload.self, + forKey: .editors ) - total_chat_turns = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_turns + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "languages", + "editors" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users ) - total_active_chat_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_chat_users + try container.encodeIfPresent( + languages, + forKey: .languages ) - breakdown = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, - forKey: .breakdown + try container.encodeIfPresent( + editors, + forKey: .editors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "day", - "total_suggestions_count", - "total_acceptances_count", - "total_lines_suggested", - "total_lines_accepted", - "total_active_users", - "total_chat_acceptances", - "total_chat_turns", - "total_active_chat_users", - "breakdown" - ]) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// The breakdown of Copilot Business seats for the organization. + /// Usage metrics for Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. - public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { - /// The total number of seats being billed for the organization as of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. - public var total: Swift.Int? - /// Seats added during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. - public var added_this_cycle: Swift.Int? - /// The number of seats that are pending cancellation at the end of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. - public var pending_cancellation: Swift.Int? - /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. - public var pending_invitation: Swift.Int? - /// The number of seats that have used Copilot during the current billing cycle. + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat`. + public struct copilot_hyphen_ide_hyphen_chat: Codable, Hashable, Sendable { + /// Total number of users who prompted Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. - public var active_this_cycle: Swift.Int? - /// The number of seats that have not used Copilot during the current billing cycle. + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Copilot Chat metrics, for active editors. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. - public var inactive_this_cycle: Swift.Int? - /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload`. + public struct editorsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/name`. + public var name: Swift.String? + /// The number of users who prompted Copilot Chat in the specified editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/is_custom_model`. + public var is_custom_model: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/custom_model_training_date`. + public var custom_model_training_date: Swift.String? + /// The number of users who prompted Copilot Chat in the given editor and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// The total number of chats initiated by users in the given editor and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/total_chats`. + public var total_chats: Swift.Int? + /// The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/total_chat_insertion_events`. + public var total_chat_insertion_events: Swift.Int? + /// The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload/total_chat_copy_events`. + public var total_chat_copy_events: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_engaged_users: The number of users who prompted Copilot Chat in the given editor and model. + /// - total_chats: The total number of chats initiated by users in the given editor and model. + /// - total_chat_insertion_events: The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + /// - total_chat_copy_events: The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. + public init( + name: Swift.String? = nil, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + total_chats: Swift.Int? = nil, + total_chat_insertion_events: Swift.Int? = nil, + total_chat_copy_events: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.total_chats = total_chats + self.total_chat_insertion_events = total_chat_insertion_events + self.total_chat_copy_events = total_chat_copy_events + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case total_chats + case total_chat_insertion_events + case total_chat_copy_events + } + } + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayloadPayload] + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/models`. + public var models: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayload? + /// Creates a new `editorsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the given editor. + /// - total_engaged_users: The number of users who prompted Copilot Chat in the specified editor. + /// - models: List of model metrics for custom models and the default model. + public init( + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayload? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models + } + } + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public typealias editorsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public var editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_ide_hyphen_chat`. /// /// - Parameters: - /// - total: The total number of seats being billed for the organization as of the current billing cycle. - /// - added_this_cycle: Seats added during the current billing cycle. - /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. - /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. - /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. - /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. + /// - total_engaged_users: Total number of users who prompted Copilot Chat in the IDE. + /// - editors: + /// - additionalProperties: A container of undocumented properties. public init( - total: Swift.Int? = nil, - added_this_cycle: Swift.Int? = nil, - pending_cancellation: Swift.Int? = nil, - pending_invitation: Swift.Int? = nil, - active_this_cycle: Swift.Int? = nil, - inactive_this_cycle: Swift.Int? = nil + total_engaged_users: Swift.Int? = nil, + editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.total = total - self.added_this_cycle = added_this_cycle - self.pending_cancellation = pending_cancellation - self.pending_invitation = pending_invitation - self.active_this_cycle = active_this_cycle - self.inactive_this_cycle = inactive_this_cycle + self.total_engaged_users = total_engaged_users + self.editors = editors + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case total - case added_this_cycle - case pending_cancellation - case pending_invitation - case active_this_cycle - case inactive_this_cycle + case total_engaged_users + case editors + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + editors = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload.self, + forKey: .editors + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "editors" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + editors, + forKey: .editors + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Information about the seat breakdown and policies set for an organization with a Copilot Business subscription. + /// Usage metrics for Copilot Chat in github.com /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. - public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. - public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { - case allow = "allow" - case block = "block" - case unconfigured = "unconfigured" - case unknown = "unknown" + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat`. + public struct copilot_hyphen_dotcom_hyphen_chat: Codable, Hashable, Sendable { + /// Total number of users who prompted Copilot Chat on github.com at least once. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload/is_custom_model`. + public var is_custom_model: Swift.Bool? + /// The training date for the custom model (if applicable). + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload/custom_model_training_date`. + public var custom_model_training_date: Swift.String? + /// Total number of users who prompted Copilot Chat on github.com at least once for each model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Total number of chats initiated by users on github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload/total_chats`. + public var total_chats: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model (if applicable). + /// - total_engaged_users: Total number of users who prompted Copilot Chat on github.com at least once for each model. + /// - total_chats: Total number of chats initiated by users on github.com. + public init( + name: Swift.String? = nil, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + total_chats: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.total_chats = total_chats + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case total_chats + } } - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// List of model metrics for a custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" - } - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayloadPayload] + /// List of model metrics for a custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public var models: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_dotcom_hyphen_chat`. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Parameters: + /// - total_engaged_users: Total number of users who prompted Copilot Chat on github.com at least once. + /// - models: List of model metrics for a custom models and the default model. + /// - additionalProperties: A container of undocumented properties. + public init( + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.total_engaged_users = total_engaged_users + self.models = models + self.additionalProperties = additionalProperties } - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - @frozen public enum cliPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + public enum CodingKeys: String, CodingKey { + case total_engaged_users + case models } - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + models = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload.self, + forKey: .models + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "models" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + models, + forKey: .models + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Usage metrics for Copilot for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests`. + public struct copilot_hyphen_dotcom_hyphen_pull_hyphen_requests: Codable, Hashable, Sendable { + /// The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload`. + public struct repositoriesPayloadPayload: Codable, Hashable, Sendable { + /// Repository name + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/name`. + public var name: Swift.String? + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload/name`. + public var name: Swift.String? + /// Indicates whether a model is custom or default. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload/is_custom_model`. + public var is_custom_model: Swift.Bool? + /// The training date for the custom model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload/custom_model_training_date`. + public var custom_model_training_date: Swift.String? + /// The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload/total_pr_summaries_created`. + public var total_pr_summaries_created: Swift.Int? + /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_pr_summaries_created: The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + /// - total_engaged_users: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. + public init( + name: Swift.String? = nil, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_pr_summaries_created: Swift.Int? = nil, + total_engaged_users: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_pr_summaries_created = total_pr_summaries_created + self.total_engaged_users = total_engaged_users + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_pr_summaries_created + case total_engaged_users + } + } + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayloadPayload] + /// List of model metrics for custom models and the default model. + /// + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/models`. + public var models: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayload? + /// Creates a new `repositoriesPayloadPayload`. + /// + /// - Parameters: + /// - name: Repository name + /// - total_engaged_users: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. + /// - models: List of model metrics for custom models and the default model. + public init( + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayload? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models + } + } + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? - /// The mode of assigning new seats. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public typealias repositoriesPayload = [Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload] + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { - case assign_all = "assign_all" - case assign_selected = "assign_selected" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public var repositories: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_dotcom_hyphen_pull_hyphen_requests`. + /// + /// - Parameters: + /// - total_engaged_users: The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. + /// - repositories: Repositories in which users used Copilot for Pull Requests to generate pull request summaries + /// - additionalProperties: A container of undocumented properties. + public init( + total_engaged_users: Swift.Int? = nil, + repositories: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.total_engaged_users = total_engaged_users + self.repositories = repositories + self.additionalProperties = additionalProperties } - /// The mode of assigning new seats. + public enum CodingKeys: String, CodingKey { + case total_engaged_users + case repositories + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + repositories = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload.self, + forKey: .repositories + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "repositories" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + repositories, + forKey: .repositories + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Copilot usage metrics for a given day. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day`. + public struct copilot_hyphen_usage_hyphen_metrics_hyphen_day: Codable, Hashable, Sendable { + /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/date`. + public var date: Swift.String + /// The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_active_users`. + public var total_active_users: Swift.Int? + /// The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_code_completions`. + public var copilot_ide_code_completions: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_chat`. + public var copilot_ide_chat: Components.Schemas.copilot_hyphen_ide_hyphen_chat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_chat`. + public var copilot_dotcom_chat: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_pull_requests`. + public var copilot_dotcom_pull_requests: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests? /// A container of undocumented properties. public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `copilot_hyphen_organization_hyphen_details`. + /// Creates a new `copilot_hyphen_usage_hyphen_metrics_hyphen_day`. /// /// - Parameters: - /// - seat_breakdown: - /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. - /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - seat_management_setting: The mode of assigning new seats. + /// - date: The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. + /// - total_active_users: The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// - total_engaged_users: The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. + /// - copilot_ide_code_completions: + /// - copilot_ide_chat: + /// - copilot_dotcom_chat: + /// - copilot_dotcom_pull_requests: /// - additionalProperties: A container of undocumented properties. public init( - seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, - public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, - ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, - platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, - cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, - seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, + date: Swift.String, + total_active_users: Swift.Int? = nil, + total_engaged_users: Swift.Int? = nil, + copilot_ide_code_completions: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions? = nil, + copilot_ide_chat: Components.Schemas.copilot_hyphen_ide_hyphen_chat? = nil, + copilot_dotcom_chat: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat? = nil, + copilot_dotcom_pull_requests: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.seat_breakdown = seat_breakdown - self.public_code_suggestions = public_code_suggestions - self.ide_chat = ide_chat - self.platform_chat = platform_chat - self.cli = cli - self.seat_management_setting = seat_management_setting + self.date = date + self.total_active_users = total_active_users + self.total_engaged_users = total_engaged_users + self.copilot_ide_code_completions = copilot_ide_code_completions + self.copilot_ide_chat = copilot_ide_chat + self.copilot_dotcom_chat = copilot_dotcom_chat + self.copilot_dotcom_pull_requests = copilot_dotcom_pull_requests self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case seat_breakdown - case public_code_suggestions - case ide_chat - case platform_chat - case cli - case seat_management_setting + case date + case total_active_users + case total_engaged_users + case copilot_ide_code_completions + case copilot_ide_chat + case copilot_dotcom_chat + case copilot_dotcom_pull_requests } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - seat_breakdown = try container.decode( - Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, - forKey: .seat_breakdown + date = try container.decode( + Swift.String.self, + forKey: .date ) - public_code_suggestions = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, - forKey: .public_code_suggestions + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users ) - ide_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, - forKey: .ide_chat + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users ) - platform_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, - forKey: .platform_chat + copilot_ide_code_completions = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.self, + forKey: .copilot_ide_code_completions ) - cli = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, - forKey: .cli + copilot_ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_chat.self, + forKey: .copilot_ide_chat ) - seat_management_setting = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, - forKey: .seat_management_setting + copilot_dotcom_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.self, + forKey: .copilot_dotcom_chat + ) + copilot_dotcom_pull_requests = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.self, + forKey: .copilot_dotcom_pull_requests ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "seat_breakdown", - "public_code_suggestions", - "ide_chat", - "platform_chat", - "cli", - "seat_management_setting" + "date", + "total_active_users", + "total_engaged_users", + "copilot_ide_code_completions", + "copilot_ide_chat", + "copilot_dotcom_chat", + "copilot_dotcom_pull_requests" ]) } public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode( - seat_breakdown, - forKey: .seat_breakdown + date, + forKey: .date ) - try container.encode( - public_code_suggestions, - forKey: .public_code_suggestions + try container.encodeIfPresent( + total_active_users, + forKey: .total_active_users ) try container.encodeIfPresent( - ide_chat, - forKey: .ide_chat + total_engaged_users, + forKey: .total_engaged_users ) try container.encodeIfPresent( - platform_chat, - forKey: .platform_chat + copilot_ide_code_completions, + forKey: .copilot_ide_code_completions ) try container.encodeIfPresent( - cli, - forKey: .cli + copilot_ide_chat, + forKey: .copilot_ide_chat ) - try container.encode( - seat_management_setting, - forKey: .seat_management_setting + try container.encodeIfPresent( + copilot_dotcom_chat, + forKey: .copilot_dotcom_chat + ) + try container.encodeIfPresent( + copilot_dotcom_pull_requests, + forKey: .copilot_dotcom_pull_requests ) try encoder.encodeAdditionalProperties(additionalProperties) } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { + /// Summary of Copilot usage. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. + public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { + /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. + public var day: Swift.String + /// The total number of Copilot code completion suggestions shown to users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. + public var total_suggestions_count: Swift.Int? + /// The total number of Copilot code completion suggestions accepted by users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. + public var total_acceptances_count: Swift.Int? + /// The total number of lines of code completions suggested by Copilot. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. + public var total_lines_suggested: Swift.Int? + /// The total number of lines of code completions accepted by users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. + public var total_lines_accepted: Swift.Int? + /// The total number of users who were shown Copilot code completion suggestions during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. + public var total_active_users: Swift.Int? + /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. + public var total_chat_acceptances: Swift.Int? + /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_turns`. + public var total_chat_turns: Swift.Int? + /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. + public var total_active_chat_users: Swift.Int? + /// Breakdown of Copilot usage by editor for this language + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. + public struct breakdownPayloadPayload: Codable, Hashable, Sendable { + /// The language in which Copilot suggestions were shown to users in the specified editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/language`. + public var language: Swift.String? + /// The editor in which Copilot suggestions were shown to users for the specified language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/editor`. + public var editor: Swift.String? + /// The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. + public var suggestions_count: Swift.Int? + /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/acceptances_count`. + public var acceptances_count: Swift.Int? + /// The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. + public var lines_suggested: Swift.Int? + /// The number of lines of code accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. + public var lines_accepted: Swift.Int? + /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. + public var active_users: Swift.Int? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `breakdownPayloadPayload`. + /// + /// - Parameters: + /// - language: The language in which Copilot suggestions were shown to users in the specified editor. + /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. + /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. + /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - additionalProperties: A container of undocumented properties. + public init( + language: Swift.String? = nil, + editor: Swift.String? = nil, + suggestions_count: Swift.Int? = nil, + acceptances_count: Swift.Int? = nil, + lines_suggested: Swift.Int? = nil, + lines_accepted: Swift.Int? = nil, + active_users: Swift.Int? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.language = language + self.editor = editor + self.suggestions_count = suggestions_count + self.acceptances_count = acceptances_count + self.lines_suggested = lines_suggested + self.lines_accepted = lines_accepted + self.active_users = active_users + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case language + case editor + case suggestions_count + case acceptances_count + case lines_suggested + case lines_accepted + case active_users + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + language = try container.decodeIfPresent( + Swift.String.self, + forKey: .language + ) + editor = try container.decodeIfPresent( + Swift.String.self, + forKey: .editor + ) + suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .suggestions_count + ) + acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .acceptances_count + ) + lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_suggested + ) + lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_accepted + ) + active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .active_users + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "language", + "editor", + "suggestions_count", + "acceptances_count", + "lines_suggested", + "lines_accepted", + "active_users" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + language, + forKey: .language + ) + try container.encodeIfPresent( + editor, + forKey: .editor + ) + try container.encodeIfPresent( + suggestions_count, + forKey: .suggestions_count + ) + try container.encodeIfPresent( + acceptances_count, + forKey: .acceptances_count + ) + try container.encodeIfPresent( + lines_suggested, + forKey: .lines_suggested + ) + try container.encodeIfPresent( + lines_accepted, + forKey: .lines_accepted + ) + try container.encodeIfPresent( + active_users, + forKey: .active_users + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? + /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. + /// + /// - Parameters: + /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. + /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. + /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. + /// - total_lines_accepted: The total number of lines of code completions accepted by users. + /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. + /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// - breakdown: Breakdown of Copilot code completions usage by language and editor + public init( + day: Swift.String, + total_suggestions_count: Swift.Int? = nil, + total_acceptances_count: Swift.Int? = nil, + total_lines_suggested: Swift.Int? = nil, + total_lines_accepted: Swift.Int? = nil, + total_active_users: Swift.Int? = nil, + total_chat_acceptances: Swift.Int? = nil, + total_chat_turns: Swift.Int? = nil, + total_active_chat_users: Swift.Int? = nil, + breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil + ) { + self.day = day + self.total_suggestions_count = total_suggestions_count + self.total_acceptances_count = total_acceptances_count + self.total_lines_suggested = total_lines_suggested + self.total_lines_accepted = total_lines_accepted + self.total_active_users = total_active_users + self.total_chat_acceptances = total_chat_acceptances + self.total_chat_turns = total_chat_turns + self.total_active_chat_users = total_active_chat_users + self.breakdown = breakdown + } + public enum CodingKeys: String, CodingKey { + case day + case total_suggestions_count + case total_acceptances_count + case total_lines_suggested + case total_lines_accepted + case total_active_users + case total_chat_acceptances + case total_chat_turns + case total_active_chat_users + case breakdown + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + day = try container.decode( + Swift.String.self, + forKey: .day + ) + total_suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_suggestions_count + ) + total_acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_acceptances_count + ) + total_lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_suggested + ) + total_lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_accepted + ) + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users + ) + total_chat_acceptances = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_acceptances + ) + total_chat_turns = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_turns + ) + total_active_chat_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_chat_users + ) + breakdown = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, + forKey: .breakdown + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "day", + "total_suggestions_count", + "total_acceptances_count", + "total_lines_suggested", + "total_lines_accepted", + "total_active_users", + "total_chat_acceptances", + "total_chat_turns", + "total_active_chat_users", + "breakdown" + ]) + } + } + /// The breakdown of Copilot Business seats for the organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. + public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { + /// The total number of seats being billed for the organization as of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. + public var total: Swift.Int? + /// Seats added during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. + public var added_this_cycle: Swift.Int? + /// The number of seats that are pending cancellation at the end of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. + public var pending_cancellation: Swift.Int? + /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. + public var pending_invitation: Swift.Int? + /// The number of seats that have used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. + public var active_this_cycle: Swift.Int? + /// The number of seats that have not used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. + public var inactive_this_cycle: Swift.Int? + /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. + /// + /// - Parameters: + /// - total: The total number of seats being billed for the organization as of the current billing cycle. + /// - added_this_cycle: Seats added during the current billing cycle. + /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. + /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. + /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. + public init( + total: Swift.Int? = nil, + added_this_cycle: Swift.Int? = nil, + pending_cancellation: Swift.Int? = nil, + pending_invitation: Swift.Int? = nil, + active_this_cycle: Swift.Int? = nil, + inactive_this_cycle: Swift.Int? = nil + ) { + self.total = total + self.added_this_cycle = added_this_cycle + self.pending_cancellation = pending_cancellation + self.pending_invitation = pending_invitation + self.active_this_cycle = active_this_cycle + self.inactive_this_cycle = inactive_this_cycle + } + public enum CodingKeys: String, CodingKey { + case total + case added_this_cycle + case pending_cancellation + case pending_invitation + case active_this_cycle + case inactive_this_cycle + } + } + /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. + public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. + public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { + case allow = "allow" + case block = "block" + case unconfigured = "unconfigured" + case unknown = "unknown" + } + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + @frozen public enum cliPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { + case assign_all = "assign_all" + case assign_selected = "assign_selected" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + @frozen public enum plan_typePayload: String, Codable, Hashable, Sendable { + case business = "business" + case enterprise = "enterprise" + case unknown = "unknown" + } + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + public var plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_organization_hyphen_details`. + /// + /// - Parameters: + /// - seat_breakdown: + /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// - seat_management_setting: The mode of assigning new seats. + /// - plan_type: The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - additionalProperties: A container of undocumented properties. + public init( + seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, + public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, + ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, + platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, + cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, + seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, + plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.seat_breakdown = seat_breakdown + self.public_code_suggestions = public_code_suggestions + self.ide_chat = ide_chat + self.platform_chat = platform_chat + self.cli = cli + self.seat_management_setting = seat_management_setting + self.plan_type = plan_type + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case seat_breakdown + case public_code_suggestions + case ide_chat + case platform_chat + case cli + case seat_management_setting + case plan_type + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + seat_breakdown = try container.decode( + Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, + forKey: .seat_breakdown + ) + public_code_suggestions = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, + forKey: .public_code_suggestions + ) + ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, + forKey: .ide_chat + ) + platform_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, + forKey: .platform_chat + ) + cli = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, + forKey: .cli + ) + seat_management_setting = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, + forKey: .seat_management_setting + ) + plan_type = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload.self, + forKey: .plan_type + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "seat_breakdown", + "public_code_suggestions", + "ide_chat", + "platform_chat", + "cli", + "seat_management_setting", + "plan_type" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + seat_breakdown, + forKey: .seat_breakdown + ) + try container.encode( + public_code_suggestions, + forKey: .public_code_suggestions + ) + try container.encodeIfPresent( + ide_chat, + forKey: .ide_chat + ) + try container.encodeIfPresent( + platform_chat, + forKey: .platform_chat + ) + try container.encodeIfPresent( + cli, + forKey: .cli + ) + try container.encode( + seat_management_setting, + forKey: .seat_management_setting + ) + try container.encodeIfPresent( + plan_type, + forKey: .plan_type + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// /// - Remark: Generated from `#/components/parameters/page`. @@ -1932,6 +3029,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias enterprise = Swift.String + /// The slug of the enterprise team name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team-slug`. + public typealias enterprise_hyphen_team_hyphen_slug = Swift.String /// The slug of the team name. /// /// - Remark: Generated from `#/components/parameters/team-slug`. @@ -1945,157 +3046,772 @@ public enum Components { /// - Remark: Generated from `#/components/parameters/username`. public typealias username = Swift.String } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct not_found: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// The associated value of the enum case if `self` is `.json`. + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct not_found: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.not_found.Body + /// Creates a new `not_found`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.not_found.Body) { + self.body = body + } + } + public struct requires_authentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.requires_authentication.Body + /// Creates a new `requires_authentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.requires_authentication.Body) { + self.body = body + } + } + public struct forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body + } + } + public struct internal_error: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.internal_error.Body) { + self.body = body + } + } + public struct usage_metrics_api_disabled: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.usage_metrics_api_disabled.Body + /// Creates a new `usage_metrics_api_disabled`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.usage_metrics_api_disabled.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List all Copilot seat assignments for an enterprise + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have + /// telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data, + /// see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + public enum copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/list-copilot-seats-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + public init(enterprise: Components.Parameters.enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. + public var total_seats: Swift.Int? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/seats`. + public var seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_seats: The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// - seats: + public init( + total_seats: Swift.Int? = nil, + seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? = nil + ) { + self.total_seats = total_seats + self.seats = seats + } + public enum CodingKeys: String, CodingKey { + case total_seats + case seats + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/application\/json`. + case json(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(), + body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.requires_authentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.requires_authentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get Copilot metrics for an enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/copilot-metrics-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// Creates a new `Path`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + public init(enterprise: Components.Parameters.enterprise) { + self.enterprise = enterprise } } - /// Received HTTP response body - public var body: Components.Responses.not_found.Body - /// Creates a new `not_found`. + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query`. + public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/until`. + public var until: Swift.String? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + since: Swift.String? = nil, + until: Swift.String? = nil, + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.not_found.Body) { - self.body = body + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - public struct requires_authentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } } } } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.requires_authentication.Body - /// Creates a new `requires_authentication`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.requires_authentication.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - } - public struct forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.forbidden.Body - /// Creates a new `forbidden`. + /// Forbidden /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - } - public struct internal_error: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { - self.body = body + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.usage_metrics_api_disabled { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List all Copilot seat assignments for an enterprise + /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, + /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. /// - /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time. /// - /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// - /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. - public enum copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise { - public static let id: Swift.String = "copilot/list-copilot-seats-for-enterprise" + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. + public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/usage-metrics-for-enterprise" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path`. public struct Path: Sendable, Hashable { /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path/enterprise`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path/enterprise`. public var enterprise: Components.Parameters.enterprise /// Creates a new `Path`. /// @@ -2105,43 +3821,57 @@ public enum Operations { self.enterprise = enterprise } } - public var path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query`. + public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query`. public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/until`. + public var until: Swift.String? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/page`. public var page: Components.Parameters.page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/per_page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/per_page`. public var per_page: Swift.Int? /// Creates a new `Query`. /// /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( + since: Swift.String? = nil, + until: Swift.String? = nil, page: Components.Parameters.page? = nil, per_page: Swift.Int? = nil ) { + self.since = since + self.until = until self.page = page self.per_page = per_page } } - public var query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/header`. + public var query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers + public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2149,9 +3879,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, - query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), - headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers = .init() + path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() ) { self.path = path self.query = query @@ -2160,54 +3890,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers/Link`. - public var Link: Components.Headers.link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Link: - public init(Link: Components.Headers.link? = nil) { - self.Link = Link - } - } - /// Received HTTP response headers - public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. - public var total_seats: Swift.Int? - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/seats`. - public var seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_seats: The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - /// - seats: - public init( - total_seats: Swift.Int? = nil, - seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? = nil - ) { - self.total_seats = total_seats - self.seats = seats - } - public enum CodingKeys: String, CodingKey { - case total_seats - case seats - } - } - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/application\/json`. - case json(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload { + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { get throws { switch self { case let .json(body): @@ -2217,31 +3908,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(), - body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok) + case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok { + public var ok: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { get throws { switch self { case let .ok(response): @@ -2256,7 +3942,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.internal_error) @@ -2279,7 +3965,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/401`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.requires_authentication) @@ -2302,7 +3988,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -2325,7 +4011,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -2377,60 +4063,68 @@ public enum Operations { } } } - /// Get a summary of Copilot usage for enterprise members - /// - /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// Get Copilot metrics for an enterprise team /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, - /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// - /// Only owners and billing managers can view Copilot usage metrics for the enterprise. + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. - public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise { - public static let id: Swift.String = "copilot/usage-metrics-for-enterprise" + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team { + public static let id: Swift.String = "copilot/copilot-metrics-for-enterprise-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path`. public struct Path: Sendable, Hashable { /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path/enterprise`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path/enterprise`. public var enterprise: Components.Parameters.enterprise + /// The slug of the enterprise team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path/team_slug`. + public var team_slug: Components.Parameters.enterprise_hyphen_team_hyphen_slug /// Creates a new `Path`. /// /// - Parameters: /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. - public init(enterprise: Components.Parameters.enterprise) { + /// - team_slug: The slug of the enterprise team name. + public init( + enterprise: Components.Parameters.enterprise, + team_slug: Components.Parameters.enterprise_hyphen_team_hyphen_slug + ) { self.enterprise = enterprise + self.team_slug = team_slug } } - public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query`. + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query`. public struct Query: Sendable, Hashable { /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/since`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/since`. public var since: Swift.String? /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/until`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/until`. public var until: Swift.String? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/page`. public var page: Components.Parameters.page? /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/per_page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/per_page`. public var per_page: Swift.Int? /// Creates a new `Query`. /// @@ -2451,19 +4145,19 @@ public enum Operations { self.per_page = per_page } } - public var query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/header`. + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers + public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2471,9 +4165,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() ) { self.path = path self.query = query @@ -2482,15 +4176,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content/application\/json`. - case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics]) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { get throws { switch self { case let .json(body): @@ -2500,26 +4194,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok) + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { + public var ok: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok { get throws { switch self { case let .ok(response): @@ -2534,7 +4228,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.internal_error) @@ -2555,32 +4249,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.requires_authentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.requires_authentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -2603,7 +4274,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -2614,11 +4285,34 @@ public enum Operations { public var notFound: Components.Responses.not_found { get throws { switch self { - case let .notFound(response): + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.usage_metrics_api_disabled { + get throws { + switch self { + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -2658,7 +4352,7 @@ public enum Operations { /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -2948,11 +4642,11 @@ public enum Operations { /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Gets information about an organization's Copilot subscription, including seat breakdown /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// @@ -3208,11 +4902,14 @@ public enum Operations { /// List all Copilot seat assignments for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. /// Only organization owners can view assigned seats. /// + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. @@ -3509,16 +5206,16 @@ public enum Operations { /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -3599,7 +5296,7 @@ public enum Operations { public struct Created: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seat assignments created. + /// The total number of seats created for members of the specified team(s). /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json`. public struct jsonPayload: Codable, Hashable, Sendable { @@ -3817,17 +5514,19 @@ public enum Operations { /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. @@ -3905,7 +5604,7 @@ public enum Operations { public struct Ok: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seat assignments cancelled. + /// The total number of seats set to "pending cancellation" for members of the specified team(s). /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json`. public struct jsonPayload: Codable, Hashable, Sendable { @@ -4123,16 +5822,16 @@ public enum Operations { /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// /// Only organization owners can add Copilot seats for their organization members. /// /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// @@ -4213,7 +5912,7 @@ public enum Operations { public struct Created: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seat assignments created. + /// The total number of seats created for the specified user(s). /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json`. public struct jsonPayload: Codable, Hashable, Sendable { @@ -4431,17 +6130,19 @@ public enum Operations { /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". + /// For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// /// Only organization owners can cancel Copilot seats for their organization members. /// + /// The response will contain the total number of seats set to "pending cancellation". + /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. @@ -4519,7 +6220,7 @@ public enum Operations { public struct Ok: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seat assignments cancelled. + /// The total number of seats set to "pending cancellation" for the specified users. /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json`. public struct jsonPayload: Codable, Hashable, Sendable { @@ -4624,7 +6325,288 @@ public enum Operations { return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization { + public static let id: Swift.String = "copilot/copilot-metrics-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query`. + public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/until`. + public var until: Swift.String? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + since: Swift.String? = nil, + until: Swift.String? = nil, + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", response: self ) } @@ -4632,7 +6614,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -4655,7 +6637,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -4676,21 +6658,17 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent) + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent { + public var unprocessableContent: Components.Responses.usage_metrics_api_disabled { get throws { switch self { case let .unprocessableContent(response): @@ -4737,7 +6715,7 @@ public enum Operations { /// Get a summary of Copilot usage for organization members /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. @@ -5015,9 +6993,12 @@ public enum Operations { /// Get Copilot seat assignment details for a user /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. + /// + /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -5279,10 +7260,296 @@ public enum Operations { } } } + /// Get Copilot metrics for a team + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. + /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team { + public static let id: Swift.String = "copilot/copilot-metrics-for-team" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path/org`. + public var org: Components.Parameters.org + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path/team_slug`. + public var team_slug: Components.Parameters.team_hyphen_slug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - team_slug: The slug of the team name. + public init( + org: Components.Parameters.org, + team_slug: Components.Parameters.team_hyphen_slug + ) { + self.org = org + self.team_slug = team_slug + } + } + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query`. + public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/until`. + public var until: Swift.String? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + since: Swift.String? = nil, + until: Swift.String? = nil, + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.usage_metrics_api_disabled { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] - /// > This endpoint is in beta and is subject to change. + /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE /// for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 3e93aff0c8b..26aece0dc31 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -551,6 +551,83 @@ public enum Servers { public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. public enum Schemas { + /// - Remark: Generated from `#/components/schemas/cvss-severities`. + public struct cvss_hyphen_severities: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3`. + public struct cvss_v3Payload: Codable, Hashable, Sendable { + /// The CVSS 3 vector string. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3/vector_string`. + public var vector_string: Swift.String? + /// The CVSS 3 score. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3/score`. + public var score: Swift.Double? + /// Creates a new `cvss_v3Payload`. + /// + /// - Parameters: + /// - vector_string: The CVSS 3 vector string. + /// - score: The CVSS 3 score. + public init( + vector_string: Swift.String? = nil, + score: Swift.Double? = nil + ) { + self.vector_string = vector_string + self.score = score + } + public enum CodingKeys: String, CodingKey { + case vector_string + case score + } + } + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3`. + public var cvss_v3: Components.Schemas.cvss_hyphen_severities.cvss_v3Payload? + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4`. + public struct cvss_v4Payload: Codable, Hashable, Sendable { + /// The CVSS 4 vector string. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4/vector_string`. + public var vector_string: Swift.String? + /// The CVSS 4 score. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4/score`. + public var score: Swift.Double? + /// Creates a new `cvss_v4Payload`. + /// + /// - Parameters: + /// - vector_string: The CVSS 4 vector string. + /// - score: The CVSS 4 score. + public init( + vector_string: Swift.String? = nil, + score: Swift.Double? = nil + ) { + self.vector_string = vector_string + self.score = score + } + public enum CodingKeys: String, CodingKey { + case vector_string + case score + } + } + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4`. + public var cvss_v4: Components.Schemas.cvss_hyphen_severities.cvss_v4Payload? + /// Creates a new `cvss_hyphen_severities`. + /// + /// - Parameters: + /// - cvss_v3: + /// - cvss_v4: + public init( + cvss_v3: Components.Schemas.cvss_hyphen_severities.cvss_v3Payload? = nil, + cvss_v4: Components.Schemas.cvss_hyphen_severities.cvss_v4Payload? = nil + ) { + self.cvss_v3 = cvss_v3 + self.cvss_v4 = cvss_v4 + } + public enum CodingKeys: String, CodingKey { + case cvss_v3 + case cvss_v4 + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/simple-user`. @@ -597,6 +674,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -621,6 +700,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -642,7 +722,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -665,6 +746,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -688,6 +770,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -804,6 +887,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -828,6 +913,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -849,7 +935,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -872,6 +959,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -895,6 +983,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Scim Error @@ -1228,6 +1317,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss`. public var cvss: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cvssPayload + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss_severities`. + public var cvss_severities: Components.Schemas.cvss_hyphen_severities? /// A CWE weakness assigned to the advisory. /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload`. @@ -1398,6 +1489,7 @@ public enum Components { /// - vulnerabilities: Vulnerable version range information for the advisory. /// - severity: The severity of the advisory. /// - cvss: Details for the advisory pertaining to the Common Vulnerability Scoring System. + /// - cvss_severities: /// - cwes: Details for the advisory pertaining to Common Weakness Enumeration. /// - identifiers: Values that identify this advisory among security information sources. /// - references: Links to additional advisory information. @@ -1412,6 +1504,7 @@ public enum Components { vulnerabilities: [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability], severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.severityPayload, cvss: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cvssPayload, + cvss_severities: Components.Schemas.cvss_hyphen_severities? = nil, cwes: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayload, identifiers: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayload, references: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayload, @@ -1426,6 +1519,7 @@ public enum Components { self.vulnerabilities = vulnerabilities self.severity = severity self.cvss = cvss + self.cvss_severities = cvss_severities self.cwes = cwes self.identifiers = identifiers self.references = references @@ -1441,6 +1535,7 @@ public enum Components { case vulnerabilities case severity case cvss + case cvss_severities case cwes case identifiers case references @@ -1478,6 +1573,10 @@ public enum Components { Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cvssPayload.self, forKey: .cvss ) + cvss_severities = try container.decodeIfPresent( + Components.Schemas.cvss_hyphen_severities.self, + forKey: .cvss_severities + ) cwes = try container.decode( Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayload.self, forKey: .cwes @@ -1510,6 +1609,7 @@ public enum Components { "vulnerabilities", "severity", "cvss", + "cvss_severities", "cwes", "identifiers", "references", @@ -2309,6 +2409,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2317,18 +2439,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2336,6 +2461,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -5764,7 +5890,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/direction`. public var direction: Components.Parameters.direction? - /// **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/page`. @available(*, deprecated) @@ -5805,7 +5931,7 @@ public enum Operations { /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. - /// - page: **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + /// - page: **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." diff --git a/Sources/dependency-graph/Types.swift b/Sources/dependency-graph/Types.swift index 8cb6940a2cb..f122c1d51fb 100644 --- a/Sources/dependency-graph/Types.swift +++ b/Sources/dependency-graph/Types.swift @@ -287,6 +287,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/spdxVersion`. public var spdxVersion: Swift.String + /// An optional comment about the SPDX document. + /// + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/comment`. + public var comment: Swift.String? /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/creationInfo`. public struct creationInfoPayload: Codable, Hashable, Sendable { /// The date and time the SPDX document was created. @@ -324,10 +328,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/dataLicense`. public var dataLicense: Swift.String - /// The name of the repository that the SPDX document describes. - /// - /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/documentDescribes`. - public var documentDescribes: [Swift.String] /// The namespace for the SPDX document. /// /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/documentNamespace`. @@ -466,45 +466,88 @@ public enum Components { public typealias packagesPayload = [Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.packagesPayloadPayload] /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/packages`. public var packages: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.packagesPayload + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationshipsPayload`. + public struct relationshipsPayloadPayload: Codable, Hashable, Sendable { + /// The type of relationship between the two SPDX elements. + /// + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationshipsPayload/relationshipType`. + public var relationshipType: Swift.String? + /// The SPDX identifier of the package that is the source of the relationship. + /// + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationshipsPayload/spdxElementId`. + public var spdxElementId: Swift.String? + /// The SPDX identifier of the package that is the target of the relationship. + /// + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationshipsPayload/relatedSpdxElement`. + public var relatedSpdxElement: Swift.String? + /// Creates a new `relationshipsPayloadPayload`. + /// + /// - Parameters: + /// - relationshipType: The type of relationship between the two SPDX elements. + /// - spdxElementId: The SPDX identifier of the package that is the source of the relationship. + /// - relatedSpdxElement: The SPDX identifier of the package that is the target of the relationship. + public init( + relationshipType: Swift.String? = nil, + spdxElementId: Swift.String? = nil, + relatedSpdxElement: Swift.String? = nil + ) { + self.relationshipType = relationshipType + self.spdxElementId = spdxElementId + self.relatedSpdxElement = relatedSpdxElement + } + public enum CodingKeys: String, CodingKey { + case relationshipType + case spdxElementId + case relatedSpdxElement + } + } + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationships`. + public typealias relationshipsPayload = [Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.relationshipsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom/relationships`. + public var relationships: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.relationshipsPayload? /// Creates a new `sbomPayload`. /// /// - Parameters: /// - SPDXID: The SPDX identifier for the SPDX document. /// - spdxVersion: The version of the SPDX specification that this document conforms to. + /// - comment: An optional comment about the SPDX document. /// - creationInfo: /// - name: The name of the SPDX document. /// - dataLicense: The license under which the SPDX document is licensed. - /// - documentDescribes: The name of the repository that the SPDX document describes. /// - documentNamespace: The namespace for the SPDX document. /// - packages: + /// - relationships: public init( SPDXID: Swift.String, spdxVersion: Swift.String, + comment: Swift.String? = nil, creationInfo: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.creationInfoPayload, name: Swift.String, dataLicense: Swift.String, - documentDescribes: [Swift.String], documentNamespace: Swift.String, - packages: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.packagesPayload + packages: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.packagesPayload, + relationships: Components.Schemas.dependency_hyphen_graph_hyphen_spdx_hyphen_sbom.sbomPayload.relationshipsPayload? = nil ) { self.SPDXID = SPDXID self.spdxVersion = spdxVersion + self.comment = comment self.creationInfo = creationInfo self.name = name self.dataLicense = dataLicense - self.documentDescribes = documentDescribes self.documentNamespace = documentNamespace self.packages = packages + self.relationships = relationships } public enum CodingKeys: String, CodingKey { case SPDXID case spdxVersion + case comment case creationInfo case name case dataLicense - case documentDescribes case documentNamespace case packages + case relationships } } /// - Remark: Generated from `#/components/schemas/dependency-graph-spdx-sbom/sbom`. diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index 1b538eb8d6d..8a02d7d31ea 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -619,6 +619,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -643,6 +645,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -664,7 +667,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -687,6 +691,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -710,6 +715,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -795,6 +801,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -819,6 +827,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -840,7 +849,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -863,6 +873,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -886,6 +897,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1060,6 +1072,10 @@ public enum Components { public var raw_url: Swift.String? /// - Remark: Generated from `#/components/schemas/base-gist/files/additionalProperties/size`. public var size: Swift.Int? + /// The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. + /// + /// - Remark: Generated from `#/components/schemas/base-gist/files/additionalProperties/encoding`. + public var encoding: Swift.String? /// Creates a new `additionalPropertiesPayload`. /// /// - Parameters: @@ -1068,18 +1084,21 @@ public enum Components { /// - language: /// - raw_url: /// - size: + /// - encoding: The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. public init( filename: Swift.String? = nil, _type: Swift.String? = nil, language: Swift.String? = nil, raw_url: Swift.String? = nil, - size: Swift.Int? = nil + size: Swift.Int? = nil, + encoding: Swift.String? = nil ) { self.filename = filename self._type = _type self.language = language self.raw_url = raw_url self.size = size + self.encoding = encoding } public enum CodingKeys: String, CodingKey { case filename @@ -1087,6 +1106,7 @@ public enum Components { case language case raw_url case size + case encoding } } /// A container of undocumented properties. @@ -1226,6 +1246,8 @@ public enum Components { public var login: Swift.String /// - Remark: Generated from `#/components/schemas/public-user/id`. public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/public-user/user_view_type`. + public var user_view_type: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/node_id`. public var node_id: Swift.String /// - Remark: Generated from `#/components/schemas/public-user/avatar_url`. @@ -1325,8 +1347,6 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/public-user/plan`. public var plan: Components.Schemas.public_hyphen_user.planPayload? - /// - Remark: Generated from `#/components/schemas/public-user/suspended_at`. - public var suspended_at: Foundation.Date? /// - Remark: Generated from `#/components/schemas/public-user/private_gists`. public var private_gists: Swift.Int? /// - Remark: Generated from `#/components/schemas/public-user/total_private_repos`. @@ -1342,6 +1362,7 @@ public enum Components { /// - Parameters: /// - login: /// - id: + /// - user_view_type: /// - node_id: /// - avatar_url: /// - gravatar_id: @@ -1374,7 +1395,6 @@ public enum Components { /// - created_at: /// - updated_at: /// - plan: - /// - suspended_at: /// - private_gists: /// - total_private_repos: /// - owned_private_repos: @@ -1383,6 +1403,7 @@ public enum Components { public init( login: Swift.String, id: Swift.Int64, + user_view_type: Swift.String? = nil, node_id: Swift.String, avatar_url: Swift.String, gravatar_id: Swift.String? = nil, @@ -1415,7 +1436,6 @@ public enum Components { created_at: Foundation.Date, updated_at: Foundation.Date, plan: Components.Schemas.public_hyphen_user.planPayload? = nil, - suspended_at: Foundation.Date? = nil, private_gists: Swift.Int? = nil, total_private_repos: Swift.Int? = nil, owned_private_repos: Swift.Int? = nil, @@ -1424,6 +1444,7 @@ public enum Components { ) { self.login = login self.id = id + self.user_view_type = user_view_type self.node_id = node_id self.avatar_url = avatar_url self.gravatar_id = gravatar_id @@ -1456,7 +1477,6 @@ public enum Components { self.created_at = created_at self.updated_at = updated_at self.plan = plan - self.suspended_at = suspended_at self.private_gists = private_gists self.total_private_repos = total_private_repos self.owned_private_repos = owned_private_repos @@ -1466,6 +1486,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case login case id + case user_view_type case node_id case avatar_url case gravatar_id @@ -1498,7 +1519,6 @@ public enum Components { case created_at case updated_at case plan - case suspended_at case private_gists case total_private_repos case owned_private_repos @@ -1515,6 +1535,10 @@ public enum Components { Swift.Int64.self, forKey: .id ) + user_view_type = try container.decodeIfPresent( + Swift.String.self, + forKey: .user_view_type + ) node_id = try container.decode( Swift.String.self, forKey: .node_id @@ -1643,10 +1667,6 @@ public enum Components { Components.Schemas.public_hyphen_user.planPayload.self, forKey: .plan ) - suspended_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .suspended_at - ) private_gists = try container.decodeIfPresent( Swift.Int.self, forKey: .private_gists @@ -1670,6 +1690,7 @@ public enum Components { try decoder.ensureNoAdditionalProperties(knownKeys: [ "login", "id", + "user_view_type", "node_id", "avatar_url", "gravatar_id", @@ -1702,7 +1723,6 @@ public enum Components { "created_at", "updated_at", "plan", - "suspended_at", "private_gists", "total_private_repos", "owned_private_repos", @@ -2066,6 +2086,10 @@ public enum Components { public var truncated: Swift.Bool? /// - Remark: Generated from `#/components/schemas/gist-simple/files/additionalProperties/content`. public var content: Swift.String? + /// The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. + /// + /// - Remark: Generated from `#/components/schemas/gist-simple/files/additionalProperties/encoding`. + public var encoding: Swift.String? /// Creates a new `additionalPropertiesPayload`. /// /// - Parameters: @@ -2076,6 +2100,7 @@ public enum Components { /// - size: /// - truncated: /// - content: + /// - encoding: The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. public init( filename: Swift.String? = nil, _type: Swift.String? = nil, @@ -2083,7 +2108,8 @@ public enum Components { raw_url: Swift.String? = nil, size: Swift.Int? = nil, truncated: Swift.Bool? = nil, - content: Swift.String? = nil + content: Swift.String? = nil, + encoding: Swift.String? = nil ) { self.filename = filename self._type = _type @@ -2092,6 +2118,7 @@ public enum Components { self.size = size self.truncated = truncated self.content = content + self.encoding = encoding } public enum CodingKeys: String, CodingKey { case filename @@ -2101,6 +2128,7 @@ public enum Components { case size case truncated case content + case encoding } } /// A container of undocumented properties. @@ -2389,7 +2417,7 @@ public enum Components { /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias comment_hyphen_id = Swift.Int + public typealias comment_hyphen_id = Swift.Int64 /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 8511215829f..9b6e5a7eb50 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -1844,7 +1844,7 @@ public struct Client: APIProtocol { } /// Update an issue /// - /// Issue owners and users with push access can edit an issue. + /// Issue owners and users with push access or Triage role can edit an issue. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 094041126fb..e109cb7ae36 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -188,7 +188,7 @@ public protocol APIProtocol: Sendable { func issues_sol_get(_ input: Operations.issues_sol_get.Input) async throws -> Operations.issues_sol_get.Output /// Update an issue /// - /// Issue owners and users with push access can edit an issue. + /// Issue owners and users with push access or Triage role can edit an issue. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -712,7 +712,7 @@ extension APIProtocol { } /// Update an issue /// - /// Issue owners and users with push access can edit an issue. + /// Issue owners and users with push access or Triage role can edit an issue. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -1251,6 +1251,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -1275,6 +1277,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1296,7 +1299,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1319,6 +1323,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1342,6 +1347,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1427,6 +1433,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1451,6 +1459,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1472,7 +1481,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1495,6 +1505,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1518,6 +1529,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. @@ -2220,7 +2232,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -2408,7 +2420,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -6974,11 +6986,11 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/path`. public var path: Swift.String - /// The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. + /// The line index in the diff to which the comment applies. This field is closing down; use `line` instead. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/position`. public var position: Swift.Int? - /// The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + /// The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_position`. public var original_position: Swift.Int? @@ -7154,8 +7166,8 @@ public enum Components { /// - node_id: The node ID of the pull request review comment. /// - diff_hunk: The diff of the line that the comment refers to. /// - path: The relative path of the file to which the comment applies. - /// - position: The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. - /// - original_position: The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + /// - position: The line index in the diff to which the comment applies. This field is closing down; use `line` instead. + /// - original_position: The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. /// - commit_id: The SHA of the commit to which the comment applies. /// - original_commit_id: The SHA of the original commit to which the comment applies. /// - in_reply_to_id: The comment ID to reply to. @@ -7991,7 +8003,7 @@ public enum Components { /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias comment_hyphen_id = Swift.Int + public typealias comment_hyphen_id = Swift.Int64 /// A list of comma separated label names. Example: `bug,ui,@high` /// /// - Remark: Generated from `#/components/parameters/labels`. @@ -9736,7 +9748,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/body`. public var body: Swift.String? - /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ + /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignee`. public var assignee: Swift.String? @@ -9866,7 +9878,7 @@ public enum Operations { /// - Parameters: /// - title: The title of the issue. /// - body: The contents of the issue. - /// - assignee: Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ + /// - assignee: Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ /// - milestone: /// - labels: Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ /// - assignees: Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ @@ -11579,7 +11591,7 @@ public enum Operations { } /// Update an issue /// - /// Issue owners and users with push access can edit an issue. + /// Issue owners and users with push access or Triage role can edit an issue. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -11685,7 +11697,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/body`. public var body: Swift.String? - /// Username to assign to this issue. **This field is deprecated.** + /// Username to assign to this issue. **This field is closing down.** /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignee`. public var assignee: Swift.String? @@ -11838,7 +11850,7 @@ public enum Operations { /// - Parameters: /// - title: The title of the issue. /// - body: The contents of the issue. - /// - assignee: Username to assign to this issue. **This field is deprecated.** + /// - assignee: Username to assign to this issue. **This field is closing down.** /// - state: The open or closed state of the issue. /// - state_reason: The reason for the state change. Ignored unless `state` is changed. /// - milestone: diff --git a/Sources/meta/Types.swift b/Sources/meta/Types.swift index 3ada4926c35..938e1e9ec1e 100644 --- a/Sources/meta/Types.swift +++ b/Sources/meta/Types.swift @@ -443,6 +443,8 @@ public enum Components { public var actions: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/actions_macos`. public var actions_macos: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/api-overview/codespaces`. + public var codespaces: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/dependabot`. public var dependabot: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/copilot`. @@ -535,6 +537,7 @@ public enum Components { /// - importer: /// - actions: /// - actions_macos: + /// - codespaces: /// - dependabot: /// - copilot: /// - domains: @@ -552,6 +555,7 @@ public enum Components { importer: [Swift.String]? = nil, actions: [Swift.String]? = nil, actions_macos: [Swift.String]? = nil, + codespaces: [Swift.String]? = nil, dependabot: [Swift.String]? = nil, copilot: [Swift.String]? = nil, domains: Components.Schemas.api_hyphen_overview.domainsPayload? = nil @@ -569,6 +573,7 @@ public enum Components { self.importer = importer self.actions = actions self.actions_macos = actions_macos + self.codespaces = codespaces self.dependabot = dependabot self.copilot = copilot self.domains = domains @@ -587,6 +592,7 @@ public enum Components { case importer case actions case actions_macos + case codespaces case dependabot case copilot case domains diff --git a/Sources/migrations/Client.swift b/Sources/migrations/Client.swift index f0366d78270..6b752e13353 100644 --- a/Sources/migrations/Client.swift +++ b/Sources/migrations/Client.swift @@ -667,7 +667,7 @@ public struct Client: APIProtocol { /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -818,7 +818,7 @@ public struct Client: APIProtocol { /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/patch(migrations/update-import)`. @@ -922,7 +922,7 @@ public struct Client: APIProtocol { /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/put(migrations/start-import)`. @@ -1074,7 +1074,7 @@ public struct Client: APIProtocol { /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/delete(migrations/cancel-import)`. @@ -1147,7 +1147,7 @@ public struct Client: APIProtocol { /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/authors`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/get(migrations/get-commit-authors)`. @@ -1268,7 +1268,7 @@ public struct Client: APIProtocol { /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/authors/{author_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/{author_id}/patch(migrations/map-commit-author)`. @@ -1415,7 +1415,7 @@ public struct Client: APIProtocol { /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/large_files`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/large_files/get(migrations/get-large-files)`. @@ -1510,7 +1510,7 @@ public struct Client: APIProtocol { /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/lfs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/lfs/patch(migrations/set-lfs-preference)`. diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 186e2d975f7..2ab6b3f543c 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -74,7 +74,7 @@ public protocol APIProtocol: Sendable { /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -123,7 +123,7 @@ public protocol APIProtocol: Sendable { /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/patch(migrations/update-import)`. @@ -136,7 +136,7 @@ public protocol APIProtocol: Sendable { /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/put(migrations/start-import)`. @@ -147,7 +147,7 @@ public protocol APIProtocol: Sendable { /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/delete(migrations/cancel-import)`. @@ -160,7 +160,7 @@ public protocol APIProtocol: Sendable { /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/authors`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/get(migrations/get-commit-authors)`. @@ -172,7 +172,7 @@ public protocol APIProtocol: Sendable { /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/authors/{author_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/{author_id}/patch(migrations/map-commit-author)`. @@ -183,7 +183,7 @@ public protocol APIProtocol: Sendable { /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/large_files`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/large_files/get(migrations/get-large-files)`. @@ -198,7 +198,7 @@ public protocol APIProtocol: Sendable { /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/lfs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/lfs/patch(migrations/set-lfs-preference)`. @@ -411,7 +411,7 @@ extension APIProtocol { /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -468,7 +468,7 @@ extension APIProtocol { /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/patch(migrations/update-import)`. @@ -491,7 +491,7 @@ extension APIProtocol { /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/put(migrations/start-import)`. @@ -512,7 +512,7 @@ extension APIProtocol { /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/delete(migrations/cancel-import)`. @@ -533,7 +533,7 @@ extension APIProtocol { /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/authors`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/get(migrations/get-commit-authors)`. @@ -555,7 +555,7 @@ extension APIProtocol { /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/authors/{author_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/{author_id}/patch(migrations/map-commit-author)`. @@ -576,7 +576,7 @@ extension APIProtocol { /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/large_files`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/large_files/get(migrations/get-large-files)`. @@ -599,7 +599,7 @@ extension APIProtocol { /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/lfs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/lfs/patch(migrations/set-lfs-preference)`. @@ -813,6 +813,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -837,6 +839,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -858,7 +861,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -881,6 +885,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -904,6 +909,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -989,6 +995,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1013,6 +1021,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1034,7 +1043,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1057,6 +1067,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1080,6 +1091,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1504,7 +1516,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -1692,7 +1704,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -2159,6 +2171,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2167,18 +2201,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2186,6 +2223,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -4736,7 +4774,7 @@ public enum Operations { /// View the progress of an import. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// **Import status** /// @@ -4964,7 +5002,7 @@ public enum Operations { /// You can select the project to import by providing one of the objects in the `project_choices` array in the update request. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/patch(migrations/update-import)`. @@ -5194,7 +5232,7 @@ public enum Operations { /// return a status `422 Unprocessable Entity` response. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/put(migrations/start-import)`. @@ -5495,7 +5533,7 @@ public enum Operations { /// Stop an import for a repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/import`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/delete(migrations/cancel-import)`. @@ -5640,7 +5678,7 @@ public enum Operations { /// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/authors`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/get(migrations/get-commit-authors)`. @@ -5849,7 +5887,7 @@ public enum Operations { /// new commits to the repository. /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/authors/{author_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/authors/{author_id}/patch(migrations/map-commit-author)`. @@ -6118,7 +6156,7 @@ public enum Operations { /// List files larger than 100MB found during the import /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/import/large_files`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/large_files/get(migrations/get-large-files)`. @@ -6289,7 +6327,7 @@ public enum Operations { /// site](https://docs.github.com/repositories/working-with-files/managing-large-files). /// /// > [!WARNING] - /// > **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). + /// > **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/import/lfs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/import/lfs/patch(migrations/set-lfs-preference)`. diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 3ab8bd3028e..fa05bb49a73 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -224,10 +224,10 @@ public struct Client: APIProtocol { /// Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -1641,13 +1641,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1711,7 +1704,864 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.validation_failed.Body + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a webhook delivery for an organization webhook + /// + /// Returns a delivery for a webhook configured in an organization. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. + public func orgs_sol_get_hyphen_webhook_hyphen_delivery(_ input: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Input) async throws -> Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/hooks/{}/deliveries/{}", + parameters: [ + input.path.org, + input.path.hook_id, + input.path.delivery_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.hook_hyphen_delivery.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.bad_request.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.scim_hyphen_error.self, + from: responseBody, + transforming: { value in + .application_scim_plus_json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Redeliver a delivery for an organization webhook + /// + /// Redeliver a delivery for a webhook configured in an organization. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. + public func orgs_sol_redeliver_hyphen_webhook_hyphen_delivery(_ input: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input) async throws -> Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/hooks/{}/deliveries/{}/attempts", + parameters: [ + input.path.org, + input.path.hook_id, + input.path.delivery_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + OpenAPIRuntime.OpenAPIObjectContainer.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.bad_request.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.scim_hyphen_error.self, + from: responseBody, + transforming: { value in + .application_scim_plus_json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Ping an organization webhook + /// + /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) + /// to be sent to the hook. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. + public func orgs_sol_ping_hyphen_webhook(_ input: Operations.orgs_sol_ping_hyphen_webhook.Input) async throws -> Operations.orgs_sol_ping_hyphen_webhook.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_ping_hyphen_webhook.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/hooks/{}/pings", + parameters: [ + input.path.org, + input.path.hook_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/route-stats/{}/{}", + parameters: [ + input.path.org, + input.path.actor_type, + input.path.actor_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/subject-stats", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats/users/{}", + parameters: [ + input.path.org, + input.path.user_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats/{}/{}", + parameters: [ + input.path.org, + input.path.actor_type, + input.path.actor_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/time-stats", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1721,7 +2571,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.validation_hyphen_error.self, + Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats.self, from: responseBody, transforming: { value in .json(value) @@ -1730,7 +2580,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1743,28 +2593,22 @@ public struct Client: APIProtocol { } ) } - /// Get a webhook delivery for an organization webhook - /// - /// Returns a delivery for a webhook configured in an organization. + /// Get time stats by user /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. - public func orgs_sol_get_hyphen_webhook_hyphen_delivery(_ input: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Input) async throws -> Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output { try await client.send( input: input, - forOperation: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.id, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/deliveries/{}", + template: "/orgs/{}/insights/api/time-stats/users/{}", parameters: [ input.path.org, - input.path.hook_id, - input.path.delivery_id + input.path.user_id ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1772,6 +2616,27 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1782,7 +2647,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.orgs_sol_get_hyphen_webhook_hyphen_delivery.Output.Ok.Body + let body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1792,7 +2657,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.hook_hyphen_delivery.self, + Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats.self, from: responseBody, transforming: { value in .json(value) @@ -1802,59 +2667,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.bad_request.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.basic_hyphen_error.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.scim_hyphen_error.self, - from: responseBody, - transforming: { value in - .application_scim_plus_json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.validation_failed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.validation_hyphen_error.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1867,35 +2679,51 @@ public struct Client: APIProtocol { } ) } - /// Redeliver a delivery for an organization webhook - /// - /// Redeliver a delivery for a webhook configured in an organization. + /// Get time stats by actor /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. - public func orgs_sol_redeliver_hyphen_webhook_hyphen_delivery(_ input: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input) async throws -> Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output { try await client.send( input: input, - forOperation: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.id, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/deliveries/{}/attempts", + template: "/orgs/{}/insights/api/time-stats/{}/{}", parameters: [ input.path.org, - input.path.hook_id, - input.path.delivery_id + input.path.actor_type, + input.path.actor_id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1904,62 +2732,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 202: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.accepted.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - OpenAPIRuntime.OpenAPIObjectContainer.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .accepted(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.bad_request.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.basic_hyphen_error.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.scim_hyphen_error.self, - from: responseBody, - transforming: { value in - .application_scim_plus_json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 422: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.validation_failed.Body + let body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1969,7 +2744,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.validation_hyphen_error.self, + Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats.self, from: responseBody, transforming: { value in .json(value) @@ -1978,7 +2753,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1991,35 +2766,71 @@ public struct Client: APIProtocol { } ) } - /// Ping an organization webhook + /// Get user stats /// - /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) - /// to be sent to the hook. - /// - /// You must be an organization owner to use this endpoint. + /// Get API usage statistics within an organization for a user broken down by the type of access. /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. - /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. - public func orgs_sol_ping_hyphen_webhook(_ input: Operations.orgs_sol_ping_hyphen_webhook.Input) async throws -> Operations.orgs_sol_ping_hyphen_webhook.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output { try await client.send( input: input, - forOperation: Operations.orgs_sol_ping_hyphen_webhook.id, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/pings", + template: "/orgs/{}/insights/api/user-stats/{}", parameters: [ input.path.org, - input.path.hook_id + input.path.user_id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2028,11 +2839,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2042,7 +2851,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.basic_hyphen_error.self, + Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_stats.self, from: responseBody, transforming: { value in .json(value) @@ -2051,7 +2860,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6729,13 +7538,13 @@ public struct Client: APIProtocol { /// Enable or disable a security feature for an organization /// /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). /// /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)." /// /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// /// - Remark: HTTP `POST /orgs/{org}/{security_product}/{enablement}`. /// - Remark: Generated from `#/paths//orgs/{org}/{security_product}/{enablement}/post(orgs/enable-or-disable-security-product-on-all-org-repos)`. @@ -7201,6 +8010,9 @@ public struct Client: APIProtocol { /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. + /// /// - Remark: HTTP `GET /user/orgs`. /// - Remark: Generated from `#/paths//user/orgs/get(orgs/list-for-authenticated-user)`. public func orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output { diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 4c8aef3c32c..155bfea1c20 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -39,10 +39,10 @@ public protocol APIProtocol: Sendable { /// Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -246,6 +246,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. func orgs_sol_ping_hyphen_webhook(_ input: Operations.orgs_sol_ping_hyphen_webhook.Input) async throws -> Operations.orgs_sol_ping_hyphen_webhook.Output + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes @@ -694,13 +757,13 @@ public protocol APIProtocol: Sendable { /// Enable or disable a security feature for an organization /// /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). /// /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)." /// /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// /// - Remark: HTTP `POST /orgs/{org}/{security_product}/{enablement}`. /// - Remark: Generated from `#/paths//orgs/{org}/{security_product}/{enablement}/post(orgs/enable-or-disable-security-product-on-all-org-repos)`. @@ -733,6 +796,9 @@ public protocol APIProtocol: Sendable { /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. + /// /// - Remark: HTTP `GET /user/orgs`. /// - Remark: Generated from `#/paths//user/orgs/get(orgs/list-for-authenticated-user)`. func orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output @@ -793,10 +859,10 @@ extension APIProtocol { /// Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -1164,6 +1230,159 @@ extension APIProtocol { headers: headers )) } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes @@ -1960,13 +2179,13 @@ extension APIProtocol { /// Enable or disable a security feature for an organization /// /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). /// /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)." /// /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// /// - Remark: HTTP `POST /orgs/{org}/{security_product}/{enablement}`. /// - Remark: Generated from `#/paths//orgs/{org}/{security_product}/{enablement}/post(orgs/enable-or-disable-security-product-on-all-org-repos)`. @@ -2033,6 +2252,9 @@ extension APIProtocol { /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. + /// /// - Remark: HTTP `GET /user/orgs`. /// - Remark: Generated from `#/paths//user/orgs/get(orgs/list-for-authenticated-user)`. public func orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user( @@ -2125,6 +2347,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -2149,6 +2373,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -2170,7 +2395,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -2193,6 +2419,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -2216,6 +2443,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -2332,6 +2560,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -2356,6 +2586,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -2377,7 +2608,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -2400,6 +2632,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -2423,6 +2656,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// The URL to which the payloads will be delivered. @@ -3433,13 +3667,13 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organization_custom_properties: Components.Schemas.app_hyphen_permissions.organization_custom_propertiesPayload? - /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. @frozen public enum organization_copilot_seat_managementPayload: String, Codable, Hashable, Sendable { case write = "write" } - /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_copilot_seat_management`. public var organization_copilot_seat_management: Components.Schemas.app_hyphen_permissions.organization_copilot_seat_managementPayload? @@ -3507,7 +3741,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_plan`. public var organization_plan: Components.Schemas.app_hyphen_permissions.organization_planPayload? - /// The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_projects`. @frozen public enum organization_projectsPayload: String, Codable, Hashable, Sendable { @@ -3515,7 +3749,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_projects`. public var organization_projects: Components.Schemas.app_hyphen_permissions.organization_projectsPayload? @@ -3681,14 +3915,14 @@ public enum Components { /// - organization_custom_roles: The level of permission to grant the access token for custom repository roles management. /// - organization_custom_org_roles: The level of permission to grant the access token for custom organization roles management. /// - organization_custom_properties: The level of permission to grant the access token for custom property management. - /// - organization_copilot_seat_management: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + /// - organization_copilot_seat_management: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organization_announcement_banners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organization_events: The level of permission to grant the access token to view events triggered by an activity in an organization. /// - organization_hooks: The level of permission to grant the access token to manage the post-receive hooks for an organization. /// - organization_personal_access_tokens: The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. /// - organization_personal_access_token_requests: The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. /// - organization_plan: The level of permission to grant the access token for viewing an organization's plan. - /// - organization_projects: The level of permission to grant the access token to manage organization projects and projects beta (where available). + /// - organization_projects: The level of permission to grant the access token to manage organization projects and projects public preview (where available). /// - organization_packages: The level of permission to grant the access token for organization packages published to GitHub Packages. /// - organization_secrets: The level of permission to grant the access token to manage organization secrets. /// - organization_self_hosted_runners: The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. @@ -4085,91 +4319,6 @@ public enum Components { case html_url } } - /// A GitHub organization. - /// - /// - Remark: Generated from `#/components/schemas/organization-simple`. - public struct organization_hyphen_simple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-simple/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. - public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/description`. - public var description: Swift.String? - /// Creates a new `organization_hyphen_simple`. - /// - /// - Parameters: - /// - login: - /// - id: - /// - node_id: - /// - url: - /// - repos_url: - /// - events_url: - /// - hooks_url: - /// - issues_url: - /// - members_url: - /// - public_members_url: - /// - avatar_url: - /// - description: - public init( - login: Swift.String, - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - hooks_url: Swift.String, - issues_url: Swift.String, - members_url: Swift.String, - public_members_url: Swift.String, - avatar_url: Swift.String, - description: Swift.String? = nil - ) { - self.login = login - self.id = id - self.node_id = node_id - self.url = url - self.repos_url = repos_url - self.events_url = events_url - self.hooks_url = hooks_url - self.issues_url = issues_url - self.members_url = members_url - self.public_members_url = public_members_url - self.avatar_url = avatar_url - self.description = description - } - public enum CodingKeys: String, CodingKey { - case login - case id - case node_id - case url - case repos_url - case events_url - case hooks_url - case issues_url - case members_url - case public_members_url - case avatar_url - case description - } - } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. @@ -4535,6 +4684,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -4543,18 +4714,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -4562,6 +4736,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -5183,6 +5358,91 @@ public enum Components { case security_and_analysis } } + /// A GitHub organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-simple`. + public struct organization_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-simple/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. + public var public_members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/description`. + public var description: Swift.String? + /// Creates a new `organization_hyphen_simple`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - node_id: + /// - url: + /// - repos_url: + /// - events_url: + /// - hooks_url: + /// - issues_url: + /// - members_url: + /// - public_members_url: + /// - avatar_url: + /// - description: + public init( + login: Swift.String, + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + hooks_url: Swift.String, + issues_url: Swift.String, + members_url: Swift.String, + public_members_url: Swift.String, + avatar_url: Swift.String, + description: Swift.String? = nil + ) { + self.login = login + self.id = id + self.node_id = node_id + self.url = url + self.repos_url = repos_url + self.events_url = events_url + self.hooks_url = hooks_url + self.issues_url = issues_url + self.members_url = members_url + self.public_members_url = public_members_url + self.avatar_url = avatar_url + self.description = description + } + public enum CodingKeys: String, CodingKey { + case login + case id + case node_id + case url + case repos_url + case events_url + case hooks_url + case issues_url + case members_url + case public_members_url + case avatar_url + case description + } + } /// Organization Full /// /// - Remark: Generated from `#/components/schemas/organization-full`. @@ -5249,6 +5509,10 @@ public enum Components { public var private_gists: Swift.Int? /// - Remark: Generated from `#/components/schemas/organization-full/disk_usage`. public var disk_usage: Swift.Int? + /// The number of collaborators on private repositories. + /// + /// This field may be null if the number of private repositories is over 50,000. + /// /// - Remark: Generated from `#/components/schemas/organization-full/collaborators`. public var collaborators: Swift.Int? /// - Remark: Generated from `#/components/schemas/organization-full/billing_email`. @@ -5320,7 +5584,7 @@ public enum Components { public var members_can_fork_private_repositories: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-full/web_commit_signoff_required`. public var web_commit_signoff_required: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization. /// @@ -5329,7 +5593,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-full/advanced_security_enabled_for_new_repositories`. @available(*, deprecated) public var advanced_security_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. /// @@ -5338,7 +5602,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_alerts_enabled_for_new_repositories`. @available(*, deprecated) public var dependabot_alerts_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. /// @@ -5347,7 +5611,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-full/dependabot_security_updates_enabled_for_new_repositories`. @available(*, deprecated) public var dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -5356,7 +5620,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-full/dependency_graph_enabled_for_new_repositories`. @available(*, deprecated) public var dependency_graph_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -5365,7 +5629,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/organization-full/secret_scanning_enabled_for_new_repositories`. @available(*, deprecated) public var secret_scanning_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -5388,6 +5652,10 @@ public enum Components { public var updated_at: Foundation.Date /// - Remark: Generated from `#/components/schemas/organization-full/archived_at`. public var archived_at: Foundation.Date? + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/deploy_keys_enabled_for_repositories`. + public var deploy_keys_enabled_for_repositories: Swift.Bool? /// Creates a new `organization_hyphen_full`. /// /// - Parameters: @@ -5422,7 +5690,7 @@ public enum Components { /// - owned_private_repos: /// - private_gists: /// - disk_usage: - /// - collaborators: + /// - collaborators: The number of collaborators on private repositories. /// - billing_email: /// - plan: /// - default_repository_permission: @@ -5437,17 +5705,18 @@ public enum Components { /// - members_can_create_private_pages: /// - members_can_fork_private_repositories: /// - web_commit_signoff_required: - /// - advanced_security_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabot_alerts_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabot_security_updates_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependency_graph_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secret_scanning_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secret_scanning_push_protection_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - advanced_security_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabot_alerts_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabot_security_updates_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependency_graph_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secret_scanning_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secret_scanning_push_protection_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// - secret_scanning_push_protection_custom_link_enabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. /// - secret_scanning_push_protection_custom_link: An optional URL string to display to contributors who are blocked from pushing a secret. /// - created_at: /// - updated_at: /// - archived_at: + /// - deploy_keys_enabled_for_repositories: Controls whether or not deploy keys may be added and used for repositories in the organization. public init( login: Swift.String, id: Swift.Int, @@ -5505,7 +5774,8 @@ public enum Components { secret_scanning_push_protection_custom_link: Swift.String? = nil, created_at: Foundation.Date, updated_at: Foundation.Date, - archived_at: Foundation.Date? = nil + archived_at: Foundation.Date? = nil, + deploy_keys_enabled_for_repositories: Swift.Bool? = nil ) { self.login = login self.id = id @@ -5564,6 +5834,7 @@ public enum Components { self.created_at = created_at self.updated_at = updated_at self.archived_at = archived_at + self.deploy_keys_enabled_for_repositories = deploy_keys_enabled_for_repositories } public enum CodingKeys: String, CodingKey { case login @@ -5623,6 +5894,7 @@ public enum Components { case created_at case updated_at case archived_at + case deploy_keys_enabled_for_repositories } } /// Organization Invitation @@ -5824,7 +6096,254 @@ public enum Components { case _type = "type" } } - /// Org Membership + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats`. + public struct api_hyphen_insights_hyphen_route_hyphen_statsPayload: Codable, Hashable, Sendable { + /// The HTTP method + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/http_method`. + public var http_method: Swift.String? + /// The API path's route template + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/api_route`. + public var api_route: Swift.String? + /// The total number of requests within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// The total number of requests that were rate limited within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_route_hyphen_statsPayload`. + /// + /// - Parameters: + /// - http_method: The HTTP method + /// - api_route: The API path's route template + /// - total_request_count: The total number of requests within the queried time period + /// - rate_limited_request_count: The total number of requests that were rate limited within the queried time period + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + http_method: Swift.String? = nil, + api_route: Swift.String? = nil, + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.http_method = http_method + self.api_route = api_route + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case http_method + case api_route + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage route stats for an actor + /// + /// - Remark: Generated from `#/components/schemas/api-insights-route-stats`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_statsPayload] + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats`. + public struct api_hyphen_insights_hyphen_subject_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_type`. + public var subject_type: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_name`. + public var subject_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_id`. + public var subject_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_subject_hyphen_statsPayload`. + /// + /// - Parameters: + /// - subject_type: + /// - subject_name: + /// - subject_id: + /// - total_request_count: + /// - rate_limited_request_count: + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + subject_type: Swift.String? = nil, + subject_name: Swift.String? = nil, + subject_id: Swift.Int64? = nil, + total_request_count: Swift.Int? = nil, + rate_limited_request_count: Swift.Int? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.subject_type = subject_type + self.subject_name = subject_name + self.subject_id = subject_id + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case subject_type + case subject_name + case subject_id + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage subject stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-subject-stats`. + public typealias api_hyphen_insights_hyphen_subject_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_statsPayload] + /// API Insights usage summary stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats`. + public struct api_hyphen_insights_hyphen_summary_hyphen_stats: Codable, Hashable, Sendable { + /// The total number of requests within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// The total number of requests that were rate limited within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// Creates a new `api_hyphen_insights_hyphen_summary_hyphen_stats`. + /// + /// - Parameters: + /// - total_request_count: The total number of requests within the queried time period + /// - rate_limited_request_count: The total number of requests that were rate limited within the queried time period + public init( + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil + ) { + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + } + public enum CodingKeys: String, CodingKey { + case total_request_count + case rate_limited_request_count + } + } + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats`. + public struct api_hyphen_insights_hyphen_time_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/timestamp`. + public var timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// Creates a new `api_hyphen_insights_hyphen_time_hyphen_statsPayload`. + /// + /// - Parameters: + /// - timestamp: + /// - total_request_count: + /// - rate_limited_request_count: + public init( + timestamp: Swift.String? = nil, + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil + ) { + self.timestamp = timestamp + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + } + public enum CodingKeys: String, CodingKey { + case timestamp + case total_request_count + case rate_limited_request_count + } + } + /// API Insights usage time stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-time-stats`. + public typealias api_hyphen_insights_hyphen_time_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_statsPayload] + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats`. + public struct api_hyphen_insights_hyphen_user_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_type`. + public var actor_type: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_name`. + public var actor_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_id`. + public var actor_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/integration_id`. + public var integration_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/oauth_application_id`. + public var oauth_application_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_user_hyphen_statsPayload`. + /// + /// - Parameters: + /// - actor_type: + /// - actor_name: + /// - actor_id: + /// - integration_id: + /// - oauth_application_id: + /// - total_request_count: + /// - rate_limited_request_count: + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + actor_type: Swift.String? = nil, + actor_name: Swift.String? = nil, + actor_id: Swift.Int64? = nil, + integration_id: Swift.Int64? = nil, + oauth_application_id: Swift.Int64? = nil, + total_request_count: Swift.Int? = nil, + rate_limited_request_count: Swift.Int? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.actor_type = actor_type + self.actor_name = actor_name + self.actor_id = actor_id + self.integration_id = integration_id + self.oauth_application_id = oauth_application_id + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case actor_type + case actor_name + case actor_id + case integration_id + case oauth_application_id + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage stats for a user + /// + /// - Remark: Generated from `#/components/schemas/api-insights-user-stats`. + public typealias api_hyphen_insights_hyphen_user_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_statsPayload] + /// Org Membership /// /// - Remark: Generated from `#/components/schemas/org-membership`. public struct org_hyphen_membership: Codable, Hashable, Sendable { @@ -5929,6 +6448,32 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-role/description`. public var description: Swift.String? + /// The system role from which this role inherits permissions. + /// + /// - Remark: Generated from `#/components/schemas/organization-role/base_role`. + @frozen public enum base_rolePayload: String, Codable, Hashable, Sendable { + case read = "read" + case triage = "triage" + case write = "write" + case maintain = "maintain" + case admin = "admin" + } + /// The system role from which this role inherits permissions. + /// + /// - Remark: Generated from `#/components/schemas/organization-role/base_role`. + public var base_role: Components.Schemas.organization_hyphen_role.base_rolePayload? + /// Source answers the question, "where did this role come from?" + /// + /// - Remark: Generated from `#/components/schemas/organization-role/source`. + @frozen public enum sourcePayload: String, Codable, Hashable, Sendable { + case Organization = "Organization" + case Enterprise = "Enterprise" + case Predefined = "Predefined" + } + /// Source answers the question, "where did this role come from?" + /// + /// - Remark: Generated from `#/components/schemas/organization-role/source`. + public var source: Components.Schemas.organization_hyphen_role.sourcePayload? /// A list of permissions included in this role. /// /// - Remark: Generated from `#/components/schemas/organization-role/permissions`. @@ -5949,6 +6494,8 @@ public enum Components { /// - id: The unique identifier of the role. /// - name: The name of the role. /// - description: A short description about who this role is for or what permissions it grants. + /// - base_role: The system role from which this role inherits permissions. + /// - source: Source answers the question, "where did this role come from?" /// - permissions: A list of permissions included in this role. /// - organization: /// - created_at: The date and time the role was created. @@ -5957,6 +6504,8 @@ public enum Components { id: Swift.Int64, name: Swift.String, description: Swift.String? = nil, + base_role: Components.Schemas.organization_hyphen_role.base_rolePayload? = nil, + source: Components.Schemas.organization_hyphen_role.sourcePayload? = nil, permissions: [Swift.String], organization: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, created_at: Foundation.Date, @@ -5965,6 +6514,8 @@ public enum Components { self.id = id self.name = name self.description = description + self.base_role = base_role + self.source = source self.permissions = permissions self.organization = organization self.created_at = created_at @@ -5974,6 +6525,8 @@ public enum Components { case id case name case description + case base_role + case source case permissions case organization case created_at @@ -5984,6 +6537,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-role-assignment`. public struct team_hyphen_role_hyphen_assignment: Codable, Hashable, Sendable { + /// Determines if the team has a direct, indirect, or mixed relationship to a role + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/assignment`. + @frozen public enum assignmentPayload: String, Codable, Hashable, Sendable { + case direct = "direct" + case indirect = "indirect" + case mixed = "mixed" + } + /// Determines if the team has a direct, indirect, or mixed relationship to a role + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/assignment`. + public var assignment: Components.Schemas.team_hyphen_role_hyphen_assignment.assignmentPayload? /// - Remark: Generated from `#/components/schemas/team-role-assignment/id`. public var id: Swift.Int /// - Remark: Generated from `#/components/schemas/team-role-assignment/node_id`. @@ -6056,6 +6621,7 @@ public enum Components { /// Creates a new `team_hyphen_role_hyphen_assignment`. /// /// - Parameters: + /// - assignment: Determines if the team has a direct, indirect, or mixed relationship to a role /// - id: /// - node_id: /// - name: @@ -6071,6 +6637,7 @@ public enum Components { /// - repositories_url: /// - parent: public init( + assignment: Components.Schemas.team_hyphen_role_hyphen_assignment.assignmentPayload? = nil, id: Swift.Int, node_id: Swift.String, name: Swift.String, @@ -6086,6 +6653,7 @@ public enum Components { repositories_url: Swift.String, parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil ) { + self.assignment = assignment self.id = id self.node_id = node_id self.name = name @@ -6102,6 +6670,7 @@ public enum Components { self.parent = parent } public enum CodingKeys: String, CodingKey { + case assignment case id case node_id case name @@ -6229,6 +6798,22 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/user-role-assignment`. public struct user_hyphen_role_hyphen_assignment: Codable, Hashable, Sendable { + /// Determines if the user has a direct, indirect, or mixed relationship to a role + /// + /// - Remark: Generated from `#/components/schemas/user-role-assignment/assignment`. + @frozen public enum assignmentPayload: String, Codable, Hashable, Sendable { + case direct = "direct" + case indirect = "indirect" + case mixed = "mixed" + } + /// Determines if the user has a direct, indirect, or mixed relationship to a role + /// + /// - Remark: Generated from `#/components/schemas/user-role-assignment/assignment`. + public var assignment: Components.Schemas.user_hyphen_role_hyphen_assignment.assignmentPayload? + /// Team the user has gotten the role through + /// + /// - Remark: Generated from `#/components/schemas/user-role-assignment/inherited_from`. + public var inherited_from: [Components.Schemas.team_hyphen_simple]? /// - Remark: Generated from `#/components/schemas/user-role-assignment/name`. public var name: Swift.String? /// - Remark: Generated from `#/components/schemas/user-role-assignment/email`. @@ -6271,9 +6856,13 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/user-role-assignment/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/user-role-assignment/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `user_hyphen_role_hyphen_assignment`. /// /// - Parameters: + /// - assignment: Determines if the user has a direct, indirect, or mixed relationship to a role + /// - inherited_from: Team the user has gotten the role through /// - name: /// - email: /// - login: @@ -6295,7 +6884,10 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( + assignment: Components.Schemas.user_hyphen_role_hyphen_assignment.assignmentPayload? = nil, + inherited_from: [Components.Schemas.team_hyphen_simple]? = nil, name: Swift.String? = nil, email: Swift.String? = nil, login: Swift.String, @@ -6316,8 +6908,11 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { + self.assignment = assignment + self.inherited_from = inherited_from self.name = name self.email = email self.login = login @@ -6339,8 +6934,11 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { + case assignment + case inherited_from case name case email case login @@ -6362,6 +6960,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Minimal representation of an organization programmatic access grant request for enumerations @@ -6487,6 +7086,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/created_at`. public var created_at: Swift.String + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/token_id`. + public var token_id: Swift.Int + /// The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/token_name`. + public var token_name: Swift.String /// Whether the associated fine-grained personal access token has expired. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/token_expired`. @@ -6509,6 +7116,8 @@ public enum Components { /// - repositories_url: URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. /// - permissions: Permissions requested, categorized by type of permission. /// - created_at: Date and time when the request for access was created. + /// - token_id: Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// - token_name: The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. /// - token_expired: Whether the associated fine-grained personal access token has expired. /// - token_expires_at: Date and time when the associated fine-grained personal access token expires. /// - token_last_used_at: Date and time when the associated fine-grained personal access token was last used for authentication. @@ -6520,6 +7129,8 @@ public enum Components { repositories_url: Swift.String, permissions: Components.Schemas.organization_hyphen_programmatic_hyphen_access_hyphen_grant_hyphen_request.permissionsPayload, created_at: Swift.String, + token_id: Swift.Int, + token_name: Swift.String, token_expired: Swift.Bool, token_expires_at: Swift.String? = nil, token_last_used_at: Swift.String? = nil @@ -6531,6 +7142,8 @@ public enum Components { self.repositories_url = repositories_url self.permissions = permissions self.created_at = created_at + self.token_id = token_id + self.token_name = token_name self.token_expired = token_expired self.token_expires_at = token_expires_at self.token_last_used_at = token_last_used_at @@ -6543,6 +7156,8 @@ public enum Components { case repositories_url case permissions case created_at + case token_id + case token_name case token_expired case token_expires_at case token_last_used_at @@ -6552,7 +7167,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant`. public struct organization_hyphen_programmatic_hyphen_access_hyphen_grant: Codable, Hashable, Sendable { - /// Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + /// Unique identifier of the fine-grained personal access token grant. The `pat_id` used to get details about an approved fine-grained personal access token. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/id`. public var id: Swift.Int @@ -6667,6 +7282,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/access_granted_at`. public var access_granted_at: Swift.String + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/token_id`. + public var token_id: Swift.Int + /// The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/token_name`. + public var token_name: Swift.String /// Whether the associated fine-grained personal access token has expired. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/token_expired`. @@ -6682,12 +7305,14 @@ public enum Components { /// Creates a new `organization_hyphen_programmatic_hyphen_access_hyphen_grant`. /// /// - Parameters: - /// - id: Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + /// - id: Unique identifier of the fine-grained personal access token grant. The `pat_id` used to get details about an approved fine-grained personal access token. /// - owner: /// - repository_selection: Type of repository selection requested. /// - repositories_url: URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. /// - permissions: Permissions requested, categorized by type of permission. /// - access_granted_at: Date and time when the fine-grained personal access token was approved to access the organization. + /// - token_id: Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// - token_name: The name given to the user's token. This field can also be found in an organization's settings page for Active Tokens. /// - token_expired: Whether the associated fine-grained personal access token has expired. /// - token_expires_at: Date and time when the associated fine-grained personal access token expires. /// - token_last_used_at: Date and time when the associated fine-grained personal access token was last used for authentication. @@ -6698,6 +7323,8 @@ public enum Components { repositories_url: Swift.String, permissions: Components.Schemas.organization_hyphen_programmatic_hyphen_access_hyphen_grant.permissionsPayload, access_granted_at: Swift.String, + token_id: Swift.Int, + token_name: Swift.String, token_expired: Swift.Bool, token_expires_at: Swift.String? = nil, token_last_used_at: Swift.String? = nil @@ -6708,6 +7335,8 @@ public enum Components { self.repositories_url = repositories_url self.permissions = permissions self.access_granted_at = access_granted_at + self.token_id = token_id + self.token_name = token_name self.token_expired = token_expired self.token_expires_at = token_expires_at self.token_last_used_at = token_last_used_at @@ -6719,6 +7348,8 @@ public enum Components { case repositories_url case permissions case access_granted_at + case token_id + case token_name case token_expired case token_expires_at case token_last_used_at @@ -6736,6 +7367,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/custom-property/url`. public var url: Swift.String? + /// The source type of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property/source_type`. + @frozen public enum source_typePayload: String, Codable, Hashable, Sendable { + case organization = "organization" + case enterprise = "enterprise" + } + /// The source type of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property/source_type`. + public var source_type: Components.Schemas.custom_hyphen_property.source_typePayload? /// The type of the value for the property /// /// - Remark: Generated from `#/components/schemas/custom-property/value_type`. @@ -6819,6 +7461,7 @@ public enum Components { /// - Parameters: /// - property_name: The name of the property /// - url: The URL that can be used to fetch, update, or delete info about this property via the API. + /// - source_type: The source type of the property /// - value_type: The type of the value for the property /// - required: Whether the property is required. /// - default_value: Default value of the property @@ -6828,6 +7471,7 @@ public enum Components { public init( property_name: Swift.String, url: Swift.String? = nil, + source_type: Components.Schemas.custom_hyphen_property.source_typePayload? = nil, value_type: Components.Schemas.custom_hyphen_property.value_typePayload, required: Swift.Bool? = nil, default_value: Components.Schemas.custom_hyphen_property.default_valuePayload? = nil, @@ -6837,6 +7481,7 @@ public enum Components { ) { self.property_name = property_name self.url = url + self.source_type = source_type self.value_type = value_type self.required = required self.default_value = default_value @@ -6847,6 +7492,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case property_name case url + case source_type case value_type case required case default_value @@ -7012,6 +7658,61 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/hook-id`. public typealias hook_hyphen_id = Swift.Int + /// The type of the actor + /// + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The ID of the actor + /// + /// - Remark: Generated from `#/components/parameters/api-insights-actor-id`. + public typealias api_hyphen_insights_hyphen_actor_hyphen_id = Swift.Int + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-min-timestamp`. + public typealias api_hyphen_insights_hyphen_min_hyphen_timestamp = Swift.String + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-max-timestamp`. + public typealias api_hyphen_insights_hyphen_max_hyphen_timestamp = Swift.String + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case http_method = "http_method" + case api_route = "api_route" + case total_request_count = "total_request_count" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload] + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/components/parameters/api-insights-user-id`. + public typealias api_hyphen_insights_hyphen_user_hyphen_id = Swift.String + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/components/parameters/api-insights-timestamp-increment`. + public typealias api_hyphen_insights_hyphen_timestamp_hyphen_increment = Swift.String /// The unique identifier of the invitation. /// /// - Remark: Generated from `#/components/parameters/invitation-id`. @@ -7050,7 +7751,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/fine-grained-personal-access-token-id`. public typealias fine_hyphen_grained_hyphen_personal_hyphen_access_hyphen_token_hyphen_id = Swift.Int - /// The custom property name. The name is case sensitive. + /// The custom property name /// /// - Remark: Generated from `#/components/parameters/custom-property-name`. public typealias custom_hyphen_property_hyphen_name = Swift.String @@ -7699,10 +8400,10 @@ public enum Operations { /// Update an organization /// /// > [!WARNING] - /// > **Parameter deprecation notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). /// /// > [!WARNING] - /// > **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). /// /// Updates the organization's profile and member privileges. /// @@ -7812,7 +8513,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_repositories`. public var members_can_create_public_repositories: Swift.Bool? /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. /// /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. @frozen public enum members_allowed_repository_creation_typePayload: String, Codable, Hashable, Sendable { @@ -7821,7 +8522,7 @@ public enum Operations { case none = "none" } /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. /// /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. public var members_allowed_repository_creation_type: Operations.orgs_sol_update.Input.Body.jsonPayload.members_allowed_repository_creation_typePayload? @@ -7847,7 +8548,7 @@ public enum Operations { public var web_commit_signoff_required: Swift.Bool? /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/blog`. public var blog: Swift.String? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7858,7 +8559,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/advanced_security_enabled_for_new_repositories`. @available(*, deprecated) public var advanced_security_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7869,7 +8570,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_alerts_enabled_for_new_repositories`. @available(*, deprecated) public var dependabot_alerts_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7880,7 +8581,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_security_updates_enabled_for_new_repositories`. @available(*, deprecated) public var dependabot_security_updates_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7891,7 +8592,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependency_graph_enabled_for_new_repositories`. @available(*, deprecated) public var dependency_graph_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7902,7 +8603,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_enabled_for_new_repositories`. @available(*, deprecated) public var secret_scanning_enabled_for_new_repositories: Swift.Bool? - /// **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. /// @@ -7921,6 +8622,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link`. public var secret_scanning_push_protection_custom_link: Swift.String? + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/deploy_keys_enabled_for_repositories`. + public var deploy_keys_enabled_for_repositories: Swift.Bool? /// Creates a new `jsonPayload`. /// /// - Parameters: @@ -7945,14 +8650,15 @@ public enum Operations { /// - members_can_fork_private_repositories: Whether organization members can fork private organization repositories. /// - web_commit_signoff_required: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. /// - blog: - /// - advanced_security_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabot_alerts_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabot_security_updates_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependency_graph_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secret_scanning_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secret_scanning_push_protection_enabled_for_new_repositories: **Deprecated.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - advanced_security_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabot_alerts_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabot_security_updates_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependency_graph_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secret_scanning_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secret_scanning_push_protection_enabled_for_new_repositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. /// - secret_scanning_push_protection_custom_link_enabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. /// - secret_scanning_push_protection_custom_link: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// - deploy_keys_enabled_for_repositories: Controls whether or not deploy keys may be added and used for repositories in the organization. public init( billing_email: Swift.String? = nil, company: Swift.String? = nil, @@ -7982,7 +8688,8 @@ public enum Operations { secret_scanning_enabled_for_new_repositories: Swift.Bool? = nil, secret_scanning_push_protection_enabled_for_new_repositories: Swift.Bool? = nil, secret_scanning_push_protection_custom_link_enabled: Swift.Bool? = nil, - secret_scanning_push_protection_custom_link: Swift.String? = nil + secret_scanning_push_protection_custom_link: Swift.String? = nil, + deploy_keys_enabled_for_repositories: Swift.Bool? = nil ) { self.billing_email = billing_email self.company = company @@ -8013,6 +8720,7 @@ public enum Operations { self.secret_scanning_push_protection_enabled_for_new_repositories = secret_scanning_push_protection_enabled_for_new_repositories self.secret_scanning_push_protection_custom_link_enabled = secret_scanning_push_protection_custom_link_enabled self.secret_scanning_push_protection_custom_link = secret_scanning_push_protection_custom_link + self.deploy_keys_enabled_for_repositories = deploy_keys_enabled_for_repositories } public enum CodingKeys: String, CodingKey { case billing_email @@ -8044,6 +8752,7 @@ public enum Operations { case secret_scanning_push_protection_enabled_for_new_repositories case secret_scanning_push_protection_custom_link_enabled case secret_scanning_push_protection_custom_link + case deploy_keys_enabled_for_repositories } } /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/content/application\/json`. @@ -10934,22 +11643,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.orgs_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query @@ -11319,139 +12023,1761 @@ public enum Operations { } } } - /// Redeliver a delivery for an organization webhook - /// - /// Redeliver a delivery for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Redeliver a delivery for an organization webhook + /// + /// Redeliver a delivery for a webhook configured in an organization. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. + public enum orgs_sol_redeliver_hyphen_webhook_hyphen_delivery { + public static let id: Swift.String = "orgs/redeliver-webhook-delivery" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. + public var hook_id: Components.Parameters.hook_hyphen_id + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. + public var delivery_id: Components.Parameters.delivery_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - hook_id: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - delivery_id: + public init( + org: Components.Parameters.org, + hook_id: Components.Parameters.hook_hyphen_id, + delivery_id: Components.Parameters.delivery_hyphen_id + ) { + self.org = org + self.hook_id = hook_id + self.delivery_id = delivery_id + } + } + public var path: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Path, + headers: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.bad_request) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case application_scim_plus_json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .application_scim_plus_json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .application_scim_plus_json: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .application_scim_plus_json + ] + } + } + } + /// Ping an organization webhook + /// + /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) + /// to be sent to the hook. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. + public enum orgs_sol_ping_hyphen_webhook { + public static let id: Swift.String = "orgs/ping-webhook" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. + public var hook_id: Components.Parameters.hook_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - hook_id: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + public init( + org: Components.Parameters.org, + hook_id: Components.Parameters.hook_hyphen_id + ) { + self.org = org + self.hook_id = hook_id + } + } + public var path: Operations.orgs_sol_ping_hyphen_webhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.orgs_sol_ping_hyphen_webhook.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.orgs_sol_ping_hyphen_webhook.Input.Path, + headers: Operations.orgs_sol_ping_hyphen_webhook.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.orgs_sol_ping_hyphen_webhook.Output.NoContent) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.orgs_sol_ping_hyphen_webhook.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-route-stats-by-actor" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. + public var org: Components.Parameters.org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor + public init( + org: Components.Parameters.org, + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + ) { + self.org = org + self.actor_type = actor_type + self.actor_id = actor_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case http_method = "http_method" + case api_route = "api_route" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats { + public static let id: Swift.String = "api-insights/get-subject-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats { + public static let id: Swift.String = "api-insights/get-summary-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user { + public static let id: Swift.String = "api-insights/get-summary-stats-by-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - user_id: The ID of the user to query for stats + public init( + org: Components.Parameters.org, + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + ) { + self.org = org + self.user_id = user_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. + public var org: Components.Parameters.org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor + public init( + org: Components.Parameters.org, + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + ) { + self.org = org + self.actor_type = actor_type + self.actor_id = actor_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats { + public static let id: Swift.String = "api-insights/get-time-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path/org`. + public var org: Components.Parameters.org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.org) { + self.org = org + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user { + public static let id: Swift.String = "api-insights/get-time-stats-by-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - user_id: The ID of the user to query for stats + public init( + org: Components.Parameters.org, + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + ) { + self.org = org + self.user_id = user_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats by actor /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. - public enum orgs_sol_redeliver_hyphen_webhook_hyphen_delivery { - public static let id: Swift.String = "orgs/redeliver-webhook-delivery" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-time-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. - public var hook_id: Components.Parameters.hook_hyphen_id - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. - public var delivery_id: Components.Parameters.delivery_hyphen_id + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hook_id: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - delivery_id: + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor public init( org: Components.Parameters.org, - hook_id: Components.Parameters.hook_hyphen_id, - delivery_id: Components.Parameters.delivery_hyphen_id + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id ) { self.org = org - self.hook_id = hook_id - self.delivery_id = delivery_id + self.actor_type = actor_type + self.actor_id = actor_id } } - public var path: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. + public var path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Headers + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Path, - headers: Operations.orgs_sol_redeliver_hyphen_webhook_hyphen_delivery.Input.Headers = .init() + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Accepted - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. - /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.accepted) - /// The associated value of the enum case if `self` is `.accepted`. - /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.accepted { - get throws { - switch self { - case let .accepted(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "accepted", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } } } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.bad_request) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.bad_request { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.validation_failed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.validation_failed { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { get throws { switch self { - case let .unprocessableContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "ok", response: self ) } @@ -11464,14 +13790,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case application_scim_plus_json case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .application_scim_plus_json default: self = .other(rawValue) } @@ -11482,128 +13805,190 @@ public enum Operations { return string case .json: return "application/json" - case .application_scim_plus_json: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .application_scim_plus_json + .json ] } } } - /// Ping an organization webhook - /// - /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) - /// to be sent to the hook. - /// - /// You must be an organization owner to use this endpoint. + /// Get user stats /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API usage statistics within an organization for a user broken down by the type of access. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. - public enum orgs_sol_ping_hyphen_webhook { - public static let id: Swift.String = "orgs/ping-webhook" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_user_hyphen_stats { + public static let id: Swift.String = "api-insights/get-user-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. public var org: Components.Parameters.org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// The ID of the user to query for stats /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. - public var hook_id: Components.Parameters.hook_hyphen_id + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hook_id: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - user_id: The ID of the user to query for stats public init( org: Components.Parameters.org, - hook_id: Components.Parameters.hook_hyphen_id + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id ) { self.org = org - self.hook_id = hook_id + self.user_id = user_id } } - public var path: Operations.orgs_sol_ping_hyphen_webhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. + public var path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - max_timestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp? = nil, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.orgs_sol_ping_hyphen_webhook.Input.Headers + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.orgs_sol_ping_hyphen_webhook.Input.Path, - headers: Operations.orgs_sol_ping_hyphen_webhook.Input.Headers = .init() + path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.orgs_sol_ping_hyphen_webhook.Output.NoContent) - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.orgs_sol_ping_hyphen_webhook.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_stats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok.Body) { + self.body = body + } } - /// Resource not found + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.not_found) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.not_found { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -18497,7 +20882,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/org`. public var org: Components.Parameters.org - /// The custom property name. The name is case sensitive. + /// The custom property name /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/custom_property_name`. public var custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -18505,7 +20890,7 @@ public enum Operations { /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - custom_property_name: The custom property name. The name is case sensitive. + /// - custom_property_name: The custom property name public init( org: Components.Parameters.org, custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -18688,7 +21073,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/org`. public var org: Components.Parameters.org - /// The custom property name. The name is case sensitive. + /// The custom property name /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/custom_property_name`. public var custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -18696,7 +21081,7 @@ public enum Operations { /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - custom_property_name: The custom property name. The name is case sensitive. + /// - custom_property_name: The custom property name public init( org: Components.Parameters.org, custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -18986,7 +21371,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/org`. public var org: Components.Parameters.org - /// The custom property name. The name is case sensitive. + /// The custom property name /// /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/custom_property_name`. public var custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -18994,7 +21379,7 @@ public enum Operations { /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - custom_property_name: The custom property name. The name is case sensitive. + /// - custom_property_name: The custom property name public init( org: Components.Parameters.org, custom_property_name: Components.Parameters.custom_hyphen_property_hyphen_name @@ -20378,13 +22763,13 @@ public enum Operations { /// Enable or disable a security feature for an organization /// /// > [!WARNING] - /// > **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). + /// > **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/). /// /// Enables or disables the specified security feature for all eligible repositories in an organization. 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)." /// /// The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. /// /// - Remark: HTTP `POST /orgs/{org}/{security_product}/{enablement}`. /// - Remark: Generated from `#/paths//orgs/{org}/{security_product}/{enablement}/post(orgs/enable-or-disable-security-product-on-all-org-repos)`. @@ -21227,6 +23612,9 @@ public enum Operations { /// /// For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. /// + /// > [!NOTE] + /// > Requests using a fine-grained access token will receive a `200 Success` response with an empty list. + /// /// - Remark: HTTP `GET /user/orgs`. /// - Remark: Generated from `#/paths//user/orgs/get(orgs/list-for-authenticated-user)`. public enum orgs_sol_list_hyphen_for_hyphen_authenticated_hyphen_user { diff --git a/Sources/packages/Client.swift b/Sources/packages/Client.swift index 05b645285f8..e5046653064 100644 --- a/Sources/packages/Client.swift +++ b/Sources/packages/Client.swift @@ -152,7 +152,7 @@ public struct Client: APIProtocol { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -292,7 +292,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -362,7 +362,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -482,7 +482,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -603,7 +603,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -758,7 +758,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -829,7 +829,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -950,7 +950,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -1129,7 +1129,7 @@ public struct Client: APIProtocol { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -1223,7 +1223,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -1290,7 +1290,7 @@ public struct Client: APIProtocol { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -1407,7 +1407,7 @@ public struct Client: APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -1527,7 +1527,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -1681,7 +1681,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -1751,7 +1751,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -1869,7 +1869,7 @@ public struct Client: APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -2093,7 +2093,7 @@ public struct Client: APIProtocol { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -2233,7 +2233,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -2303,7 +2303,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -2423,7 +2423,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -2544,7 +2544,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -2678,7 +2678,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -2749,7 +2749,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -2870,7 +2870,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 097e4b06541..d3603767eed 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -24,7 +24,7 @@ public protocol APIProtocol: Sendable { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -33,7 +33,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -44,7 +44,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -59,7 +59,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -68,7 +68,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -77,7 +77,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -88,7 +88,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -103,7 +103,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -121,7 +121,7 @@ public protocol APIProtocol: Sendable { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -130,7 +130,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -139,7 +139,7 @@ public protocol APIProtocol: Sendable { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -152,7 +152,7 @@ public protocol APIProtocol: Sendable { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -161,7 +161,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -170,7 +170,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -181,7 +181,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -194,7 +194,7 @@ public protocol APIProtocol: Sendable { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -212,7 +212,7 @@ public protocol APIProtocol: Sendable { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -221,7 +221,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -232,7 +232,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -247,7 +247,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -256,7 +256,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -265,7 +265,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -276,7 +276,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -291,7 +291,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. @@ -321,7 +321,7 @@ extension APIProtocol { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -340,7 +340,7 @@ extension APIProtocol { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -359,7 +359,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -382,7 +382,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -401,7 +401,7 @@ extension APIProtocol { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -420,7 +420,7 @@ extension APIProtocol { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -439,7 +439,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -462,7 +462,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -490,7 +490,7 @@ extension APIProtocol { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -507,7 +507,7 @@ extension APIProtocol { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -524,7 +524,7 @@ extension APIProtocol { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -545,7 +545,7 @@ extension APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -564,7 +564,7 @@ extension APIProtocol { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -583,7 +583,7 @@ extension APIProtocol { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -602,7 +602,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -623,7 +623,7 @@ extension APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -657,7 +657,7 @@ extension APIProtocol { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -676,7 +676,7 @@ extension APIProtocol { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -695,7 +695,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -718,7 +718,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -737,7 +737,7 @@ extension APIProtocol { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -754,7 +754,7 @@ extension APIProtocol { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -773,7 +773,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -796,7 +796,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. @@ -871,6 +871,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -895,6 +897,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -916,7 +919,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -939,6 +943,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -962,6 +967,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1047,6 +1053,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1071,6 +1079,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1092,7 +1101,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1115,6 +1125,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1138,6 +1149,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Code Of Conduct @@ -1303,6 +1315,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -1311,18 +1345,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -1330,6 +1367,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -2534,7 +2572,7 @@ public enum Operations { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -2796,7 +2834,7 @@ public enum Operations { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -2957,7 +2995,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -3167,7 +3205,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -3389,7 +3427,7 @@ public enum Operations { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -3656,7 +3694,7 @@ public enum Operations { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -3824,7 +3862,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -4041,7 +4079,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -4366,7 +4404,7 @@ public enum Operations { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -4564,7 +4602,7 @@ public enum Operations { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -4716,7 +4754,7 @@ public enum Operations { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -4917,7 +4955,7 @@ public enum Operations { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -5132,7 +5170,7 @@ public enum Operations { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -5392,7 +5430,7 @@ public enum Operations { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -5553,7 +5591,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -5761,7 +5799,7 @@ public enum Operations { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -6145,7 +6183,7 @@ public enum Operations { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -6407,7 +6445,7 @@ public enum Operations { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -6568,7 +6606,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -6778,7 +6816,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -7000,7 +7038,7 @@ public enum Operations { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -7228,7 +7266,7 @@ public enum Operations { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -7396,7 +7434,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -7613,7 +7651,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. diff --git a/Sources/private-registries/Client.swift b/Sources/private-registries/Client.swift new file mode 100644 index 00000000000..87202523ac7 --- /dev/null +++ b/Sources/private-registries/Client.swift @@ -0,0 +1,41 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +import HTTPTypes +/// GitHub's v3 REST API. +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } +} diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift new file mode 100644 index 00000000000..2a210decbff --- /dev/null +++ b/Sources/private-registries/Types.swift @@ -0,0 +1,44 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable {} + +/// Convenience overloads for operation inputs. +extension APIProtocol { +} + +/// Server URLs defined in the OpenAPI document. +public enum Servers { + public static func server1() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } +} + +/// Types generated from the components section of the OpenAPI document. +public enum Components { + /// Types generated from the `#/components/schemas` section of the OpenAPI document. + public enum Schemas {} + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters {} + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses {} + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers {} +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations {} diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 1cb1cfdeb73..aa7bc1787d7 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -659,6 +659,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -683,6 +685,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -704,7 +707,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -727,6 +731,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -750,6 +755,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -866,6 +872,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -890,6 +898,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -911,7 +920,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -934,6 +944,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -957,6 +968,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error diff --git a/Sources/pulls/Client.swift b/Sources/pulls/Client.swift index 0d806b85bb7..a591521912a 100644 --- a/Sources/pulls/Client.swift +++ b/Sources/pulls/Client.swift @@ -1126,7 +1126,7 @@ public struct Client: APIProtocol { /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -3094,6 +3094,7 @@ public struct Client: APIProtocol { /// Update a pull request branch /// /// Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + /// Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/update-branch/put(pulls/update-branch)`. diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 981a93264fc..e5378774f36 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -165,7 +165,7 @@ public protocol APIProtocol: Sendable { /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -394,6 +394,7 @@ public protocol APIProtocol: Sendable { /// Update a pull request branch /// /// Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + /// Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/update-branch/put(pulls/update-branch)`. @@ -640,7 +641,7 @@ extension APIProtocol { /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -1025,6 +1026,7 @@ extension APIProtocol { /// Update a pull request branch /// /// Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + /// Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/update-branch/put(pulls/update-branch)`. @@ -1101,6 +1103,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -1125,6 +1129,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1146,7 +1151,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1169,6 +1175,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1192,6 +1199,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1308,6 +1316,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1332,6 +1342,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1353,7 +1364,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1376,6 +1388,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1399,6 +1412,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1823,7 +1837,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -2011,7 +2025,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -3846,11 +3860,11 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/path`. public var path: Swift.String - /// The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. + /// The line index in the diff to which the comment applies. This field is closing down; use `line` instead. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/position`. public var position: Swift.Int? - /// The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + /// The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. /// /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_position`. public var original_position: Swift.Int? @@ -4026,8 +4040,8 @@ public enum Components { /// - node_id: The node ID of the pull request review comment. /// - diff_hunk: The diff of the line that the comment refers to. /// - path: The relative path of the file to which the comment applies. - /// - position: The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. - /// - original_position: The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + /// - position: The line index in the diff to which the comment applies. This field is closing down; use `line` instead. + /// - original_position: The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. /// - commit_id: The SHA of the commit to which the comment applies. /// - original_commit_id: The SHA of the original commit to which the comment applies. /// - in_reply_to_id: The comment ID to reply to. @@ -4281,854 +4295,11 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/pull-request/head/ref`. public var ref: Swift.String /// - Remark: Generated from `#/components/schemas/pull-request/head/repo`. - public struct repoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/archive_url`. - public var archive_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/assignees_url`. - public var assignees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/blobs_url`. - public var blobs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/branches_url`. - public var branches_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/collaborators_url`. - public var collaborators_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/comments_url`. - public var comments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/commits_url`. - public var commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/compare_url`. - public var compare_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/contents_url`. - public var contents_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/contributors_url`. - public var contributors_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/deployments_url`. - public var deployments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/downloads_url`. - public var downloads_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/forks_url`. - public var forks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/git_commits_url`. - public var git_commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/git_refs_url`. - public var git_refs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/git_tags_url`. - public var git_tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/issue_comment_url`. - public var issue_comment_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/issue_events_url`. - public var issue_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/keys_url`. - public var keys_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/languages_url`. - public var languages_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/merges_url`. - public var merges_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/milestones_url`. - public var milestones_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/notifications_url`. - public var notifications_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner`. - public struct ownerPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/site_admin`. - public var site_admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner/url`. - public var url: Swift.String - /// Creates a new `ownerPayload`. - /// - /// - Parameters: - /// - avatar_url: - /// - events_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - gravatar_id: - /// - html_url: - /// - id: - /// - node_id: - /// - login: - /// - organizations_url: - /// - received_events_url: - /// - repos_url: - /// - site_admin: - /// - starred_url: - /// - subscriptions_url: - /// - _type: - /// - url: - public init( - avatar_url: Swift.String, - events_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - gravatar_id: Swift.String? = nil, - html_url: Swift.String, - id: Swift.Int, - node_id: Swift.String, - login: Swift.String, - organizations_url: Swift.String, - received_events_url: Swift.String, - repos_url: Swift.String, - site_admin: Swift.Bool, - starred_url: Swift.String, - subscriptions_url: Swift.String, - _type: Swift.String, - url: Swift.String - ) { - self.avatar_url = avatar_url - self.events_url = events_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.gravatar_id = gravatar_id - self.html_url = html_url - self.id = id - self.node_id = node_id - self.login = login - self.organizations_url = organizations_url - self.received_events_url = received_events_url - self.repos_url = repos_url - self.site_admin = site_admin - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self._type = _type - self.url = url - } - public enum CodingKeys: String, CodingKey { - case avatar_url - case events_url - case followers_url - case following_url - case gists_url - case gravatar_id - case html_url - case id - case node_id - case login - case organizations_url - case received_events_url - case repos_url - case site_admin - case starred_url - case subscriptions_url - case _type = "type" - case url - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/owner`. - public var owner: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.ownerPayload - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/pulls_url`. - public var pulls_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/releases_url`. - public var releases_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/stargazers_url`. - public var stargazers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/statuses_url`. - public var statuses_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/subscribers_url`. - public var subscribers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/subscription_url`. - public var subscription_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/tags_url`. - public var tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/teams_url`. - public var teams_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/trees_url`. - public var trees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/clone_url`. - public var clone_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/default_branch`. - public var default_branch: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/forks`. - public var forks: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/forks_count`. - public var forks_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/git_url`. - public var git_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_downloads`. - public var has_downloads: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_issues`. - public var has_issues: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_projects`. - public var has_projects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_wiki`. - public var has_wiki: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_pages`. - public var has_pages: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/has_discussions`. - public var has_discussions: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/homepage`. - public var homepage: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/language`. - public var language: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/master_branch`. - public var master_branch: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/archived`. - public var archived: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/disabled`. - public var disabled: Swift.Bool - /// The repository visibility: public, private, or internal. - /// - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/visibility`. - public var visibility: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/mirror_url`. - public var mirror_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/open_issues`. - public var open_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/open_issues_count`. - public var open_issues_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions/admin`. - public var admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions/pull`. - public var pull: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - admin: - /// - maintain: - /// - push: - /// - triage: - /// - pull: - public init( - admin: Swift.Bool, - maintain: Swift.Bool? = nil, - push: Swift.Bool, - triage: Swift.Bool? = nil, - pull: Swift.Bool - ) { - self.admin = admin - self.maintain = maintain - self.push = push - self.triage = triage - self.pull = pull - } - public enum CodingKeys: String, CodingKey { - case admin - case maintain - case push - case triage - case pull - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/permissions`. - public var permissions: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/temp_clone_token`. - public var temp_clone_token: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/allow_merge_commit`. - public var allow_merge_commit: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/allow_squash_merge`. - public var allow_squash_merge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/allow_rebase_merge`. - public var allow_rebase_merge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license`. - public struct licensePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license/key`. - public var key: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license/spdx_id`. - public var spdx_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license/node_id`. - public var node_id: Swift.String - /// Creates a new `licensePayload`. - /// - /// - Parameters: - /// - key: - /// - name: - /// - url: - /// - spdx_id: - /// - node_id: - public init( - key: Swift.String, - name: Swift.String, - url: Swift.String? = nil, - spdx_id: Swift.String? = nil, - node_id: Swift.String - ) { - self.key = key - self.name = name - self.url = url - self.spdx_id = spdx_id - self.node_id = node_id - } - public enum CodingKeys: String, CodingKey { - case key - case name - case url - case spdx_id - case node_id - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/license`. - public var license: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.licensePayload? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/pushed_at`. - public var pushed_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/size`. - public var size: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/ssh_url`. - public var ssh_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/stargazers_count`. - public var stargazers_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/svn_url`. - public var svn_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/topics`. - public var topics: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/watchers`. - public var watchers: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/watchers_count`. - public var watchers_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/allow_forking`. - public var allow_forking: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/is_template`. - public var is_template: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo/web_commit_signoff_required`. - public var web_commit_signoff_required: Swift.Bool? - /// Creates a new `repoPayload`. - /// - /// - Parameters: - /// - archive_url: - /// - assignees_url: - /// - blobs_url: - /// - branches_url: - /// - collaborators_url: - /// - comments_url: - /// - commits_url: - /// - compare_url: - /// - contents_url: - /// - contributors_url: - /// - deployments_url: - /// - description: - /// - downloads_url: - /// - events_url: - /// - fork: - /// - forks_url: - /// - full_name: - /// - git_commits_url: - /// - git_refs_url: - /// - git_tags_url: - /// - hooks_url: - /// - html_url: - /// - id: - /// - node_id: - /// - issue_comment_url: - /// - issue_events_url: - /// - issues_url: - /// - keys_url: - /// - labels_url: - /// - languages_url: - /// - merges_url: - /// - milestones_url: - /// - name: - /// - notifications_url: - /// - owner: - /// - _private: - /// - pulls_url: - /// - releases_url: - /// - stargazers_url: - /// - statuses_url: - /// - subscribers_url: - /// - subscription_url: - /// - tags_url: - /// - teams_url: - /// - trees_url: - /// - url: - /// - clone_url: - /// - default_branch: - /// - forks: - /// - forks_count: - /// - git_url: - /// - has_downloads: - /// - has_issues: - /// - has_projects: - /// - has_wiki: - /// - has_pages: - /// - has_discussions: - /// - homepage: - /// - language: - /// - master_branch: - /// - archived: - /// - disabled: - /// - visibility: The repository visibility: public, private, or internal. - /// - mirror_url: - /// - open_issues: - /// - open_issues_count: - /// - permissions: - /// - temp_clone_token: - /// - allow_merge_commit: - /// - allow_squash_merge: - /// - allow_rebase_merge: - /// - license: - /// - pushed_at: - /// - size: - /// - ssh_url: - /// - stargazers_count: - /// - svn_url: - /// - topics: - /// - watchers: - /// - watchers_count: - /// - created_at: - /// - updated_at: - /// - allow_forking: - /// - is_template: - /// - web_commit_signoff_required: - public init( - archive_url: Swift.String, - assignees_url: Swift.String, - blobs_url: Swift.String, - branches_url: Swift.String, - collaborators_url: Swift.String, - comments_url: Swift.String, - commits_url: Swift.String, - compare_url: Swift.String, - contents_url: Swift.String, - contributors_url: Swift.String, - deployments_url: Swift.String, - description: Swift.String? = nil, - downloads_url: Swift.String, - events_url: Swift.String, - fork: Swift.Bool, - forks_url: Swift.String, - full_name: Swift.String, - git_commits_url: Swift.String, - git_refs_url: Swift.String, - git_tags_url: Swift.String, - hooks_url: Swift.String, - html_url: Swift.String, - id: Swift.Int, - node_id: Swift.String, - issue_comment_url: Swift.String, - issue_events_url: Swift.String, - issues_url: Swift.String, - keys_url: Swift.String, - labels_url: Swift.String, - languages_url: Swift.String, - merges_url: Swift.String, - milestones_url: Swift.String, - name: Swift.String, - notifications_url: Swift.String, - owner: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.ownerPayload, - _private: Swift.Bool, - pulls_url: Swift.String, - releases_url: Swift.String, - stargazers_url: Swift.String, - statuses_url: Swift.String, - subscribers_url: Swift.String, - subscription_url: Swift.String, - tags_url: Swift.String, - teams_url: Swift.String, - trees_url: Swift.String, - url: Swift.String, - clone_url: Swift.String, - default_branch: Swift.String, - forks: Swift.Int, - forks_count: Swift.Int, - git_url: Swift.String, - has_downloads: Swift.Bool, - has_issues: Swift.Bool, - has_projects: Swift.Bool, - has_wiki: Swift.Bool, - has_pages: Swift.Bool, - has_discussions: Swift.Bool, - homepage: Swift.String? = nil, - language: Swift.String? = nil, - master_branch: Swift.String? = nil, - archived: Swift.Bool, - disabled: Swift.Bool, - visibility: Swift.String? = nil, - mirror_url: Swift.String? = nil, - open_issues: Swift.Int, - open_issues_count: Swift.Int, - permissions: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.permissionsPayload? = nil, - temp_clone_token: Swift.String? = nil, - allow_merge_commit: Swift.Bool? = nil, - allow_squash_merge: Swift.Bool? = nil, - allow_rebase_merge: Swift.Bool? = nil, - license: Components.Schemas.pull_hyphen_request.headPayload.repoPayload.licensePayload? = nil, - pushed_at: Foundation.Date, - size: Swift.Int, - ssh_url: Swift.String, - stargazers_count: Swift.Int, - svn_url: Swift.String, - topics: [Swift.String]? = nil, - watchers: Swift.Int, - watchers_count: Swift.Int, - created_at: Foundation.Date, - updated_at: Foundation.Date, - allow_forking: Swift.Bool? = nil, - is_template: Swift.Bool? = nil, - web_commit_signoff_required: Swift.Bool? = nil - ) { - self.archive_url = archive_url - self.assignees_url = assignees_url - self.blobs_url = blobs_url - self.branches_url = branches_url - self.collaborators_url = collaborators_url - self.comments_url = comments_url - self.commits_url = commits_url - self.compare_url = compare_url - self.contents_url = contents_url - self.contributors_url = contributors_url - self.deployments_url = deployments_url - self.description = description - self.downloads_url = downloads_url - self.events_url = events_url - self.fork = fork - self.forks_url = forks_url - self.full_name = full_name - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - self.hooks_url = hooks_url - self.html_url = html_url - self.id = id - self.node_id = node_id - self.issue_comment_url = issue_comment_url - self.issue_events_url = issue_events_url - self.issues_url = issues_url - self.keys_url = keys_url - self.labels_url = labels_url - self.languages_url = languages_url - self.merges_url = merges_url - self.milestones_url = milestones_url - self.name = name - self.notifications_url = notifications_url - self.owner = owner - self._private = _private - self.pulls_url = pulls_url - self.releases_url = releases_url - self.stargazers_url = stargazers_url - self.statuses_url = statuses_url - self.subscribers_url = subscribers_url - self.subscription_url = subscription_url - self.tags_url = tags_url - self.teams_url = teams_url - self.trees_url = trees_url - self.url = url - self.clone_url = clone_url - self.default_branch = default_branch - self.forks = forks - self.forks_count = forks_count - self.git_url = git_url - self.has_downloads = has_downloads - self.has_issues = has_issues - self.has_projects = has_projects - self.has_wiki = has_wiki - self.has_pages = has_pages - self.has_discussions = has_discussions - self.homepage = homepage - self.language = language - self.master_branch = master_branch - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.mirror_url = mirror_url - self.open_issues = open_issues - self.open_issues_count = open_issues_count - self.permissions = permissions - self.temp_clone_token = temp_clone_token - self.allow_merge_commit = allow_merge_commit - self.allow_squash_merge = allow_squash_merge - self.allow_rebase_merge = allow_rebase_merge - self.license = license - self.pushed_at = pushed_at - self.size = size - self.ssh_url = ssh_url - self.stargazers_count = stargazers_count - self.svn_url = svn_url - self.topics = topics - self.watchers = watchers - self.watchers_count = watchers_count - self.created_at = created_at - self.updated_at = updated_at - self.allow_forking = allow_forking - self.is_template = is_template - self.web_commit_signoff_required = web_commit_signoff_required - } - public enum CodingKeys: String, CodingKey { - case archive_url - case assignees_url - case blobs_url - case branches_url - case collaborators_url - case comments_url - case commits_url - case compare_url - case contents_url - case contributors_url - case deployments_url - case description - case downloads_url - case events_url - case fork - case forks_url - case full_name - case git_commits_url - case git_refs_url - case git_tags_url - case hooks_url - case html_url - case id - case node_id - case issue_comment_url - case issue_events_url - case issues_url - case keys_url - case labels_url - case languages_url - case merges_url - case milestones_url - case name - case notifications_url - case owner - case _private = "private" - case pulls_url - case releases_url - case stargazers_url - case statuses_url - case subscribers_url - case subscription_url - case tags_url - case teams_url - case trees_url - case url - case clone_url - case default_branch - case forks - case forks_count - case git_url - case has_downloads - case has_issues - case has_projects - case has_wiki - case has_pages - case has_discussions - case homepage - case language - case master_branch - case archived - case disabled - case visibility - case mirror_url - case open_issues - case open_issues_count - case permissions - case temp_clone_token - case allow_merge_commit - case allow_squash_merge - case allow_rebase_merge - case license - case pushed_at - case size - case ssh_url - case stargazers_count - case svn_url - case topics - case watchers - case watchers_count - case created_at - case updated_at - case allow_forking - case is_template - case web_commit_signoff_required - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/head/repo`. - public var repo: Components.Schemas.pull_hyphen_request.headPayload.repoPayload? + public var repo: Components.Schemas.repository /// - Remark: Generated from `#/components/schemas/pull-request/head/sha`. public var sha: Swift.String /// - Remark: Generated from `#/components/schemas/pull-request/head/user`. - public struct userPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/site_admin`. - public var site_admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/head/user/url`. - public var url: Swift.String - /// Creates a new `userPayload`. - /// - /// - Parameters: - /// - avatar_url: - /// - events_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - gravatar_id: - /// - html_url: - /// - id: - /// - node_id: - /// - login: - /// - organizations_url: - /// - received_events_url: - /// - repos_url: - /// - site_admin: - /// - starred_url: - /// - subscriptions_url: - /// - _type: - /// - url: - public init( - avatar_url: Swift.String, - events_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - gravatar_id: Swift.String? = nil, - html_url: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - login: Swift.String, - organizations_url: Swift.String, - received_events_url: Swift.String, - repos_url: Swift.String, - site_admin: Swift.Bool, - starred_url: Swift.String, - subscriptions_url: Swift.String, - _type: Swift.String, - url: Swift.String - ) { - self.avatar_url = avatar_url - self.events_url = events_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.gravatar_id = gravatar_id - self.html_url = html_url - self.id = id - self.node_id = node_id - self.login = login - self.organizations_url = organizations_url - self.received_events_url = received_events_url - self.repos_url = repos_url - self.site_admin = site_admin - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self._type = _type - self.url = url - } - public enum CodingKeys: String, CodingKey { - case avatar_url - case events_url - case followers_url - case following_url - case gists_url - case gravatar_id - case html_url - case id - case node_id - case login - case organizations_url - case received_events_url - case repos_url - case site_admin - case starred_url - case subscriptions_url - case _type = "type" - case url - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/head/user`. - public var user: Components.Schemas.pull_hyphen_request.headPayload.userPayload + public var user: Components.Schemas.simple_hyphen_user /// Creates a new `headPayload`. /// /// - Parameters: @@ -5140,9 +4311,9 @@ public enum Components { public init( label: Swift.String, ref: Swift.String, - repo: Components.Schemas.pull_hyphen_request.headPayload.repoPayload? = nil, + repo: Components.Schemas.repository, sha: Swift.String, - user: Components.Schemas.pull_hyphen_request.headPayload.userPayload + user: Components.Schemas.simple_hyphen_user ) { self.label = label self.ref = ref @@ -5167,813 +4338,11 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/pull-request/base/ref`. public var ref: Swift.String /// - Remark: Generated from `#/components/schemas/pull-request/base/repo`. - public struct repoPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/archive_url`. - public var archive_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/assignees_url`. - public var assignees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/blobs_url`. - public var blobs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/branches_url`. - public var branches_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/collaborators_url`. - public var collaborators_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/comments_url`. - public var comments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/commits_url`. - public var commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/compare_url`. - public var compare_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/contents_url`. - public var contents_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/contributors_url`. - public var contributors_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/deployments_url`. - public var deployments_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/downloads_url`. - public var downloads_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/fork`. - public var fork: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/forks_url`. - public var forks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/git_commits_url`. - public var git_commits_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/git_refs_url`. - public var git_refs_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/git_tags_url`. - public var git_tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/is_template`. - public var is_template: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/issue_comment_url`. - public var issue_comment_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/issue_events_url`. - public var issue_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/keys_url`. - public var keys_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/languages_url`. - public var languages_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/merges_url`. - public var merges_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/milestones_url`. - public var milestones_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/notifications_url`. - public var notifications_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner`. - public struct ownerPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/site_admin`. - public var site_admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner/url`. - public var url: Swift.String - /// Creates a new `ownerPayload`. - /// - /// - Parameters: - /// - avatar_url: - /// - events_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - gravatar_id: - /// - html_url: - /// - id: - /// - node_id: - /// - login: - /// - organizations_url: - /// - received_events_url: - /// - repos_url: - /// - site_admin: - /// - starred_url: - /// - subscriptions_url: - /// - _type: - /// - url: - public init( - avatar_url: Swift.String, - events_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - gravatar_id: Swift.String? = nil, - html_url: Swift.String, - id: Swift.Int, - node_id: Swift.String, - login: Swift.String, - organizations_url: Swift.String, - received_events_url: Swift.String, - repos_url: Swift.String, - site_admin: Swift.Bool, - starred_url: Swift.String, - subscriptions_url: Swift.String, - _type: Swift.String, - url: Swift.String - ) { - self.avatar_url = avatar_url - self.events_url = events_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.gravatar_id = gravatar_id - self.html_url = html_url - self.id = id - self.node_id = node_id - self.login = login - self.organizations_url = organizations_url - self.received_events_url = received_events_url - self.repos_url = repos_url - self.site_admin = site_admin - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self._type = _type - self.url = url - } - public enum CodingKeys: String, CodingKey { - case avatar_url - case events_url - case followers_url - case following_url - case gists_url - case gravatar_id - case html_url - case id - case node_id - case login - case organizations_url - case received_events_url - case repos_url - case site_admin - case starred_url - case subscriptions_url - case _type = "type" - case url - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/owner`. - public var owner: Components.Schemas.pull_hyphen_request.basePayload.repoPayload.ownerPayload - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/private`. - public var _private: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/pulls_url`. - public var pulls_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/releases_url`. - public var releases_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/stargazers_url`. - public var stargazers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/statuses_url`. - public var statuses_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/subscribers_url`. - public var subscribers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/subscription_url`. - public var subscription_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/tags_url`. - public var tags_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/teams_url`. - public var teams_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/trees_url`. - public var trees_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/clone_url`. - public var clone_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/default_branch`. - public var default_branch: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/forks`. - public var forks: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/forks_count`. - public var forks_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/git_url`. - public var git_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_downloads`. - public var has_downloads: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_issues`. - public var has_issues: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_projects`. - public var has_projects: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_wiki`. - public var has_wiki: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_pages`. - public var has_pages: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/has_discussions`. - public var has_discussions: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/homepage`. - public var homepage: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/language`. - public var language: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/master_branch`. - public var master_branch: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/archived`. - public var archived: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/disabled`. - public var disabled: Swift.Bool - /// The repository visibility: public, private, or internal. - /// - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/visibility`. - public var visibility: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/mirror_url`. - public var mirror_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/open_issues`. - public var open_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/open_issues_count`. - public var open_issues_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions/admin`. - public var admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions/maintain`. - public var maintain: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions/triage`. - public var triage: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions/pull`. - public var pull: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - admin: - /// - maintain: - /// - push: - /// - triage: - /// - pull: - public init( - admin: Swift.Bool, - maintain: Swift.Bool? = nil, - push: Swift.Bool, - triage: Swift.Bool? = nil, - pull: Swift.Bool - ) { - self.admin = admin - self.maintain = maintain - self.push = push - self.triage = triage - self.pull = pull - } - public enum CodingKeys: String, CodingKey { - case admin - case maintain - case push - case triage - case pull - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/permissions`. - public var permissions: Components.Schemas.pull_hyphen_request.basePayload.repoPayload.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/temp_clone_token`. - public var temp_clone_token: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/allow_merge_commit`. - public var allow_merge_commit: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/allow_squash_merge`. - public var allow_squash_merge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/allow_rebase_merge`. - public var allow_rebase_merge: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/license`. - public var license: Components.Schemas.nullable_hyphen_license_hyphen_simple? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/pushed_at`. - public var pushed_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/size`. - public var size: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/ssh_url`. - public var ssh_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/stargazers_count`. - public var stargazers_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/svn_url`. - public var svn_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/topics`. - public var topics: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/watchers`. - public var watchers: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/watchers_count`. - public var watchers_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/allow_forking`. - public var allow_forking: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo/web_commit_signoff_required`. - public var web_commit_signoff_required: Swift.Bool? - /// Creates a new `repoPayload`. - /// - /// - Parameters: - /// - archive_url: - /// - assignees_url: - /// - blobs_url: - /// - branches_url: - /// - collaborators_url: - /// - comments_url: - /// - commits_url: - /// - compare_url: - /// - contents_url: - /// - contributors_url: - /// - deployments_url: - /// - description: - /// - downloads_url: - /// - events_url: - /// - fork: - /// - forks_url: - /// - full_name: - /// - git_commits_url: - /// - git_refs_url: - /// - git_tags_url: - /// - hooks_url: - /// - html_url: - /// - id: - /// - is_template: - /// - node_id: - /// - issue_comment_url: - /// - issue_events_url: - /// - issues_url: - /// - keys_url: - /// - labels_url: - /// - languages_url: - /// - merges_url: - /// - milestones_url: - /// - name: - /// - notifications_url: - /// - owner: - /// - _private: - /// - pulls_url: - /// - releases_url: - /// - stargazers_url: - /// - statuses_url: - /// - subscribers_url: - /// - subscription_url: - /// - tags_url: - /// - teams_url: - /// - trees_url: - /// - url: - /// - clone_url: - /// - default_branch: - /// - forks: - /// - forks_count: - /// - git_url: - /// - has_downloads: - /// - has_issues: - /// - has_projects: - /// - has_wiki: - /// - has_pages: - /// - has_discussions: - /// - homepage: - /// - language: - /// - master_branch: - /// - archived: - /// - disabled: - /// - visibility: The repository visibility: public, private, or internal. - /// - mirror_url: - /// - open_issues: - /// - open_issues_count: - /// - permissions: - /// - temp_clone_token: - /// - allow_merge_commit: - /// - allow_squash_merge: - /// - allow_rebase_merge: - /// - license: - /// - pushed_at: - /// - size: - /// - ssh_url: - /// - stargazers_count: - /// - svn_url: - /// - topics: - /// - watchers: - /// - watchers_count: - /// - created_at: - /// - updated_at: - /// - allow_forking: - /// - web_commit_signoff_required: - public init( - archive_url: Swift.String, - assignees_url: Swift.String, - blobs_url: Swift.String, - branches_url: Swift.String, - collaborators_url: Swift.String, - comments_url: Swift.String, - commits_url: Swift.String, - compare_url: Swift.String, - contents_url: Swift.String, - contributors_url: Swift.String, - deployments_url: Swift.String, - description: Swift.String? = nil, - downloads_url: Swift.String, - events_url: Swift.String, - fork: Swift.Bool, - forks_url: Swift.String, - full_name: Swift.String, - git_commits_url: Swift.String, - git_refs_url: Swift.String, - git_tags_url: Swift.String, - hooks_url: Swift.String, - html_url: Swift.String, - id: Swift.Int, - is_template: Swift.Bool? = nil, - node_id: Swift.String, - issue_comment_url: Swift.String, - issue_events_url: Swift.String, - issues_url: Swift.String, - keys_url: Swift.String, - labels_url: Swift.String, - languages_url: Swift.String, - merges_url: Swift.String, - milestones_url: Swift.String, - name: Swift.String, - notifications_url: Swift.String, - owner: Components.Schemas.pull_hyphen_request.basePayload.repoPayload.ownerPayload, - _private: Swift.Bool, - pulls_url: Swift.String, - releases_url: Swift.String, - stargazers_url: Swift.String, - statuses_url: Swift.String, - subscribers_url: Swift.String, - subscription_url: Swift.String, - tags_url: Swift.String, - teams_url: Swift.String, - trees_url: Swift.String, - url: Swift.String, - clone_url: Swift.String, - default_branch: Swift.String, - forks: Swift.Int, - forks_count: Swift.Int, - git_url: Swift.String, - has_downloads: Swift.Bool, - has_issues: Swift.Bool, - has_projects: Swift.Bool, - has_wiki: Swift.Bool, - has_pages: Swift.Bool, - has_discussions: Swift.Bool, - homepage: Swift.String? = nil, - language: Swift.String? = nil, - master_branch: Swift.String? = nil, - archived: Swift.Bool, - disabled: Swift.Bool, - visibility: Swift.String? = nil, - mirror_url: Swift.String? = nil, - open_issues: Swift.Int, - open_issues_count: Swift.Int, - permissions: Components.Schemas.pull_hyphen_request.basePayload.repoPayload.permissionsPayload? = nil, - temp_clone_token: Swift.String? = nil, - allow_merge_commit: Swift.Bool? = nil, - allow_squash_merge: Swift.Bool? = nil, - allow_rebase_merge: Swift.Bool? = nil, - license: Components.Schemas.nullable_hyphen_license_hyphen_simple? = nil, - pushed_at: Foundation.Date, - size: Swift.Int, - ssh_url: Swift.String, - stargazers_count: Swift.Int, - svn_url: Swift.String, - topics: [Swift.String]? = nil, - watchers: Swift.Int, - watchers_count: Swift.Int, - created_at: Foundation.Date, - updated_at: Foundation.Date, - allow_forking: Swift.Bool? = nil, - web_commit_signoff_required: Swift.Bool? = nil - ) { - self.archive_url = archive_url - self.assignees_url = assignees_url - self.blobs_url = blobs_url - self.branches_url = branches_url - self.collaborators_url = collaborators_url - self.comments_url = comments_url - self.commits_url = commits_url - self.compare_url = compare_url - self.contents_url = contents_url - self.contributors_url = contributors_url - self.deployments_url = deployments_url - self.description = description - self.downloads_url = downloads_url - self.events_url = events_url - self.fork = fork - self.forks_url = forks_url - self.full_name = full_name - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - self.hooks_url = hooks_url - self.html_url = html_url - self.id = id - self.is_template = is_template - self.node_id = node_id - self.issue_comment_url = issue_comment_url - self.issue_events_url = issue_events_url - self.issues_url = issues_url - self.keys_url = keys_url - self.labels_url = labels_url - self.languages_url = languages_url - self.merges_url = merges_url - self.milestones_url = milestones_url - self.name = name - self.notifications_url = notifications_url - self.owner = owner - self._private = _private - self.pulls_url = pulls_url - self.releases_url = releases_url - self.stargazers_url = stargazers_url - self.statuses_url = statuses_url - self.subscribers_url = subscribers_url - self.subscription_url = subscription_url - self.tags_url = tags_url - self.teams_url = teams_url - self.trees_url = trees_url - self.url = url - self.clone_url = clone_url - self.default_branch = default_branch - self.forks = forks - self.forks_count = forks_count - self.git_url = git_url - self.has_downloads = has_downloads - self.has_issues = has_issues - self.has_projects = has_projects - self.has_wiki = has_wiki - self.has_pages = has_pages - self.has_discussions = has_discussions - self.homepage = homepage - self.language = language - self.master_branch = master_branch - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.mirror_url = mirror_url - self.open_issues = open_issues - self.open_issues_count = open_issues_count - self.permissions = permissions - self.temp_clone_token = temp_clone_token - self.allow_merge_commit = allow_merge_commit - self.allow_squash_merge = allow_squash_merge - self.allow_rebase_merge = allow_rebase_merge - self.license = license - self.pushed_at = pushed_at - self.size = size - self.ssh_url = ssh_url - self.stargazers_count = stargazers_count - self.svn_url = svn_url - self.topics = topics - self.watchers = watchers - self.watchers_count = watchers_count - self.created_at = created_at - self.updated_at = updated_at - self.allow_forking = allow_forking - self.web_commit_signoff_required = web_commit_signoff_required - } - public enum CodingKeys: String, CodingKey { - case archive_url - case assignees_url - case blobs_url - case branches_url - case collaborators_url - case comments_url - case commits_url - case compare_url - case contents_url - case contributors_url - case deployments_url - case description - case downloads_url - case events_url - case fork - case forks_url - case full_name - case git_commits_url - case git_refs_url - case git_tags_url - case hooks_url - case html_url - case id - case is_template - case node_id - case issue_comment_url - case issue_events_url - case issues_url - case keys_url - case labels_url - case languages_url - case merges_url - case milestones_url - case name - case notifications_url - case owner - case _private = "private" - case pulls_url - case releases_url - case stargazers_url - case statuses_url - case subscribers_url - case subscription_url - case tags_url - case teams_url - case trees_url - case url - case clone_url - case default_branch - case forks - case forks_count - case git_url - case has_downloads - case has_issues - case has_projects - case has_wiki - case has_pages - case has_discussions - case homepage - case language - case master_branch - case archived - case disabled - case visibility - case mirror_url - case open_issues - case open_issues_count - case permissions - case temp_clone_token - case allow_merge_commit - case allow_squash_merge - case allow_rebase_merge - case license - case pushed_at - case size - case ssh_url - case stargazers_count - case svn_url - case topics - case watchers - case watchers_count - case created_at - case updated_at - case allow_forking - case web_commit_signoff_required - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/base/repo`. - public var repo: Components.Schemas.pull_hyphen_request.basePayload.repoPayload + public var repo: Components.Schemas.repository /// - Remark: Generated from `#/components/schemas/pull-request/base/sha`. public var sha: Swift.String /// - Remark: Generated from `#/components/schemas/pull-request/base/user`. - public struct userPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/site_admin`. - public var site_admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request/base/user/url`. - public var url: Swift.String - /// Creates a new `userPayload`. - /// - /// - Parameters: - /// - avatar_url: - /// - events_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - gravatar_id: - /// - html_url: - /// - id: - /// - node_id: - /// - login: - /// - organizations_url: - /// - received_events_url: - /// - repos_url: - /// - site_admin: - /// - starred_url: - /// - subscriptions_url: - /// - _type: - /// - url: - public init( - avatar_url: Swift.String, - events_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - gravatar_id: Swift.String? = nil, - html_url: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - login: Swift.String, - organizations_url: Swift.String, - received_events_url: Swift.String, - repos_url: Swift.String, - site_admin: Swift.Bool, - starred_url: Swift.String, - subscriptions_url: Swift.String, - _type: Swift.String, - url: Swift.String - ) { - self.avatar_url = avatar_url - self.events_url = events_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.gravatar_id = gravatar_id - self.html_url = html_url - self.id = id - self.node_id = node_id - self.login = login - self.organizations_url = organizations_url - self.received_events_url = received_events_url - self.repos_url = repos_url - self.site_admin = site_admin - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self._type = _type - self.url = url - } - public enum CodingKeys: String, CodingKey { - case avatar_url - case events_url - case followers_url - case following_url - case gists_url - case gravatar_id - case html_url - case id - case node_id - case login - case organizations_url - case received_events_url - case repos_url - case site_admin - case starred_url - case subscriptions_url - case _type = "type" - case url - } - } - /// - Remark: Generated from `#/components/schemas/pull-request/base/user`. - public var user: Components.Schemas.pull_hyphen_request.basePayload.userPayload + public var user: Components.Schemas.simple_hyphen_user /// Creates a new `basePayload`. /// /// - Parameters: @@ -5985,9 +4354,9 @@ public enum Components { public init( label: Swift.String, ref: Swift.String, - repo: Components.Schemas.pull_hyphen_request.basePayload.repoPayload, + repo: Components.Schemas.repository, sha: Swift.String, - user: Components.Schemas.pull_hyphen_request.basePayload.userPayload + user: Components.Schemas.simple_hyphen_user ) { self.label = label self.ref = ref @@ -6761,7 +5130,7 @@ public enum Components { /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias comment_hyphen_id = Swift.Int + public typealias comment_hyphen_id = Swift.Int64 /// The property to sort the results by. /// /// - Remark: Generated from `#/components/parameters/sort`. @@ -9154,7 +7523,7 @@ public enum Operations { /// /// If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request. /// - /// The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. + /// The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." @@ -9230,7 +7599,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/comments/POST/requestBody/json/path`. public var path: Swift.String - /// **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + /// **This parameter is closing down. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/pulls/{pull_number}/comments/POST/requestBody/json/position`. @available(*, deprecated) @@ -9287,7 +7656,7 @@ public enum Operations { /// - body: The text of the review comment. /// - commit_id: The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. /// - path: The relative path to the file that necessitates a comment. - /// - position: **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + /// - position: **This parameter is closing down. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. /// - side: In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://docs.github.com/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. /// - line: **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. /// - start_line: **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. @@ -13275,6 +11644,7 @@ public enum Operations { /// Update a pull request branch /// /// Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + /// Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/update-branch/put(pulls/update-branch)`. diff --git a/Sources/rate-limit/Client.swift b/Sources/rate-limit/Client.swift index 5cfda7888c1..318dec3f412 100644 --- a/Sources/rate-limit/Client.swift +++ b/Sources/rate-limit/Client.swift @@ -55,7 +55,7 @@ public struct Client: APIProtocol { /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// - Remark: HTTP `GET /rate_limit`. /// - Remark: Generated from `#/paths//rate_limit/get(rate-limit/get)`. diff --git a/Sources/rate-limit/Types.swift b/Sources/rate-limit/Types.swift index dc38c7028d0..1d24c69e143 100644 --- a/Sources/rate-limit/Types.swift +++ b/Sources/rate-limit/Types.swift @@ -28,7 +28,7 @@ public protocol APIProtocol: Sendable { /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// - Remark: HTTP `GET /rate_limit`. /// - Remark: Generated from `#/paths//rate_limit/get(rate-limit/get)`. @@ -54,7 +54,7 @@ extension APIProtocol { /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// - Remark: HTTP `GET /rate_limit`. /// - Remark: Generated from `#/paths//rate_limit/get(rate-limit/get)`. @@ -315,7 +315,7 @@ public enum Operations { /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// /// > [!NOTE] - /// > The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + /// > The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. /// /// - Remark: HTTP `GET /rate_limit`. /// - Remark: Generated from `#/paths//rate_limit/get(rate-limit/get)`. diff --git a/Sources/reactions/Client.swift b/Sources/reactions/Client.swift index 21656304d0d..2c8e1bbc585 100644 --- a/Sources/reactions/Client.swift +++ b/Sources/reactions/Client.swift @@ -1980,7 +1980,7 @@ public struct Client: APIProtocol { /// List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -2081,7 +2081,7 @@ public struct Client: APIProtocol { /// Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -2164,7 +2164,7 @@ public struct Client: APIProtocol { /// List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -2264,7 +2264,7 @@ public struct Client: APIProtocol { /// Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index 4d42b545b3a..358b85e7ee5 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -210,7 +210,7 @@ public protocol APIProtocol: Sendable { /// List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -223,7 +223,7 @@ public protocol APIProtocol: Sendable { /// Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -238,7 +238,7 @@ public protocol APIProtocol: Sendable { /// List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -251,7 +251,7 @@ public protocol APIProtocol: Sendable { /// Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -620,7 +620,7 @@ extension APIProtocol { /// List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -643,7 +643,7 @@ extension APIProtocol { /// Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -668,7 +668,7 @@ extension APIProtocol { /// List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -691,7 +691,7 @@ extension APIProtocol { /// Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -812,6 +812,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -836,6 +838,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -857,7 +860,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -880,6 +884,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -903,6 +908,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1106,7 +1112,7 @@ public enum Components { /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias comment_hyphen_id = Swift.Int + public typealias comment_hyphen_id = Swift.Int64 /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5337,7 +5343,7 @@ public enum Operations { /// List reactions for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint. /// /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -5554,7 +5560,7 @@ public enum Operations { /// Create reaction for a team discussion comment (Legacy) /// /// > [!WARNING] - /// > **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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down 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](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. /// /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). /// @@ -5748,7 +5754,7 @@ public enum Operations { /// List reactions for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint. /// /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// @@ -5958,7 +5964,7 @@ public enum Operations { /// Create reaction for a team discussion (Legacy) /// /// > [!WARNING] - /// > **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`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint. /// /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). /// diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index de935b61842..b0d5dd01110 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -311,6 +311,13 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "targets", + value: input.query.targets + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1675,9 +1682,9 @@ public struct Client: APIProtocol { /// /// Store an artifact attestation and associate it with a repository. /// - /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token, the `attestations:write` permission is required. /// - /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. @@ -4575,10 +4582,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -4676,10 +4681,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -4777,10 +4780,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -5365,10 +5366,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -5470,10 +5469,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -5575,10 +5572,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -8255,8 +8250,7 @@ public struct Client: APIProtocol { let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/vnd.github.object", - "application/json" + "application/vnd.github.object" ] ) switch chosenContentType { @@ -8268,14 +8262,6 @@ public struct Client: APIProtocol { .application_vnd_period_github_period_object(value) } ) - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.repos_sol_get_hyphen_content.Output.Ok.Body.jsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) default: preconditionFailure("bestContentType chose an invalid content type.") } @@ -11744,13 +11730,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -15166,7 +15145,13 @@ public struct Client: APIProtocol { } /// Get a release asset /// - /// To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + /// To download the asset's binary content: + /// + /// - If within a browser, fetch the location specified in the `browser_download_url` key provided in the response. + /// - Alternatively, set the `Accept` header of the request to + /// [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// The API will either redirect the client to the location, or stream it directly if possible. + /// API clients should handle both a `200` or `302` response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/assets/{asset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/get(repos/get-release-asset)`. @@ -16162,6 +16147,13 @@ public struct Client: APIProtocol { name: "includes_parents", value: input.query.includes_parents ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "targets", + value: input.query.targets + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -17577,10 +17569,10 @@ public struct Client: APIProtocol { } ) } - /// Deprecated - List tag protection states for a repository + /// Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// @@ -17692,10 +17684,10 @@ public struct Client: APIProtocol { } ) } - /// Deprecated - Create a tag protection state for a repository + /// Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -17815,10 +17807,10 @@ public struct Client: APIProtocol { } ) } - /// Deprecated - Delete a tag protection state for a repository + /// Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index f498e59a45c..58542d30b33 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -127,9 +127,9 @@ public protocol APIProtocol: Sendable { /// /// Store an artifact attestation and associate it with a repository. /// - /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token, the `attestations:write` permission is required. /// - /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. @@ -1634,7 +1634,13 @@ public protocol APIProtocol: Sendable { func repos_sol_create_hyphen_release(_ input: Operations.repos_sol_create_hyphen_release.Input) async throws -> Operations.repos_sol_create_hyphen_release.Output /// Get a release asset /// - /// To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + /// To download the asset's binary content: + /// + /// - If within a browser, fetch the location specified in the `browser_download_url` key provided in the response. + /// - Alternatively, set the `Accept` header of the request to + /// [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// The API will either redirect the client to the location, or stream it directly if possible. + /// API clients should handle both a `200` or `302` response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/assets/{asset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/get(repos/get-release-asset)`. @@ -1869,10 +1875,10 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/tags`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/get(repos/list-tags)`. func repos_sol_list_hyphen_tags(_ input: Operations.repos_sol_list_hyphen_tags.Input) async throws -> Operations.repos_sol_list_hyphen_tags.Output - /// Deprecated - List tag protection states for a repository + /// Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// @@ -1882,10 +1888,10 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/get(repos/list-tag-protection)`. @available(*, deprecated) func repos_sol_list_hyphen_tag_hyphen_protection(_ input: Operations.repos_sol_list_hyphen_tag_hyphen_protection.Input) async throws -> Operations.repos_sol_list_hyphen_tag_hyphen_protection.Output - /// Deprecated - Create a tag protection state for a repository + /// Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -1894,10 +1900,10 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/tags/protection/post(repos/create-tag-protection)`. @available(*, deprecated) func repos_sol_create_hyphen_tag_hyphen_protection(_ input: Operations.repos_sol_create_hyphen_tag_hyphen_protection.Input) async throws -> Operations.repos_sol_create_hyphen_tag_hyphen_protection.Output - /// Deprecated - Delete a tag protection state for a repository + /// Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -2319,9 +2325,9 @@ extension APIProtocol { /// /// Store an artifact attestation and associate it with a repository. /// - /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token, the `attestations:write` permission is required. /// - /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. @@ -2868,7 +2874,7 @@ extension APIProtocol { public func repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Output { try await repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions(Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input( path: path, @@ -2887,7 +2893,7 @@ extension APIProtocol { public func repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Output { try await repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions(Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input( path: path, @@ -2906,7 +2912,7 @@ extension APIProtocol { public func repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Output { try await repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions(Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input( path: path, @@ -3020,7 +3026,7 @@ extension APIProtocol { public func repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Output { try await repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions(Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input( path: path, @@ -3043,7 +3049,7 @@ extension APIProtocol { public func repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Output { try await repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions(Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input( path: path, @@ -3066,7 +3072,7 @@ extension APIProtocol { public func repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions( path: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) async throws -> Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Output { try await repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions(Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input( path: path, @@ -4996,7 +5002,13 @@ extension APIProtocol { } /// Get a release asset /// - /// To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + /// To download the asset's binary content: + /// + /// - If within a browser, fetch the location specified in the `browser_download_url` key provided in the response. + /// - Alternatively, set the `Accept` header of the request to + /// [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// The API will either redirect the client to the location, or stream it directly if possible. + /// API clients should handle both a `200` or `302` response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/assets/{asset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/get(repos/get-release-asset)`. @@ -5455,10 +5467,10 @@ extension APIProtocol { headers: headers )) } - /// Deprecated - List tag protection states for a repository + /// Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// @@ -5476,10 +5488,10 @@ extension APIProtocol { headers: headers )) } - /// Deprecated - Create a tag protection state for a repository + /// Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -5498,10 +5510,10 @@ extension APIProtocol { body: body )) } - /// Deprecated - Delete a tag protection state for a repository + /// Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -5907,6 +5919,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -5931,6 +5945,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -5952,7 +5967,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -5975,6 +5991,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -5998,6 +6015,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -6114,6 +6132,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -6138,6 +6158,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -6159,7 +6180,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -6182,6 +6204,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -6205,6 +6228,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. @@ -7345,7 +7369,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -7533,7 +7557,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -8680,6 +8704,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -8688,18 +8734,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -8707,6 +8756,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -9652,7 +9702,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -9840,7 +9890,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -10963,12 +11013,10 @@ public enum Components { public struct repository_hyphen_ruleset_hyphen_bypass_hyphen_actor: Codable, Hashable, Sendable { /// The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// - /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_id`. public var actor_id: Swift.Int? /// The type of actor that can bypass a ruleset. /// - /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. @frozen public enum actor_typePayload: String, Codable, Hashable, Sendable { case Integration = "Integration" @@ -10979,32 +11027,29 @@ public enum Components { } /// The type of actor that can bypass a ruleset. /// - /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. public var actor_type: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.actor_typePayload - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. - /// + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. @frozen public enum bypass_modePayload: String, Codable, Hashable, Sendable { case always = "always" case pull_request = "pull_request" } - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. - /// + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. - public var bypass_mode: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.bypass_modePayload + public var bypass_mode: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.bypass_modePayload? /// Creates a new `repository_hyphen_ruleset_hyphen_bypass_hyphen_actor`. /// /// - Parameters: /// - actor_id: The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// - actor_type: The type of actor that can bypass a ruleset. - /// - bypass_mode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. + /// - bypass_mode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. public init( actor_id: Swift.Int? = nil, actor_type: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.actor_typePayload, - bypass_mode: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.bypass_modePayload + bypass_mode: Components.Schemas.repository_hyphen_ruleset_hyphen_bypass_hyphen_actor.bypass_modePayload? = nil ) { self.actor_id = actor_id self.actor_type = actor_type @@ -11234,8 +11279,9 @@ public enum Components { case repository_property } } - /// Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. - /// + /// Conditions for an organization ruleset. + /// The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties. + /// The push rulesets conditions object does not require the `ref_name` property. /// /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions`. @frozen public enum org_hyphen_ruleset_hyphen_conditions: Codable, Hashable, Sendable { @@ -12498,9 +12544,6 @@ public enum Components { case repository_hyphen_rule_hyphen_branch_hyphen_name_hyphen_pattern(Components.Schemas.repository_hyphen_rule_hyphen_branch_hyphen_name_hyphen_pattern) /// - Remark: Generated from `#/components/schemas/repository-rule/case15`. case repository_hyphen_rule_hyphen_tag_hyphen_name_hyphen_pattern(Components.Schemas.repository_hyphen_rule_hyphen_tag_hyphen_name_hyphen_pattern) - /// > [!NOTE] - /// > `file_path_restriction` is in beta and subject to change. - /// /// Prevent commits that include changes in specified file paths from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case16`. @@ -12547,16 +12590,10 @@ public enum Components { case parameters } } - /// > [!NOTE] - /// > `file_path_restriction` is in beta and subject to change. - /// /// Prevent commits that include changes in specified file paths from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case16`. case case16(Components.Schemas.repository_hyphen_rule.Case16Payload) - /// > [!NOTE] - /// > `max_file_path_length` is in beta and subject to change. - /// /// Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case17`. @@ -12603,16 +12640,10 @@ public enum Components { case parameters } } - /// > [!NOTE] - /// > `max_file_path_length` is in beta and subject to change. - /// /// Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case17`. case case17(Components.Schemas.repository_hyphen_rule.Case17Payload) - /// > [!NOTE] - /// > `file_extension_restriction` is in beta and subject to change. - /// /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. @@ -12659,16 +12690,10 @@ public enum Components { case parameters } } - /// > [!NOTE] - /// > `file_extension_restriction` is in beta and subject to change. - /// /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. case case18(Components.Schemas.repository_hyphen_rule.Case18Payload) - /// > [!NOTE] - /// > `max_file_size` is in beta and subject to change. - /// /// Prevent commits that exceed a specified file size limit from being pushed to the commit. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. @@ -12715,9 +12740,6 @@ public enum Components { case parameters } } - /// > [!NOTE] - /// > `max_file_size` is in beta and subject to change. - /// /// Prevent commits that exceed a specified file size limit from being pushed to the commit. /// /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. @@ -12921,9 +12943,6 @@ public enum Components { public var name: Swift.String /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. @frozen public enum targetPayload: String, Codable, Hashable, Sendable { case branch = "branch" @@ -12932,9 +12951,6 @@ public enum Components { } /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/components/schemas/repository-ruleset/target`. public var target: Components.Schemas.repository_hyphen_ruleset.targetPayload? /// The type of the source of the ruleset @@ -13205,6 +13221,7 @@ public enum Components { @frozen public enum evaluation_resultPayload: String, Codable, Hashable, Sendable { case pass = "pass" case fail = "fail" + case bypass = "bypass" } /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. /// @@ -13317,14 +13334,15 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/rule-suite/result`. public var result: Components.Schemas.rule_hyphen_suite.resultPayload? - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. /// /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. @frozen public enum evaluation_resultPayload: String, Codable, Hashable, Sendable { case pass = "pass" case fail = "fail" + case bypass = "bypass" } - /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. /// /// - Remark: Generated from `#/components/schemas/rule-suite/evaluation_result`. public var evaluation_result: Components.Schemas.rule_hyphen_suite.evaluation_resultPayload? @@ -13394,7 +13412,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluationsPayload/rule_type`. public var rule_type: Swift.String? - /// Any associated details with the rule evaluation. + /// The detailed failure message for the rule. Null if the rule passed. /// /// - Remark: Generated from `#/components/schemas/rule-suite/rule_evaluationsPayload/details`. public var details: Swift.String? @@ -13405,7 +13423,7 @@ public enum Components { /// - enforcement: The enforcement level of this rule source. /// - result: The result of the evaluation of the individual rule. /// - rule_type: The type of rule. - /// - details: Any associated details with the rule evaluation. + /// - details: The detailed failure message for the rule. Null if the rule passed. public init( rule_source: Components.Schemas.rule_hyphen_suite.rule_evaluationsPayloadPayload.rule_sourcePayload? = nil, enforcement: Components.Schemas.rule_hyphen_suite.rule_evaluationsPayloadPayload.enforcementPayload? = nil, @@ -13448,7 +13466,7 @@ public enum Components { /// - repository_name: The name of the repository without the `.git` extension. /// - pushed_at: /// - result: The result of the rule evaluations for rules with the `active` enforcement status. - /// - evaluation_result: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + /// - evaluation_result: The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. /// - rule_evaluations: Details on the evaluated rules. public init( id: Swift.Int? = nil, @@ -14137,6 +14155,8 @@ public enum Components { public var _type: Swift.String? /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/usersPayload/site_admin`. public var site_admin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/usersPayload/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `usersPayloadPayload`. /// /// - Parameters: @@ -14158,6 +14178,7 @@ public enum Components { /// - received_events_url: /// - _type: /// - site_admin: + /// - user_view_type: public init( login: Swift.String? = nil, id: Swift.Int64? = nil, @@ -14176,7 +14197,8 @@ public enum Components { events_url: Swift.String? = nil, received_events_url: Swift.String? = nil, _type: Swift.String? = nil, - site_admin: Swift.Bool? = nil + site_admin: Swift.Bool? = nil, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -14196,6 +14218,7 @@ public enum Components { self.received_events_url = received_events_url self._type = _type self.site_admin = site_admin + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -14216,6 +14239,7 @@ public enum Components { case received_events_url case _type = "type" case site_admin + case user_view_type } } /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. @@ -14371,6 +14395,8 @@ public enum Components { public var _type: Swift.String? /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/owner/site_admin`. public var site_admin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/owner/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `ownerPayload`. /// /// - Parameters: @@ -14397,6 +14423,7 @@ public enum Components { /// - received_events_url: /// - _type: /// - site_admin: + /// - user_view_type: public init( login: Swift.String? = nil, id: Swift.Int? = nil, @@ -14420,7 +14447,8 @@ public enum Components { organizations_url: Swift.String? = nil, received_events_url: Swift.String? = nil, _type: Swift.String? = nil, - site_admin: Swift.Bool? = nil + site_admin: Swift.Bool? = nil, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -14445,6 +14473,7 @@ public enum Components { self.received_events_url = received_events_url self._type = _type self.site_admin = site_admin + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -14470,6 +14499,7 @@ public enum Components { case received_events_url case _type = "type" case site_admin + case user_view_type } } /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/appsPayload/owner`. @@ -16173,6 +16203,8 @@ public enum Components { public var permissions: Components.Schemas.collaborator.permissionsPayload? /// - Remark: Generated from `#/components/schemas/collaborator/role_name`. public var role_name: Swift.String + /// - Remark: Generated from `#/components/schemas/collaborator/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `collaborator`. /// /// - Parameters: @@ -16198,6 +16230,7 @@ public enum Components { /// - site_admin: /// - permissions: /// - role_name: + /// - user_view_type: public init( login: Swift.String, id: Swift.Int64, @@ -16220,7 +16253,8 @@ public enum Components { _type: Swift.String, site_admin: Swift.Bool, permissions: Components.Schemas.collaborator.permissionsPayload? = nil, - role_name: Swift.String + role_name: Swift.String, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -16244,6 +16278,7 @@ public enum Components { self.site_admin = site_admin self.permissions = permissions self.role_name = role_name + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -16268,6 +16303,7 @@ public enum Components { case site_admin case permissions case role_name + case user_view_type } } /// Repository invitations let you manage who you collaborate with. @@ -16450,6 +16486,8 @@ public enum Components { public var permissions: Components.Schemas.nullable_hyphen_collaborator.permissionsPayload? /// - Remark: Generated from `#/components/schemas/nullable-collaborator/role_name`. public var role_name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-collaborator/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_collaborator`. /// /// - Parameters: @@ -16475,6 +16513,7 @@ public enum Components { /// - site_admin: /// - permissions: /// - role_name: + /// - user_view_type: public init( login: Swift.String, id: Swift.Int64, @@ -16497,7 +16536,8 @@ public enum Components { _type: Swift.String, site_admin: Swift.Bool, permissions: Components.Schemas.nullable_hyphen_collaborator.permissionsPayload? = nil, - role_name: Swift.String + role_name: Swift.String, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -16521,6 +16561,7 @@ public enum Components { self.site_admin = site_admin self.permissions = permissions self.role_name = role_name + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -16545,6 +16586,7 @@ public enum Components { case site_admin case permissions case role_name + case user_view_type } } /// Repository Collaborator Permission @@ -17709,6 +17751,8 @@ public enum Components { public var path: Swift.String /// - Remark: Generated from `#/components/schemas/content-tree/sha`. public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/content-tree/content`. + public var content: Swift.String? /// - Remark: Generated from `#/components/schemas/content-tree/url`. public var url: Swift.String /// - Remark: Generated from `#/components/schemas/content-tree/git_url`. @@ -17727,8 +17771,6 @@ public enum Components { public var name: Swift.String /// - Remark: Generated from `#/components/schemas/content-tree/entriesPayload/path`. public var path: Swift.String - /// - Remark: Generated from `#/components/schemas/content-tree/entriesPayload/content`. - public var content: Swift.String? /// - Remark: Generated from `#/components/schemas/content-tree/entriesPayload/sha`. public var sha: Swift.String /// - Remark: Generated from `#/components/schemas/content-tree/entriesPayload/url`. @@ -17777,7 +17819,6 @@ public enum Components { /// - size: /// - name: /// - path: - /// - content: /// - sha: /// - url: /// - git_url: @@ -17789,7 +17830,6 @@ public enum Components { size: Swift.Int, name: Swift.String, path: Swift.String, - content: Swift.String? = nil, sha: Swift.String, url: Swift.String, git_url: Swift.String? = nil, @@ -17801,7 +17841,6 @@ public enum Components { self.size = size self.name = name self.path = path - self.content = content self.sha = sha self.url = url self.git_url = git_url @@ -17814,7 +17853,6 @@ public enum Components { case size case name case path - case content case sha case url case git_url @@ -17866,6 +17904,7 @@ public enum Components { /// - name: /// - path: /// - sha: + /// - content: /// - url: /// - git_url: /// - html_url: @@ -17878,6 +17917,7 @@ public enum Components { name: Swift.String, path: Swift.String, sha: Swift.String, + content: Swift.String? = nil, url: Swift.String, git_url: Swift.String? = nil, html_url: Swift.String? = nil, @@ -17890,6 +17930,7 @@ public enum Components { self.name = name self.path = path self.sha = sha + self.content = content self.url = url self.git_url = git_url self.html_url = html_url @@ -17903,6 +17944,7 @@ public enum Components { case name case path case sha + case content case url case git_url case html_url @@ -18867,6 +18909,8 @@ public enum Components { public var email: Swift.String? /// - Remark: Generated from `#/components/schemas/contributor/name`. public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/contributor/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `contributor`. /// /// - Parameters: @@ -18891,6 +18935,7 @@ public enum Components { /// - contributions: /// - email: /// - name: + /// - user_view_type: public init( login: Swift.String? = nil, id: Swift.Int? = nil, @@ -18912,7 +18957,8 @@ public enum Components { site_admin: Swift.Bool? = nil, contributions: Swift.Int, email: Swift.String? = nil, - name: Swift.String? = nil + name: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -18935,6 +18981,7 @@ public enum Components { self.contributions = contributions self.email = email self.name = name + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -18958,6 +19005,7 @@ public enum Components { case contributions case email case name + case user_view_type } } /// The status of a deployment. @@ -18996,7 +19044,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/deployment-status/environment`. public var environment: Swift.String? - /// Deprecated: the URL to associate with this status. + /// Closing down notice: the URL to associate with this status. /// /// - Remark: Generated from `#/components/schemas/deployment-status/target_url`. public var target_url: Swift.String @@ -19028,7 +19076,7 @@ public enum Components { /// - creator: /// - description: A short description of the status. /// - environment: The environment of the deployment that the status is for. - /// - target_url: Deprecated: the URL to associate with this status. + /// - target_url: Closing down notice: the URL to associate with this status. /// - created_at: /// - updated_at: /// - deployment_url: @@ -19788,6 +19836,8 @@ public enum Components { public var added_by: Swift.String? /// - Remark: Generated from `#/components/schemas/deploy-key/last_used`. public var last_used: Swift.String? + /// - Remark: Generated from `#/components/schemas/deploy-key/enabled`. + public var enabled: Swift.Bool? /// Creates a new `deploy_hyphen_key`. /// /// - Parameters: @@ -19800,6 +19850,7 @@ public enum Components { /// - read_only: /// - added_by: /// - last_used: + /// - enabled: public init( id: Swift.Int, key: Swift.String, @@ -19809,7 +19860,8 @@ public enum Components { created_at: Swift.String, read_only: Swift.Bool, added_by: Swift.String? = nil, - last_used: Swift.String? = nil + last_used: Swift.String? = nil, + enabled: Swift.Bool? = nil ) { self.id = id self.key = key @@ -19820,6 +19872,7 @@ public enum Components { self.read_only = read_only self.added_by = added_by self.last_used = last_used + self.enabled = enabled } public enum CodingKeys: String, CodingKey { case id @@ -19831,6 +19884,7 @@ public enum Components { case read_only case added_by case last_used + case enabled } } /// Language @@ -22120,7 +22174,7 @@ public enum Components { /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias comment_hyphen_id = Swift.Int + public typealias comment_hyphen_id = Swift.Int64 /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -22145,9 +22199,15 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/invitation-id`. public typealias invitation_hyphen_id = Swift.Int - /// The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. + /// A comma-separated list of rule targets to filter by. + /// If provided, only rulesets that apply to the specified targets will be returned. + /// For example, `branch,tag,push`. /// /// + /// - Remark: Generated from `#/components/parameters/ruleset-targets`. + public typealias ruleset_hyphen_targets = Swift.String + /// The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. + /// /// - Remark: Generated from `#/components/parameters/ref-in-query`. public typealias ref_hyphen_in_hyphen_query = Swift.String /// The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. @@ -23053,7 +23113,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/repos/POST/requestBody/json/delete_branch_on_merge`. public var delete_branch_on_merge: Swift.Bool? - /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/paths/orgs/{org}/repos/POST/requestBody/json/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -23186,7 +23246,7 @@ public enum Operations { /// - allow_rebase_merge: Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. /// - allow_auto_merge: Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. /// - delete_branch_on_merge: Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** - /// - use_squash_pr_title_as_default: Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: Required when using `squash_merge_commit_message`. /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: Required when using `merge_commit_message`. @@ -23475,17 +23535,27 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/GET/query/page`. public var page: Components.Parameters.page? + /// A comma-separated list of rule targets to filter by. + /// If provided, only rulesets that apply to the specified targets will be returned. + /// For example, `branch,tag,push`. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/GET/query/targets`. + public var targets: Components.Parameters.ruleset_hyphen_targets? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - targets: A comma-separated list of rule targets to filter by. public init( per_page: Components.Parameters.per_hyphen_page? = nil, - page: Components.Parameters.page? = nil + page: Components.Parameters.page? = nil, + targets: Components.Parameters.ruleset_hyphen_targets? = nil ) { self.per_page = per_page self.page = page + self.targets = targets } } public var query: Operations.repos_sol_get_hyphen_org_hyphen_rulesets.Input.Query @@ -23692,9 +23762,6 @@ public enum Operations { public var name: Swift.String /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/target`. @frozen public enum targetPayload: String, Codable, Hashable, Sendable { case branch = "branch" @@ -23703,9 +23770,6 @@ public enum Operations { } /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/target`. public var target: Operations.repos_sol_create_hyphen_org_hyphen_ruleset.Input.Body.jsonPayload.targetPayload? /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/enforcement`. @@ -23931,7 +23995,6 @@ public enum Operations { public struct Query: Sendable, Hashable { /// The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. /// - /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/rule-suites/GET/query/ref`. public var ref: Components.Parameters.ref_hyphen_in_hyphen_query? /// The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. @@ -24596,9 +24659,6 @@ public enum Operations { public var name: Swift.String? /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/target`. @frozen public enum targetPayload: String, Codable, Hashable, Sendable { case branch = "branch" @@ -24607,9 +24667,6 @@ public enum Operations { } /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/target`. public var target: Operations.repos_sol_update_hyphen_org_hyphen_ruleset.Input.Body.jsonPayload.targetPayload? /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/enforcement`. @@ -25339,6 +25396,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_push_protection`. public var secret_scanning_push_protection: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_push_protectionPayload? + /// Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// Can be `enabled` or `disabled`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_ai_detection/status`. + public var status: Swift.String? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: Can be `enabled` or `disabled`. + public init(status: Swift.String? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_ai_detectionPayload? /// Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning_non_provider_patterns`. @@ -25368,22 +25448,26 @@ public enum Operations { /// - advanced_security: Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." /// - secret_scanning: Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." /// - secret_scanning_push_protection: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + /// - secret_scanning_ai_detection: Use the `status` property to enable or disable secret scanning AI detection for this repository. For more information, see "[Responsible detection of generic secrets with AI](https://docs.github.com/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)." /// - secret_scanning_non_provider_patterns: Use the `status` property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "[Supported secret scanning patterns](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." public init( advanced_security: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.advanced_securityPayload? = nil, secret_scanning: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanningPayload? = nil, secret_scanning_push_protection: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_push_protectionPayload? = nil, + secret_scanning_ai_detection: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_ai_detectionPayload? = nil, secret_scanning_non_provider_patterns: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.secret_scanning_non_provider_patternsPayload? = nil ) { self.advanced_security = advanced_security self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_ai_detection = secret_scanning_ai_detection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns } public enum CodingKeys: String, CodingKey { case advanced_security case secret_scanning case secret_scanning_push_protection + case secret_scanning_ai_detection case secret_scanning_non_provider_patterns } } @@ -25442,7 +25526,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -25561,7 +25645,7 @@ public enum Operations { /// - allow_auto_merge: Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. /// - delete_branch_on_merge: Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. /// - allow_update_branch: Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. - /// - use_squash_pr_title_as_default: Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: Required when using `squash_merge_commit_message`. /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: Required when using `merge_commit_message`. @@ -26374,9 +26458,9 @@ public enum Operations { /// /// Store an artifact attestation and associate it with a repository. /// - /// The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required. + /// The authenticated user must have write permission to the repository and, if using a fine-grained access token, the `attestations:write` permission is required. /// - /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/attestations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/attestations/post(repos/create-attestation)`. @@ -28634,8 +28718,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/PUT/requestBody/json/required_status_checks/strict`. public var strict: Swift.Bool - /// **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. - /// + /// **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/PUT/requestBody/json/required_status_checks/contexts`. @available(*, deprecated) @@ -28679,7 +28762,7 @@ public enum Operations { /// /// - Parameters: /// - strict: Require branches to be up to date before merging. - /// - contexts: **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + /// - contexts: **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. /// - checks: The list of status checks to require in order to merge into this branch. public init( strict: Swift.Bool, @@ -31075,8 +31158,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/PATCH/requestBody/json/strict`. public var strict: Swift.Bool? - /// **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. - /// + /// **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/PATCH/requestBody/json/contexts`. @available(*, deprecated) @@ -31120,7 +31202,7 @@ public enum Operations { /// /// - Parameters: /// - strict: Require branches to be up to date before merging. - /// - contexts: **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + /// - contexts: **Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. /// - checks: The list of status checks to require in order to merge into this branch. public init( strict: Swift.Bool? = nil, @@ -32823,61 +32905,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json/case1/apps`. - public var apps: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - public init(apps: [Swift.String]) { - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case apps - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json/case1`. - case case1(Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/json/apps`. + public var apps: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + public init(apps: [Swift.String]) { + self.apps = apps } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case apps } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/POST/requestBody/content/application\/json`. case json(Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -32887,7 +32934,7 @@ public enum Operations { public init( path: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_add_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -33057,61 +33104,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json/case1/apps`. - public var apps: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - public init(apps: [Swift.String]) { - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case apps - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json/case1`. - case case1(Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/json/apps`. + public var apps: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + public init(apps: [Swift.String]) { + self.apps = apps } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case apps } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/PUT/requestBody/content/application\/json`. case json(Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -33121,7 +33133,7 @@ public enum Operations { public init( path: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_set_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -33291,61 +33303,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json/case1/apps`. - public var apps: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. - public init(apps: [Swift.String]) { - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case apps - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json/case1`. - case case1(Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/json/apps`. + public var apps: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - apps: The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + public init(apps: [Swift.String]) { + self.apps = apps } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case apps } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps/DELETE/requestBody/content/application\/json`. case json(Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -33355,7 +33332,7 @@ public enum Operations { public init( path: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_remove_hyphen_app_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -34583,61 +34560,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The username for users - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json/case1/users`. - public var users: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - users: The username for users - public init(users: [Swift.String]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json/case1`. - case case1(Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The username for users + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/json/users`. + public var users: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - users: The username for users + public init(users: [Swift.String]) { + self.users = users } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case users } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/POST/requestBody/content/application\/json`. case json(Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -34647,7 +34589,7 @@ public enum Operations { public init( path: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_add_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -34821,61 +34763,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The username for users - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json/case1/users`. - public var users: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - users: The username for users - public init(users: [Swift.String]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json/case1`. - case case1(Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The username for users + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/json/users`. + public var users: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - users: The username for users + public init(users: [Swift.String]) { + self.users = users } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case users } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/PUT/requestBody/content/application\/json`. case json(Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -34885,7 +34792,7 @@ public enum Operations { public init( path: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_set_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -35059,61 +34966,26 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The username for users - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json/case1/users`. - public var users: [Swift.String] - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - users: The username for users - public init(users: [Swift.String]) { - self.users = users - } - public enum CodingKeys: String, CodingKey { - case users - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json/case1`. - case case1(Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + public struct jsonPayload: Codable, Hashable, Sendable { + /// The username for users + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/json/users`. + public var users: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - users: The username for users + public init(users: [Swift.String]) { + self.users = users } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case users } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users/DELETE/requestBody/content/application\/json`. case json(Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body.jsonPayload) } - public var body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? + public var body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -35123,7 +34995,7 @@ public enum Operations { public init( path: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Path, headers: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Headers = .init(), - body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body? = nil + body: Operations.repos_sol_remove_hyphen_user_hyphen_access_hyphen_restrictions.Input.Body ) { self.path = path self.headers = headers @@ -38225,7 +38097,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/commits/{commit_sha}/comments/POST/requestBody/json/position`. public var position: Swift.Int? - /// **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. + /// **Closing down notice**. Use **position** parameter instead. Line number in the file to comment on. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/commits/{commit_sha}/comments/POST/requestBody/json/line`. public var line: Swift.Int? @@ -38235,7 +38107,7 @@ public enum Operations { /// - body: The contents of the comment. /// - path: Relative path of the file to comment on. /// - position: Line index in the diff to comment on. - /// - line: **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. + /// - line: **Closing down notice**. Use **position** parameter instead. Line number in the file to comment on. public init( body: Swift.String, path: Swift.String? = nil, @@ -39959,85 +39831,6 @@ public enum Operations { switch self { case let .application_vnd_period_github_period_object(body): return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/vnd.github.object", - body: self - ) - } - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/json/case1`. - case content_hyphen_directory(Components.Schemas.content_hyphen_directory) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/json/case2`. - case content_hyphen_file(Components.Schemas.content_hyphen_file) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/json/case3`. - case content_hyphen_symlink(Components.Schemas.content_hyphen_symlink) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/json/case4`. - case content_hyphen_submodule(Components.Schemas.content_hyphen_submodule) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .content_hyphen_directory(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .content_hyphen_file(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .content_hyphen_symlink(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .content_hyphen_submodule(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .content_hyphen_directory(value): - try encoder.encodeToSingleValueContainer(value) - case let .content_hyphen_file(value): - try value.encode(to: encoder) - case let .content_hyphen_symlink(value): - try value.encode(to: encoder) - case let .content_hyphen_submodule(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/contents/{path}/GET/responses/200/content/application\/json`. - case json(Operations.repos_sol_get_hyphen_content.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.repos_sol_get_hyphen_content.Output.Ok.Body.jsonPayload { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) } } } @@ -43063,7 +42856,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dispatches/POST/requestBody/json/event_type`. public var event_type: Swift.String - /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dispatches/POST/requestBody/json/client_payload`. public struct client_payloadPayload: Codable, Hashable, Sendable { @@ -43083,7 +42876,7 @@ public enum Operations { try encoder.encodeAdditionalProperties(additionalProperties) } } - /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + /// JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dispatches/POST/requestBody/json/client_payload`. public var client_payload: Operations.repos_sol_create_hyphen_dispatch_hyphen_event.Input.Body.jsonPayload.client_payloadPayload? @@ -43091,7 +42884,7 @@ public enum Operations { /// /// - Parameters: /// - event_type: A custom webhook event name. Must be 100 characters or fewer. - /// - client_payload: JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + /// - client_payload: JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB. public init( event_type: Swift.String, client_payload: Operations.repos_sol_create_hyphen_dispatch_hyphen_event.Input.Body.jsonPayload.client_payloadPayload? = nil @@ -47680,22 +47473,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.repos_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query @@ -54701,7 +54489,13 @@ public enum Operations { } /// Get a release asset /// - /// To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + /// To download the asset's binary content: + /// + /// - If within a browser, fetch the location specified in the `browser_download_url` key provided in the response. + /// - Alternatively, set the `Accept` header of the request to + /// [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// The API will either redirect the client to the location, or stream it directly if possible. + /// API clients should handle both a `200` or `302` response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/releases/assets/{asset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/get(repos/get-release-asset)`. @@ -56890,20 +56684,30 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/GET/query/includes_parents`. public var includes_parents: Swift.Bool? + /// A comma-separated list of rule targets to filter by. + /// If provided, only rulesets that apply to the specified targets will be returned. + /// For example, `branch,tag,push`. + /// + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/GET/query/targets`. + public var targets: Components.Parameters.ruleset_hyphen_targets? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - includes_parents: Include rulesets configured at higher levels that apply to this repository + /// - targets: A comma-separated list of rule targets to filter by. public init( per_page: Components.Parameters.per_hyphen_page? = nil, page: Components.Parameters.page? = nil, - includes_parents: Swift.Bool? = nil + includes_parents: Swift.Bool? = nil, + targets: Components.Parameters.ruleset_hyphen_targets? = nil ) { self.per_page = per_page self.page = page self.includes_parents = includes_parents + self.targets = targets } } public var query: Operations.repos_sol_get_hyphen_repo_hyphen_rulesets.Input.Query @@ -57119,9 +56923,6 @@ public enum Operations { public var name: Swift.String /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/POST/requestBody/json/target`. @frozen public enum targetPayload: String, Codable, Hashable, Sendable { case branch = "branch" @@ -57130,9 +56931,6 @@ public enum Operations { } /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/POST/requestBody/json/target`. public var target: Operations.repos_sol_create_hyphen_repo_hyphen_ruleset.Input.Body.jsonPayload.targetPayload? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/POST/requestBody/json/enforcement`. @@ -57367,7 +57165,6 @@ public enum Operations { public struct Query: Sendable, Hashable { /// The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. /// - /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/rule-suites/GET/query/ref`. public var ref: Components.Parameters.ref_hyphen_in_hyphen_query? /// - Remark: Generated from `#/components/parameters/time-period`. @@ -58064,9 +57861,6 @@ public enum Operations { public var name: Swift.String? /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/PUT/requestBody/json/target`. @frozen public enum targetPayload: String, Codable, Hashable, Sendable { case branch = "branch" @@ -58075,9 +57869,6 @@ public enum Operations { } /// The target of the ruleset /// - /// > [!NOTE] - /// > The `push` target is in beta and is subject to change. - /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/PUT/requestBody/json/target`. public var target: Operations.repos_sol_update_hyphen_repo_hyphen_ruleset.Input.Body.jsonPayload.targetPayload? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/PUT/requestBody/json/enforcement`. @@ -59799,10 +59590,10 @@ public enum Operations { } } } - /// Deprecated - List tag protection states for a repository + /// Closing down - List tag protection states for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead. /// /// This returns the tag protection states of a repository. /// @@ -59991,10 +59782,10 @@ public enum Operations { } } } - /// Deprecated - Create a tag protection state for a repository + /// Closing down - Create a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead. /// /// This creates a tag protection state for a repository. /// This endpoint is only available to repository administrators. @@ -60208,10 +59999,10 @@ public enum Operations { } } } - /// Deprecated - Delete a tag protection state for a repository + /// Closing down - Delete a tag protection state for a repository /// /// > [!WARNING] - /// > **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. + /// > **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead. /// /// This deletes a tag protection state for a repository. /// This endpoint is only available to repository administrators. diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 2fb5e9d41fa..682f5a19352 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -375,6 +375,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -399,6 +401,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -420,7 +423,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -443,6 +447,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -466,6 +471,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -551,6 +557,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -575,6 +583,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -596,7 +605,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -619,6 +629,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -642,6 +653,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -1066,7 +1078,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -1254,7 +1266,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -2156,6 +2168,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2164,18 +2198,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2183,6 +2220,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -4513,6 +4551,8 @@ public enum Components { public var company: Swift.String? /// - Remark: Generated from `#/components/schemas/user-search-result-item/suspended_at`. public var suspended_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/user-search-result-item/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `user_hyphen_search_hyphen_result_hyphen_item`. /// /// - Parameters: @@ -4550,6 +4590,7 @@ public enum Components { /// - blog: /// - company: /// - suspended_at: + /// - user_view_type: public init( login: Swift.String, id: Swift.Int64, @@ -4584,7 +4625,8 @@ public enum Components { text_matches: Components.Schemas.search_hyphen_result_hyphen_text_hyphen_matches? = nil, blog: Swift.String? = nil, company: Swift.String? = nil, - suspended_at: Foundation.Date? = nil + suspended_at: Foundation.Date? = nil, + user_view_type: Swift.String? = nil ) { self.login = login self.id = id @@ -4620,6 +4662,7 @@ public enum Components { self.blog = blog self.company = company self.suspended_at = suspended_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case login @@ -4656,6 +4699,7 @@ public enum Components { case blog case company case suspended_at + case user_view_type } } } @@ -4871,7 +4915,7 @@ public enum Operations { @frozen public enum sortPayload: String, Codable, Hashable, Sendable { case indexed = "indexed" } - /// **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + /// **This field is closing down.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) /// /// - Remark: Generated from `#/paths/search/code/GET/query/sort`. @available(*, deprecated) @@ -4881,7 +4925,7 @@ public enum Operations { case desc = "desc" case asc = "asc" } - /// **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + /// **This field is closing down.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. /// /// - Remark: Generated from `#/paths/search/code/GET/query/order`. @available(*, deprecated) @@ -4898,8 +4942,8 @@ public enum Operations { /// /// - Parameters: /// - q: The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching code](https://docs.github.com/search-github/searching-on-github/searching-code)" for a detailed list of qualifiers. - /// - sort: **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) - /// - order: **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + /// - sort: **This field is closing down.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + /// - order: **This field is closing down.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index c66162b2ebb..e64a11ba3b0 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -129,6 +129,20 @@ public struct Client: APIProtocol { name: "validity", value: input.query.validity ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_publicly_leaked", + value: input.query.is_publicly_leaked + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_multi_repo", + value: input.query.is_multi_repo + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -319,6 +333,20 @@ public struct Client: APIProtocol { name: "validity", value: input.query.validity ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_publicly_leaked", + value: input.query.is_publicly_leaked + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_multi_repo", + value: input.query.is_multi_repo + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -510,6 +538,20 @@ public struct Client: APIProtocol { name: "validity", value: input.query.validity ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_publicly_leaked", + value: input.query.is_publicly_leaked + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_multi_repo", + value: input.query.is_multi_repo + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 7e1c7b29706..01039b04b1f 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -303,6 +303,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -327,6 +329,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -348,7 +351,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -371,6 +375,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -394,6 +399,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -479,6 +485,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -503,6 +511,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -524,7 +533,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -547,6 +557,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -570,6 +581,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// The security alert number. @@ -1038,6 +1050,16 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed_at`. public var push_protection_bypassed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer`. + public var push_protection_bypass_request_reviewer: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// An optional comment when requesting a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_comment`. + public var push_protection_bypass_request_comment: Swift.String? + /// The URL to a push protection bypass request. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_html_url`. + public var push_protection_bypass_request_html_url: Swift.String? /// The comment that was optionally added when this alert was closed /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolution_comment`. @@ -1054,6 +1076,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/validity`. public var validity: Components.Schemas.organization_hyphen_secret_hyphen_scanning_hyphen_alert.validityPayload? + /// Whether the secret was publicly leaked. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/publicly_leaked`. + public var publicly_leaked: Swift.Bool? + /// Whether the detected secret was found in multiple repositories in the same organization or enterprise. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/multi_repo`. + public var multi_repo: Swift.Bool? /// Creates a new `organization_hyphen_secret_hyphen_scanning_hyphen_alert`. /// /// - Parameters: @@ -1074,8 +1104,13 @@ public enum Components { /// - push_protection_bypassed: Whether push protection was bypassed for the detected secret. /// - push_protection_bypassed_by: /// - push_protection_bypassed_at: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - push_protection_bypass_request_reviewer: + /// - push_protection_bypass_request_comment: An optional comment when requesting a push protection bypass. + /// - push_protection_bypass_request_html_url: The URL to a push protection bypass request. /// - resolution_comment: The comment that was optionally added when this alert was closed /// - validity: The token status as of the latest validity check. + /// - publicly_leaked: Whether the secret was publicly leaked. + /// - multi_repo: Whether the detected secret was found in multiple repositories in the same organization or enterprise. public init( number: Components.Schemas.alert_hyphen_number? = nil, created_at: Components.Schemas.alert_hyphen_created_hyphen_at? = nil, @@ -1094,8 +1129,13 @@ public enum Components { push_protection_bypassed: Swift.Bool? = nil, push_protection_bypassed_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, push_protection_bypassed_at: Foundation.Date? = nil, + push_protection_bypass_request_reviewer: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + push_protection_bypass_request_comment: Swift.String? = nil, + push_protection_bypass_request_html_url: Swift.String? = nil, resolution_comment: Swift.String? = nil, - validity: Components.Schemas.organization_hyphen_secret_hyphen_scanning_hyphen_alert.validityPayload? = nil + validity: Components.Schemas.organization_hyphen_secret_hyphen_scanning_hyphen_alert.validityPayload? = nil, + publicly_leaked: Swift.Bool? = nil, + multi_repo: Swift.Bool? = nil ) { self.number = number self.created_at = created_at @@ -1114,8 +1154,13 @@ public enum Components { self.push_protection_bypassed = push_protection_bypassed self.push_protection_bypassed_by = push_protection_bypassed_by self.push_protection_bypassed_at = push_protection_bypassed_at + self.push_protection_bypass_request_reviewer = push_protection_bypass_request_reviewer + self.push_protection_bypass_request_comment = push_protection_bypass_request_comment + self.push_protection_bypass_request_html_url = push_protection_bypass_request_html_url self.resolution_comment = resolution_comment self.validity = validity + self.publicly_leaked = publicly_leaked + self.multi_repo = multi_repo } public enum CodingKeys: String, CodingKey { case number @@ -1135,8 +1180,13 @@ public enum Components { case push_protection_bypassed case push_protection_bypassed_by case push_protection_bypassed_at + case push_protection_bypass_request_reviewer + case push_protection_bypass_request_comment + case push_protection_bypass_request_html_url case resolution_comment case validity + case publicly_leaked + case multi_repo } } /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. @@ -1196,6 +1246,16 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed_at`. public var push_protection_bypassed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer`. + public var push_protection_bypass_request_reviewer: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// An optional comment when requesting a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_comment`. + public var push_protection_bypass_request_comment: Swift.String? + /// The URL to a push protection bypass request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_html_url`. + public var push_protection_bypass_request_html_url: Swift.String? /// The token status as of the latest validity check. /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. @@ -1208,6 +1268,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. public var validity: Components.Schemas.secret_hyphen_scanning_hyphen_alert.validityPayload? + /// Whether the detected secret was publicly leaked. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/publicly_leaked`. + public var publicly_leaked: Swift.Bool? + /// Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/multi_repo`. + public var multi_repo: Swift.Bool? /// Creates a new `secret_hyphen_scanning_hyphen_alert`. /// /// - Parameters: @@ -1228,7 +1296,12 @@ public enum Components { /// - push_protection_bypassed: Whether push protection was bypassed for the detected secret. /// - push_protection_bypassed_by: /// - push_protection_bypassed_at: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - push_protection_bypass_request_reviewer: + /// - push_protection_bypass_request_comment: An optional comment when requesting a push protection bypass. + /// - push_protection_bypass_request_html_url: The URL to a push protection bypass request. /// - validity: The token status as of the latest validity check. + /// - publicly_leaked: Whether the detected secret was publicly leaked. + /// - multi_repo: Whether the detected secret was found in multiple repositories under the same organization or enterprise. public init( number: Components.Schemas.alert_hyphen_number? = nil, created_at: Components.Schemas.alert_hyphen_created_hyphen_at? = nil, @@ -1247,7 +1320,12 @@ public enum Components { push_protection_bypassed: Swift.Bool? = nil, push_protection_bypassed_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, push_protection_bypassed_at: Foundation.Date? = nil, - validity: Components.Schemas.secret_hyphen_scanning_hyphen_alert.validityPayload? = nil + push_protection_bypass_request_reviewer: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + push_protection_bypass_request_comment: Swift.String? = nil, + push_protection_bypass_request_html_url: Swift.String? = nil, + validity: Components.Schemas.secret_hyphen_scanning_hyphen_alert.validityPayload? = nil, + publicly_leaked: Swift.Bool? = nil, + multi_repo: Swift.Bool? = nil ) { self.number = number self.created_at = created_at @@ -1266,7 +1344,12 @@ public enum Components { self.push_protection_bypassed = push_protection_bypassed self.push_protection_bypassed_by = push_protection_bypassed_by self.push_protection_bypassed_at = push_protection_bypassed_at + self.push_protection_bypass_request_reviewer = push_protection_bypass_request_reviewer + self.push_protection_bypass_request_comment = push_protection_bypass_request_comment + self.push_protection_bypass_request_html_url = push_protection_bypass_request_html_url self.validity = validity + self.publicly_leaked = publicly_leaked + self.multi_repo = multi_repo } public enum CodingKeys: String, CodingKey { case number @@ -1286,7 +1369,12 @@ public enum Components { case push_protection_bypassed case push_protection_bypassed_by case push_protection_bypassed_at + case push_protection_bypass_request_reviewer + case push_protection_bypass_request_comment + case push_protection_bypass_request_html_url case validity + case publicly_leaked + case multi_repo } } /// An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. @@ -1959,6 +2047,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-validity`. public typealias secret_hyphen_scanning_hyphen_alert_hyphen_validity = Swift.String + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-publicly-leaked`. + public typealias secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked = Swift.Bool + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-multi-repo`. + public typealias secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo = Swift.Bool /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -2172,6 +2268,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/validity`. public var validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/is_publicly_leaked`. + public var is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/is_multi_repo`. + public var is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? /// Creates a new `Query`. /// /// - Parameters: @@ -2184,6 +2288,8 @@ public enum Operations { /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + /// - is_publicly_leaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// - is_multi_repo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. public init( state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? = nil, secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? = nil, @@ -2193,7 +2299,9 @@ public enum Operations { per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.pagination_hyphen_before? = nil, after: Components.Parameters.pagination_hyphen_after? = nil, - validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil + validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil, + is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? = nil, + is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? = nil ) { self.state = state self.secret_type = secret_type @@ -2204,6 +2312,8 @@ public enum Operations { self.before = before self.after = after self.validity = validity + self.is_publicly_leaked = is_publicly_leaked + self.is_multi_repo = is_multi_repo } } public var query: Operations.secret_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_enterprise.Input.Query @@ -2470,6 +2580,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/validity`. public var validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_publicly_leaked`. + public var is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_multi_repo`. + public var is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? /// Creates a new `Query`. /// /// - Parameters: @@ -2483,6 +2601,8 @@ public enum Operations { /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + /// - is_publicly_leaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// - is_multi_repo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. public init( state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? = nil, secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? = nil, @@ -2493,7 +2613,9 @@ public enum Operations { per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.secret_hyphen_scanning_hyphen_pagination_hyphen_before_hyphen_org_hyphen_repo? = nil, after: Components.Parameters.secret_hyphen_scanning_hyphen_pagination_hyphen_after_hyphen_org_hyphen_repo? = nil, - validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil + validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil, + is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? = nil, + is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? = nil ) { self.state = state self.secret_type = secret_type @@ -2505,6 +2627,8 @@ public enum Operations { self.before = before self.after = after self.validity = validity + self.is_publicly_leaked = is_publicly_leaked + self.is_multi_repo = is_multi_repo } } public var query: Operations.secret_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_org.Input.Query @@ -2780,6 +2904,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/validity`. public var validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_publicly_leaked`. + public var is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_multi_repo`. + public var is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? /// Creates a new `Query`. /// /// - Parameters: @@ -2793,6 +2925,8 @@ public enum Operations { /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + /// - is_publicly_leaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// - is_multi_repo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. public init( state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? = nil, secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? = nil, @@ -2803,7 +2937,9 @@ public enum Operations { per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.secret_hyphen_scanning_hyphen_pagination_hyphen_before_hyphen_org_hyphen_repo? = nil, after: Components.Parameters.secret_hyphen_scanning_hyphen_pagination_hyphen_after_hyphen_org_hyphen_repo? = nil, - validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil + validity: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_validity? = nil, + is_publicly_leaked: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_publicly_hyphen_leaked? = nil, + is_multi_repo: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_multi_hyphen_repo? = nil ) { self.state = state self.secret_type = secret_type @@ -2815,6 +2951,8 @@ public enum Operations { self.before = before self.after = after self.validity = validity + self.is_publicly_leaked = is_publicly_leaked + self.is_multi_repo = is_multi_repo } } public var query: Operations.secret_hyphen_scanning_sol_list_hyphen_alerts_hyphen_for_hyphen_repo.Input.Query diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index 4f7aa8f66c4..55c347a5955 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -423,6 +423,83 @@ public enum Components { case vulnerable_functions } } + /// - Remark: Generated from `#/components/schemas/cvss-severities`. + public struct cvss_hyphen_severities: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3`. + public struct cvss_v3Payload: Codable, Hashable, Sendable { + /// The CVSS 3 vector string. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3/vector_string`. + public var vector_string: Swift.String? + /// The CVSS 3 score. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3/score`. + public var score: Swift.Double? + /// Creates a new `cvss_v3Payload`. + /// + /// - Parameters: + /// - vector_string: The CVSS 3 vector string. + /// - score: The CVSS 3 score. + public init( + vector_string: Swift.String? = nil, + score: Swift.Double? = nil + ) { + self.vector_string = vector_string + self.score = score + } + public enum CodingKeys: String, CodingKey { + case vector_string + case score + } + } + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v3`. + public var cvss_v3: Components.Schemas.cvss_hyphen_severities.cvss_v3Payload? + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4`. + public struct cvss_v4Payload: Codable, Hashable, Sendable { + /// The CVSS 4 vector string. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4/vector_string`. + public var vector_string: Swift.String? + /// The CVSS 4 score. + /// + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4/score`. + public var score: Swift.Double? + /// Creates a new `cvss_v4Payload`. + /// + /// - Parameters: + /// - vector_string: The CVSS 4 vector string. + /// - score: The CVSS 4 score. + public init( + vector_string: Swift.String? = nil, + score: Swift.Double? = nil + ) { + self.vector_string = vector_string + self.score = score + } + public enum CodingKeys: String, CodingKey { + case vector_string + case score + } + } + /// - Remark: Generated from `#/components/schemas/cvss-severities/cvss_v4`. + public var cvss_v4: Components.Schemas.cvss_hyphen_severities.cvss_v4Payload? + /// Creates a new `cvss_hyphen_severities`. + /// + /// - Parameters: + /// - cvss_v3: + /// - cvss_v4: + public init( + cvss_v3: Components.Schemas.cvss_hyphen_severities.cvss_v3Payload? = nil, + cvss_v4: Components.Schemas.cvss_hyphen_severities.cvss_v4Payload? = nil + ) { + self.cvss_v3 = cvss_v3 + self.cvss_v4 = cvss_v4 + } + public enum CodingKeys: String, CodingKey { + case cvss_v3 + case cvss_v4 + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/simple-user`. @@ -469,6 +546,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -493,6 +572,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -514,7 +594,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -537,6 +618,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -560,6 +642,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// The type of credit the user is receiving. @@ -733,6 +816,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/global-advisory/cvss`. public var cvss: Components.Schemas.global_hyphen_advisory.cvssPayload? + /// - Remark: Generated from `#/components/schemas/global-advisory/cvss_severities`. + public var cvss_severities: Components.Schemas.cvss_hyphen_severities? /// - Remark: Generated from `#/components/schemas/global-advisory/cwesPayload`. public struct cwesPayloadPayload: Codable, Hashable, Sendable { /// The Common Weakness Enumeration (CWE) identifier. @@ -842,6 +927,7 @@ public enum Components { /// - withdrawn_at: The date and time of when the advisory was withdrawn, in ISO 8601 format. /// - vulnerabilities: The products and respective version ranges affected by the advisory. /// - cvss: + /// - cvss_severities: /// - cwes: /// - epss: /// - credits: The users who contributed to the advisory. @@ -865,6 +951,7 @@ public enum Components { withdrawn_at: Foundation.Date? = nil, vulnerabilities: [Components.Schemas.vulnerability]? = nil, cvss: Components.Schemas.global_hyphen_advisory.cvssPayload? = nil, + cvss_severities: Components.Schemas.cvss_hyphen_severities? = nil, cwes: Components.Schemas.global_hyphen_advisory.cwesPayload? = nil, epss: Components.Schemas.global_hyphen_advisory.epssPayload? = nil, credits: Components.Schemas.global_hyphen_advisory.creditsPayload? = nil @@ -888,6 +975,7 @@ public enum Components { self.withdrawn_at = withdrawn_at self.vulnerabilities = vulnerabilities self.cvss = cvss + self.cvss_severities = cvss_severities self.cwes = cwes self.epss = epss self.credits = credits @@ -912,6 +1000,7 @@ public enum Components { case withdrawn_at case vulnerabilities case cvss + case cvss_severities case cwes case epss case credits @@ -994,6 +1083,10 @@ public enum Components { Components.Schemas.global_hyphen_advisory.cvssPayload.self, forKey: .cvss ) + cvss_severities = try container.decodeIfPresent( + Components.Schemas.cvss_hyphen_severities.self, + forKey: .cvss_severities + ) cwes = try container.decodeIfPresent( Components.Schemas.global_hyphen_advisory.cwesPayload.self, forKey: .cwes @@ -1026,6 +1119,7 @@ public enum Components { "withdrawn_at", "vulnerabilities", "cvss", + "cvss_severities", "cwes", "epss", "credits" @@ -1146,6 +1240,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -1170,6 +1266,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1191,7 +1288,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1214,6 +1312,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1237,6 +1336,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Scim Error @@ -1710,7 +1810,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -1898,7 +1998,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -2946,6 +3046,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2954,18 +3076,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2973,6 +3098,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// A repository on GitHub. @@ -3223,7 +3349,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/allow_update_branch`. public var allow_update_branch: Swift.Bool? - /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/use_squash_pr_title_as_default`. @available(*, deprecated) @@ -3411,7 +3537,7 @@ public enum Components { /// - allow_auto_merge: Whether to allow Auto-merge to be used on pull requests. /// - delete_branch_on_merge: Whether to delete head branches when pull requests are merged /// - allow_update_branch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. - /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + /// - use_squash_pr_title_as_default: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. /// - squash_merge_commit_title: The default value for a squash merge commit title: /// - squash_merge_commit_message: The default value for a squash merge commit message: /// - merge_commit_title: The default value for a merge commit title. @@ -4889,6 +5015,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-advisory/cvss`. public var cvss: Components.Schemas.repository_hyphen_advisory.cvssPayload? + /// - Remark: Generated from `#/components/schemas/repository-advisory/cvss_severities`. + public var cvss_severities: Components.Schemas.cvss_hyphen_severities? /// - Remark: Generated from `#/components/schemas/repository-advisory/cwesPayload`. public struct cwesPayloadPayload: Codable, Hashable, Sendable { /// The Common Weakness Enumeration (CWE) identifier. @@ -5009,6 +5137,7 @@ public enum Components { /// - submission: /// - vulnerabilities: /// - cvss: + /// - cvss_severities: /// - cwes: /// - cwe_ids: A list of only the CWE IDs. /// - credits: @@ -5036,6 +5165,7 @@ public enum Components { submission: Components.Schemas.repository_hyphen_advisory.submissionPayload? = nil, vulnerabilities: [Components.Schemas.repository_hyphen_advisory_hyphen_vulnerability]? = nil, cvss: Components.Schemas.repository_hyphen_advisory.cvssPayload? = nil, + cvss_severities: Components.Schemas.cvss_hyphen_severities? = nil, cwes: Components.Schemas.repository_hyphen_advisory.cwesPayload? = nil, cwe_ids: [Swift.String]? = nil, credits: Components.Schemas.repository_hyphen_advisory.creditsPayload? = nil, @@ -5063,6 +5193,7 @@ public enum Components { self.submission = submission self.vulnerabilities = vulnerabilities self.cvss = cvss + self.cvss_severities = cvss_severities self.cwes = cwes self.cwe_ids = cwe_ids self.credits = credits @@ -5091,6 +5222,7 @@ public enum Components { case submission case vulnerabilities case cvss + case cvss_severities case cwes case cwe_ids case credits @@ -5177,6 +5309,10 @@ public enum Components { Components.Schemas.repository_hyphen_advisory.cvssPayload.self, forKey: .cvss ) + cvss_severities = try container.decodeIfPresent( + Components.Schemas.cvss_hyphen_severities.self, + forKey: .cvss_severities + ) cwes = try container.decodeIfPresent( Components.Schemas.repository_hyphen_advisory.cwesPayload.self, forKey: .cwes @@ -5225,6 +5361,7 @@ public enum Components { "submission", "vulnerabilities", "cvss", + "cvss_severities", "cwes", "cwe_ids", "credits", diff --git a/Sources/teams/Client.swift b/Sources/teams/Client.swift index 50c05979d3d..6909dfcfd7b 100644 --- a/Sources/teams/Client.swift +++ b/Sources/teams/Client.swift @@ -2403,7 +2403,7 @@ public struct Client: APIProtocol { /// Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. @@ -2491,7 +2491,7 @@ public struct Client: APIProtocol { /// Update a team (Legacy) /// /// > [!WARNING] - /// > **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 [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// @@ -2659,7 +2659,7 @@ public struct Client: APIProtocol { /// Delete a team (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -2753,7 +2753,7 @@ public struct Client: APIProtocol { /// List discussions (Legacy) /// /// > [!WARNING] - /// > **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 discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -2852,7 +2852,7 @@ public struct Client: APIProtocol { /// Create a discussion (Legacy) /// /// > [!WARNING] - /// > **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 a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -2933,7 +2933,7 @@ public struct Client: APIProtocol { /// Get a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -3004,7 +3004,7 @@ public struct Client: APIProtocol { /// Update a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -3086,7 +3086,7 @@ public struct Client: APIProtocol { /// Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -3133,7 +3133,7 @@ public struct Client: APIProtocol { /// List discussion comments (Legacy) /// /// > [!WARNING] - /// > **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 discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -3233,7 +3233,7 @@ public struct Client: APIProtocol { /// Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -3315,7 +3315,7 @@ public struct Client: APIProtocol { /// Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -3387,7 +3387,7 @@ public struct Client: APIProtocol { /// Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -3468,7 +3468,7 @@ public struct Client: APIProtocol { /// Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -3516,7 +3516,7 @@ public struct Client: APIProtocol { /// List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **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 pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -3606,7 +3606,7 @@ public struct Client: APIProtocol { /// List team members (Legacy) /// /// > [!WARNING] - /// > **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 team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -3724,7 +3724,7 @@ public struct Client: APIProtocol { } /// Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -3772,7 +3772,7 @@ public struct Client: APIProtocol { } /// Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -3855,7 +3855,7 @@ public struct Client: APIProtocol { } /// Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -3909,7 +3909,7 @@ public struct Client: APIProtocol { /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -4007,7 +4007,7 @@ public struct Client: APIProtocol { /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -4122,7 +4122,7 @@ public struct Client: APIProtocol { /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -4174,7 +4174,7 @@ public struct Client: APIProtocol { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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 team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -4286,7 +4286,7 @@ public struct Client: APIProtocol { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -4357,7 +4357,7 @@ public struct Client: APIProtocol { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. 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. The project and team must be part of the same organization. /// @@ -4483,7 +4483,7 @@ public struct Client: APIProtocol { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -4576,7 +4576,7 @@ public struct Client: APIProtocol { /// List team repositories (Legacy) /// /// > [!WARNING] - /// > **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 team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/repos`. /// - Remark: Generated from `#/paths//teams/{team_id}/repos/get(teams/list-repos-legacy)`. @@ -4686,7 +4686,7 @@ public struct Client: APIProtocol { /// Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -4763,7 +4763,7 @@ public struct Client: APIProtocol { /// Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **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 "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -4870,7 +4870,7 @@ public struct Client: APIProtocol { /// Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -4916,7 +4916,7 @@ public struct Client: APIProtocol { /// List child teams (Legacy) /// /// > [!WARNING] - /// > **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 child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/teams`. /// - Remark: Generated from `#/paths//teams/{team_id}/teams/get(teams/list-child-legacy)`. diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 9b55f8ce3fb..3daad2d0994 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -354,7 +354,7 @@ public protocol APIProtocol: Sendable { /// Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. @@ -363,7 +363,7 @@ public protocol APIProtocol: Sendable { /// Update a team (Legacy) /// /// > [!WARNING] - /// > **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 [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// @@ -377,7 +377,7 @@ public protocol APIProtocol: Sendable { /// Delete a team (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -390,7 +390,7 @@ public protocol APIProtocol: Sendable { /// List discussions (Legacy) /// /// > [!WARNING] - /// > **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 discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -403,7 +403,7 @@ public protocol APIProtocol: Sendable { /// Create a discussion (Legacy) /// /// > [!WARNING] - /// > **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 a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -418,7 +418,7 @@ public protocol APIProtocol: Sendable { /// Get a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -431,7 +431,7 @@ public protocol APIProtocol: Sendable { /// Update a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -444,7 +444,7 @@ public protocol APIProtocol: Sendable { /// Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -457,7 +457,7 @@ public protocol APIProtocol: Sendable { /// List discussion comments (Legacy) /// /// > [!WARNING] - /// > **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 discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -470,7 +470,7 @@ public protocol APIProtocol: Sendable { /// Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -485,7 +485,7 @@ public protocol APIProtocol: Sendable { /// Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -498,7 +498,7 @@ public protocol APIProtocol: Sendable { /// Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -511,7 +511,7 @@ public protocol APIProtocol: Sendable { /// Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -524,7 +524,7 @@ public protocol APIProtocol: Sendable { /// List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **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 pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -535,7 +535,7 @@ public protocol APIProtocol: Sendable { /// List team members (Legacy) /// /// > [!WARNING] - /// > **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 team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -545,7 +545,7 @@ public protocol APIProtocol: Sendable { func teams_sol_list_hyphen_members_hyphen_legacy(_ input: Operations.teams_sol_list_hyphen_members_hyphen_legacy.Input) async throws -> Operations.teams_sol_list_hyphen_members_hyphen_legacy.Output /// Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -557,7 +557,7 @@ public protocol APIProtocol: Sendable { func teams_sol_get_hyphen_member_hyphen_legacy(_ input: Operations.teams_sol_get_hyphen_member_hyphen_legacy.Input) async throws -> Operations.teams_sol_get_hyphen_member_hyphen_legacy.Output /// Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -576,7 +576,7 @@ public protocol APIProtocol: Sendable { func teams_sol_add_hyphen_member_hyphen_legacy(_ input: Operations.teams_sol_add_hyphen_member_hyphen_legacy.Input) async throws -> Operations.teams_sol_add_hyphen_member_hyphen_legacy.Output /// Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -594,7 +594,7 @@ public protocol APIProtocol: Sendable { /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -612,7 +612,7 @@ public protocol APIProtocol: Sendable { /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -632,7 +632,7 @@ public protocol APIProtocol: Sendable { /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -648,7 +648,7 @@ public protocol APIProtocol: Sendable { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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 team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -659,7 +659,7 @@ public protocol APIProtocol: Sendable { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -670,7 +670,7 @@ public protocol APIProtocol: Sendable { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. 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. The project and team must be part of the same organization. /// @@ -681,7 +681,7 @@ public protocol APIProtocol: Sendable { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -692,7 +692,7 @@ public protocol APIProtocol: Sendable { /// List team repositories (Legacy) /// /// > [!WARNING] - /// > **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 team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/repos`. /// - Remark: Generated from `#/paths//teams/{team_id}/repos/get(teams/list-repos-legacy)`. @@ -701,7 +701,7 @@ public protocol APIProtocol: Sendable { /// Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -715,7 +715,7 @@ public protocol APIProtocol: Sendable { /// Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **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 "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -728,7 +728,7 @@ public protocol APIProtocol: Sendable { /// Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -739,7 +739,7 @@ public protocol APIProtocol: Sendable { /// List child teams (Legacy) /// /// > [!WARNING] - /// > **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 child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/teams`. /// - Remark: Generated from `#/paths//teams/{team_id}/teams/get(teams/list-child-legacy)`. @@ -1332,7 +1332,7 @@ extension APIProtocol { /// Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. @@ -1349,7 +1349,7 @@ extension APIProtocol { /// Update a team (Legacy) /// /// > [!WARNING] - /// > **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 [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// @@ -1373,7 +1373,7 @@ extension APIProtocol { /// Delete a team (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -1394,7 +1394,7 @@ extension APIProtocol { /// List discussions (Legacy) /// /// > [!WARNING] - /// > **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 discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -1417,7 +1417,7 @@ extension APIProtocol { /// Create a discussion (Legacy) /// /// > [!WARNING] - /// > **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 a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -1442,7 +1442,7 @@ extension APIProtocol { /// Get a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -1463,7 +1463,7 @@ extension APIProtocol { /// Update a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -1486,7 +1486,7 @@ extension APIProtocol { /// Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -1501,7 +1501,7 @@ extension APIProtocol { /// List discussion comments (Legacy) /// /// > [!WARNING] - /// > **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 discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -1524,7 +1524,7 @@ extension APIProtocol { /// Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -1549,7 +1549,7 @@ extension APIProtocol { /// Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -1570,7 +1570,7 @@ extension APIProtocol { /// Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -1593,7 +1593,7 @@ extension APIProtocol { /// Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -1608,7 +1608,7 @@ extension APIProtocol { /// List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **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 pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -1629,7 +1629,7 @@ extension APIProtocol { /// List team members (Legacy) /// /// > [!WARNING] - /// > **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 team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -1649,7 +1649,7 @@ extension APIProtocol { } /// Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -1663,7 +1663,7 @@ extension APIProtocol { } /// Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -1690,7 +1690,7 @@ extension APIProtocol { } /// Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -1710,7 +1710,7 @@ extension APIProtocol { /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -1736,7 +1736,7 @@ extension APIProtocol { /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -1766,7 +1766,7 @@ extension APIProtocol { /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -1784,7 +1784,7 @@ extension APIProtocol { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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 team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -1805,7 +1805,7 @@ extension APIProtocol { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -1824,7 +1824,7 @@ extension APIProtocol { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. 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. The project and team must be part of the same organization. /// @@ -1845,7 +1845,7 @@ extension APIProtocol { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -1864,7 +1864,7 @@ extension APIProtocol { /// List team repositories (Legacy) /// /// > [!WARNING] - /// > **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 team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/repos`. /// - Remark: Generated from `#/paths//teams/{team_id}/repos/get(teams/list-repos-legacy)`. @@ -1883,7 +1883,7 @@ extension APIProtocol { /// Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -1905,7 +1905,7 @@ extension APIProtocol { /// Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **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 "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -1928,7 +1928,7 @@ extension APIProtocol { /// Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -1941,7 +1941,7 @@ extension APIProtocol { /// List child teams (Legacy) /// /// > [!WARNING] - /// > **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 child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/teams`. /// - Remark: Generated from `#/paths//teams/{team_id}/teams/get(teams/list-child-legacy)`. @@ -2039,6 +2039,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -2063,6 +2065,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -2084,7 +2087,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -2107,6 +2111,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -2130,6 +2135,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -2215,6 +2221,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: @@ -2239,6 +2247,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -2260,7 +2269,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -2283,6 +2293,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -2306,6 +2317,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Validation Error @@ -2961,6 +2973,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct secret_scanning_ai_detectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? + /// Creates a new `secret_scanning_ai_detectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? /// Creates a new `security_hyphen_and_hyphen_analysis`. /// /// - Parameters: @@ -2969,18 +3003,21 @@ public enum Components { /// - secret_scanning: /// - secret_scanning_push_protection: /// - secret_scanning_non_provider_patterns: + /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil, secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil, secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil, - secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil + secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_ai_detection = secret_scanning_ai_detection } public enum CodingKeys: String, CodingKey { case advanced_security @@ -2988,6 +3025,7 @@ public enum Components { case secret_scanning case secret_scanning_push_protection case secret_scanning_non_provider_patterns + case secret_scanning_ai_detection } } /// Minimal Repository @@ -5702,14 +5740,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/notification_setting`. public var notification_setting: Operations.teams_sol_create.Input.Body.jsonPayload.notification_settingPayload? - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/permission`. @frozen public enum permissionPayload: String, Codable, Hashable, Sendable { case pull = "pull" case push = "push" } - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/permission`. public var permission: Operations.teams_sol_create.Input.Body.jsonPayload.permissionPayload? @@ -5726,7 +5764,7 @@ public enum Operations { /// - repo_names: The full name (e.g., "organization-name/repository-name") of repositories to add the team to. /// - privacy: The level of privacy this team should have. The options are: /// - notification_setting: The notification setting the team has chosen. The options are: - /// - permission: **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// - permission: **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// - parent_team_id: The ID of a team to set as the parent team. public init( name: Swift.String, @@ -6170,7 +6208,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/PATCH/requestBody/json/notification_setting`. public var notification_setting: Operations.teams_sol_update_hyphen_in_hyphen_org.Input.Body.jsonPayload.notification_settingPayload? - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/PATCH/requestBody/json/permission`. @frozen public enum permissionPayload: String, Codable, Hashable, Sendable { @@ -6178,7 +6216,7 @@ public enum Operations { case push = "push" case admin = "admin" } - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/PATCH/requestBody/json/permission`. public var permission: Operations.teams_sol_update_hyphen_in_hyphen_org.Input.Body.jsonPayload.permissionPayload? @@ -6193,7 +6231,7 @@ public enum Operations { /// - description: The description of the team. /// - privacy: The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: /// - notification_setting: The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: - /// - permission: **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// - permission: **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// - parent_team_id: The ID of a team to set as the parent team. public init( name: Swift.String? = nil, @@ -10630,7 +10668,7 @@ public enum Operations { /// Get a team (Legacy) /// /// > [!WARNING] - /// > **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/get(teams/get-legacy)`. @@ -10786,7 +10824,7 @@ public enum Operations { /// Update a team (Legacy) /// /// > [!WARNING] - /// > **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 [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint. /// /// To edit a team, the authenticated user must either be an organization owner or a team maintainer. /// @@ -10873,7 +10911,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/notification_setting`. public var notification_setting: Operations.teams_sol_update_hyphen_legacy.Input.Body.jsonPayload.notification_settingPayload? - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. @frozen public enum permissionPayload: String, Codable, Hashable, Sendable { @@ -10881,7 +10919,7 @@ public enum Operations { case push = "push" case admin = "admin" } - /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// /// - Remark: Generated from `#/paths/teams/{team_id}/PATCH/requestBody/json/permission`. public var permission: Operations.teams_sol_update_hyphen_legacy.Input.Body.jsonPayload.permissionPayload? @@ -10896,7 +10934,7 @@ public enum Operations { /// - description: The description of the team. /// - privacy: The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: /// - notification_setting: The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: - /// - permission: **Deprecated**. The permission that new repositories will be added to the team with when none is specified. + /// - permission: **Closing down notice**. The permission that new repositories will be added to the team with when none is specified. /// - parent_team_id: The ID of a team to set as the parent team. public init( name: Swift.String, @@ -11148,7 +11186,7 @@ public enum Operations { /// Delete a team (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint. /// /// To delete a team, the authenticated user must be an organization owner or team maintainer. /// @@ -11307,7 +11345,7 @@ public enum Operations { /// List discussions (Legacy) /// /// > [!WARNING] - /// > **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 discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint. /// /// List all discussions on a team's page. /// @@ -11502,7 +11540,7 @@ public enum Operations { /// Create a discussion (Legacy) /// /// > [!WARNING] - /// > **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 a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint. /// /// Creates a new discussion post on a team's page. /// @@ -11685,7 +11723,7 @@ public enum Operations { /// Get a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint. /// /// Get a specific discussion on a team's page. /// @@ -11831,7 +11869,7 @@ public enum Operations { /// Update a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint. /// /// Edits the title and body text of a discussion post. Only the parameters you provide are updated. /// @@ -12013,7 +12051,7 @@ public enum Operations { /// Delete a discussion (Legacy) /// /// > [!WARNING] - /// > **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 [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint. /// /// Delete a discussion from a team's page. /// @@ -12093,7 +12131,7 @@ public enum Operations { /// List discussion comments (Legacy) /// /// > [!WARNING] - /// > **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 discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint. /// /// List all comments on a team discussion. /// @@ -12297,7 +12335,7 @@ public enum Operations { /// Create a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint. /// /// Creates a new comment on a team discussion. /// @@ -12471,7 +12509,7 @@ public enum Operations { /// Get a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint. /// /// Get a specific comment on a team discussion. /// @@ -12624,7 +12662,7 @@ public enum Operations { /// Update a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint. /// /// Edits the body text of a discussion comment. /// @@ -12803,7 +12841,7 @@ public enum Operations { /// Delete a discussion comment (Legacy) /// /// > [!WARNING] - /// > **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 [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint. /// /// Deletes a comment on a team discussion. /// @@ -12890,7 +12928,7 @@ public enum Operations { /// List pending team invitations (Legacy) /// /// > [!WARNING] - /// > **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 pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint. /// /// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. /// @@ -13071,7 +13109,7 @@ public enum Operations { /// List team members (Legacy) /// /// > [!WARNING] - /// > **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 team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint. /// /// Team members will include the members of child teams. /// @@ -13287,7 +13325,7 @@ public enum Operations { } /// Get team member (Legacy) /// - /// The "Get team member" endpoint (described below) is deprecated. + /// The "Get team member" endpoint (described below) is closing down. /// /// We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. /// @@ -13393,7 +13431,7 @@ public enum Operations { } /// Add team member (Legacy) /// - /// The "Add team member" endpoint (described below) is deprecated. + /// The "Add team member" endpoint (described below) is closing down. /// /// We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. /// @@ -13598,7 +13636,7 @@ public enum Operations { } /// Remove team member (Legacy) /// - /// The "Remove team member" endpoint (described below) is deprecated. + /// The "Remove team member" endpoint (described below) is closing down. /// /// We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. /// @@ -13710,7 +13748,7 @@ public enum Operations { /// Get team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint. /// /// Team members will include the members of child teams. /// @@ -13884,7 +13922,7 @@ public enum Operations { /// Add or update team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -14147,7 +14185,7 @@ public enum Operations { /// Remove team membership for a user (Legacy) /// /// > [!WARNING] - /// > **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 [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint. /// /// Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. /// @@ -14257,7 +14295,7 @@ public enum Operations { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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 team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint. /// /// Lists the organization projects for a team. /// @@ -14461,7 +14499,7 @@ public enum Operations { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint. /// /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. /// @@ -14632,7 +14670,7 @@ public enum Operations { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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 [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint. /// /// Adds an organization project to a team. 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. The project and team must be part of the same organization. /// @@ -14906,7 +14944,7 @@ public enum Operations { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint. /// /// Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. /// @@ -15072,7 +15110,7 @@ public enum Operations { /// List team repositories (Legacy) /// /// > [!WARNING] - /// > **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 team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/repos`. /// - Remark: Generated from `#/paths//teams/{team_id}/repos/get(teams/list-repos-legacy)`. @@ -15274,7 +15312,7 @@ public enum Operations { /// Check team permissions for a repository (Legacy) /// /// > [!WARNING] - /// > **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 [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint. /// /// > [!NOTE] /// > Repositories inherited through a parent team will also be checked. @@ -15482,7 +15520,7 @@ public enum Operations { /// Add or update team repository permissions (Legacy) /// /// > [!WARNING] - /// > **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 "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint. /// /// To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. /// @@ -15691,7 +15729,7 @@ public enum Operations { /// Remove a repository from a team (Legacy) /// /// > [!WARNING] - /// > **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 [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint. /// /// If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. /// @@ -15776,7 +15814,7 @@ public enum Operations { /// List child teams (Legacy) /// /// > [!WARNING] - /// > **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 child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. + /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. /// /// - Remark: HTTP `GET /teams/{team_id}/teams`. /// - Remark: Generated from `#/paths//teams/{team_id}/teams/get(teams/list-child-legacy)`. diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index 61359f3a9e4..03227230960 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -1907,6 +1907,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 2cb9a226f61..2b2c7e469d7 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -1137,6 +1137,8 @@ public enum Components { public var site_admin: Swift.Bool /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. public var starred_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var user_view_type: Swift.String? /// Creates a new `simple_hyphen_user`. /// /// - Parameters: @@ -1161,6 +1163,7 @@ public enum Components { /// - _type: /// - site_admin: /// - starred_at: + /// - user_view_type: public init( name: Swift.String? = nil, email: Swift.String? = nil, @@ -1182,7 +1185,8 @@ public enum Components { received_events_url: Swift.String, _type: Swift.String, site_admin: Swift.Bool, - starred_at: Swift.String? = nil + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil ) { self.name = name self.email = email @@ -1205,6 +1209,7 @@ public enum Components { self._type = _type self.site_admin = site_admin self.starred_at = starred_at + self.user_view_type = user_view_type } public enum CodingKeys: String, CodingKey { case name @@ -1228,6 +1233,7 @@ public enum Components { case _type = "type" case site_admin case starred_at + case user_view_type } } /// Basic Error @@ -1400,6 +1406,8 @@ public enum Components { public var login: Swift.String /// - Remark: Generated from `#/components/schemas/public-user/id`. public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/public-user/user_view_type`. + public var user_view_type: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/node_id`. public var node_id: Swift.String /// - Remark: Generated from `#/components/schemas/public-user/avatar_url`. @@ -1499,8 +1507,6 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/public-user/plan`. public var plan: Components.Schemas.public_hyphen_user.planPayload? - /// - Remark: Generated from `#/components/schemas/public-user/suspended_at`. - public var suspended_at: Foundation.Date? /// - Remark: Generated from `#/components/schemas/public-user/private_gists`. public var private_gists: Swift.Int? /// - Remark: Generated from `#/components/schemas/public-user/total_private_repos`. @@ -1516,6 +1522,7 @@ public enum Components { /// - Parameters: /// - login: /// - id: + /// - user_view_type: /// - node_id: /// - avatar_url: /// - gravatar_id: @@ -1548,7 +1555,6 @@ public enum Components { /// - created_at: /// - updated_at: /// - plan: - /// - suspended_at: /// - private_gists: /// - total_private_repos: /// - owned_private_repos: @@ -1557,6 +1563,7 @@ public enum Components { public init( login: Swift.String, id: Swift.Int64, + user_view_type: Swift.String? = nil, node_id: Swift.String, avatar_url: Swift.String, gravatar_id: Swift.String? = nil, @@ -1589,7 +1596,6 @@ public enum Components { created_at: Foundation.Date, updated_at: Foundation.Date, plan: Components.Schemas.public_hyphen_user.planPayload? = nil, - suspended_at: Foundation.Date? = nil, private_gists: Swift.Int? = nil, total_private_repos: Swift.Int? = nil, owned_private_repos: Swift.Int? = nil, @@ -1598,6 +1604,7 @@ public enum Components { ) { self.login = login self.id = id + self.user_view_type = user_view_type self.node_id = node_id self.avatar_url = avatar_url self.gravatar_id = gravatar_id @@ -1630,7 +1637,6 @@ public enum Components { self.created_at = created_at self.updated_at = updated_at self.plan = plan - self.suspended_at = suspended_at self.private_gists = private_gists self.total_private_repos = total_private_repos self.owned_private_repos = owned_private_repos @@ -1640,6 +1646,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case login case id + case user_view_type case node_id case avatar_url case gravatar_id @@ -1672,7 +1679,6 @@ public enum Components { case created_at case updated_at case plan - case suspended_at case private_gists case total_private_repos case owned_private_repos @@ -1689,6 +1695,10 @@ public enum Components { Swift.Int64.self, forKey: .id ) + user_view_type = try container.decodeIfPresent( + Swift.String.self, + forKey: .user_view_type + ) node_id = try container.decode( Swift.String.self, forKey: .node_id @@ -1817,10 +1827,6 @@ public enum Components { Components.Schemas.public_hyphen_user.planPayload.self, forKey: .plan ) - suspended_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .suspended_at - ) private_gists = try container.decodeIfPresent( Swift.Int.self, forKey: .private_gists @@ -1844,6 +1850,7 @@ public enum Components { try decoder.ensureNoAdditionalProperties(knownKeys: [ "login", "id", + "user_view_type", "node_id", "avatar_url", "gravatar_id", @@ -1876,7 +1883,6 @@ public enum Components { "created_at", "updated_at", "plan", - "suspended_at", "private_gists", "total_private_repos", "owned_private_repos", @@ -1903,6 +1909,8 @@ public enum Components { public var login: Swift.String /// - Remark: Generated from `#/components/schemas/private-user/id`. public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/private-user/user_view_type`. + public var user_view_type: Swift.String? /// - Remark: Generated from `#/components/schemas/private-user/node_id`. public var node_id: Swift.String /// - Remark: Generated from `#/components/schemas/private-user/avatar_url`. @@ -2014,8 +2022,6 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/private-user/plan`. public var plan: Components.Schemas.private_hyphen_user.planPayload? - /// - Remark: Generated from `#/components/schemas/private-user/suspended_at`. - public var suspended_at: Foundation.Date? /// - Remark: Generated from `#/components/schemas/private-user/business_plus`. public var business_plus: Swift.Bool? /// - Remark: Generated from `#/components/schemas/private-user/ldap_dn`. @@ -2025,6 +2031,7 @@ public enum Components { /// - Parameters: /// - login: /// - id: + /// - user_view_type: /// - node_id: /// - avatar_url: /// - gravatar_id: @@ -2063,12 +2070,12 @@ public enum Components { /// - collaborators: /// - two_factor_authentication: /// - plan: - /// - suspended_at: /// - business_plus: /// - ldap_dn: public init( login: Swift.String, id: Swift.Int64, + user_view_type: Swift.String? = nil, node_id: Swift.String, avatar_url: Swift.String, gravatar_id: Swift.String? = nil, @@ -2107,12 +2114,12 @@ public enum Components { collaborators: Swift.Int, two_factor_authentication: Swift.Bool, plan: Components.Schemas.private_hyphen_user.planPayload? = nil, - suspended_at: Foundation.Date? = nil, business_plus: Swift.Bool? = nil, ldap_dn: Swift.String? = nil ) { self.login = login self.id = id + self.user_view_type = user_view_type self.node_id = node_id self.avatar_url = avatar_url self.gravatar_id = gravatar_id @@ -2151,13 +2158,13 @@ public enum Components { self.collaborators = collaborators self.two_factor_authentication = two_factor_authentication self.plan = plan - self.suspended_at = suspended_at self.business_plus = business_plus self.ldap_dn = ldap_dn } public enum CodingKeys: String, CodingKey { case login case id + case user_view_type case node_id case avatar_url case gravatar_id @@ -2196,7 +2203,6 @@ public enum Components { case collaborators case two_factor_authentication case plan - case suspended_at case business_plus case ldap_dn } @@ -3135,35 +3141,37 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/user/GET/responses/200/content/json`. @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/user/GET/responses/200/content/json/case1`. - case private_hyphen_user(Components.Schemas.private_hyphen_user) - /// - Remark: Generated from `#/paths/user/GET/responses/200/content/json/case2`. - case public_hyphen_user(Components.Schemas.public_hyphen_user) + /// - Remark: Generated from `#/paths/user/GET/responses/200/content/json/private_hyphen_user`. + case _private(Components.Schemas.private_hyphen_user) + /// - Remark: Generated from `#/paths/user/GET/responses/200/content/json/public_hyphen_user`. + case _public(Components.Schemas.public_hyphen_user) + public enum CodingKeys: String, CodingKey { + case user_view_type + } public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .private_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .public_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: .user_view_type ) + switch discriminator { + case "private": + self = ._private(try .init(from: decoder)) + case "public": + self = ._public(try .init(from: decoder)) + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys.user_view_type, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } } public func encode(to encoder: any Encoder) throws { switch self { - case let .private_hyphen_user(value): + case let ._private(value): try value.encode(to: encoder) - case let .public_hyphen_user(value): + case let ._public(value): try value.encode(to: encoder) } } @@ -6467,6 +6475,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//user/following/{username}/put(users/follow)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -10625,35 +10656,37 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/user/{account_id}/GET/responses/200/content/json`. @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/user/{account_id}/GET/responses/200/content/json/case1`. - case private_hyphen_user(Components.Schemas.private_hyphen_user) - /// - Remark: Generated from `#/paths/user/{account_id}/GET/responses/200/content/json/case2`. - case public_hyphen_user(Components.Schemas.public_hyphen_user) + /// - Remark: Generated from `#/paths/user/{account_id}/GET/responses/200/content/json/private_hyphen_user`. + case _private(Components.Schemas.private_hyphen_user) + /// - Remark: Generated from `#/paths/user/{account_id}/GET/responses/200/content/json/public_hyphen_user`. + case _public(Components.Schemas.public_hyphen_user) + public enum CodingKeys: String, CodingKey { + case user_view_type + } public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .private_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .public_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: .user_view_type ) + switch discriminator { + case "private": + self = ._private(try .init(from: decoder)) + case "public": + self = ._public(try .init(from: decoder)) + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys.user_view_type, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } } public func encode(to encoder: any Encoder) throws { switch self { - case let .private_hyphen_user(value): + case let ._private(value): try value.encode(to: encoder) - case let .public_hyphen_user(value): + case let ._public(value): try value.encode(to: encoder) } } @@ -11004,35 +11037,37 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/users/{username}/GET/responses/200/content/json`. @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/users/{username}/GET/responses/200/content/json/case1`. - case private_hyphen_user(Components.Schemas.private_hyphen_user) - /// - Remark: Generated from `#/paths/users/{username}/GET/responses/200/content/json/case2`. - case public_hyphen_user(Components.Schemas.public_hyphen_user) + /// - Remark: Generated from `#/paths/users/{username}/GET/responses/200/content/json/private_hyphen_user`. + case _private(Components.Schemas.private_hyphen_user) + /// - Remark: Generated from `#/paths/users/{username}/GET/responses/200/content/json/public_hyphen_user`. + case _public(Components.Schemas.public_hyphen_user) + public enum CodingKeys: String, CodingKey { + case user_view_type + } public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .private_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .public_hyphen_user(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: .user_view_type ) + switch discriminator { + case "private": + self = ._private(try .init(from: decoder)) + case "public": + self = ._public(try .init(from: decoder)) + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys.user_view_type, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } } public func encode(to encoder: any Encoder) throws { switch self { - case let .private_hyphen_user(value): + case let ._private(value): try value.encode(to: encoder) - case let .public_hyphen_user(value): + case let ._public(value): try value.encode(to: encoder) } }