From 69ed85974b725621f618ee9cb48d3acd86bf502c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 16:16:49 +0000 Subject: [PATCH 01/37] Bump Submodule/github/rest-api-description from `1cd73ab` to `a3b9020` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `1cd73ab` to `a3b9020`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/1cd73ab20b4ba8355d380bd1f422ddf49c47a7af...a3b90207333d17877bcbab612a4163337ed7148c) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: a3b90207333d17877bcbab612a4163337ed7148c dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 1cd73ab20b4..a3b90207333 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 1cd73ab20b4ba8355d380bd1f422ddf49c47a7af +Subproject commit a3b90207333d17877bcbab612a4163337ed7148c From 7aff47dd521659367bb1cb8a4cac4b0f19ab71f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:39:21 +0000 Subject: [PATCH 02/37] Commit via running ake Sources/actions --- Sources/actions/Client.swift | 836 ++++++ Sources/actions/Types.swift | 5197 ++++++++++++++++++++++++++-------- 2 files changed, 4818 insertions(+), 1215 deletions(-) diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index de84842651e..8103c6a86d0 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -202,6 +202,703 @@ public struct Client: APIProtocol { } ) } + /// List GitHub-hosted runners for an organization + /// + /// Lists all GitHub-hosted runners configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. + public func actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners", + 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 + ) + 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_hosted_hyphen_runners_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_hosted_hyphen_runners_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_hosted_hyphen_runners_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 + ) + ) + } + } + ) + } + /// Create a GitHub-hosted runner for an organization + /// + /// Creates a GitHub-hosted runner for an organization. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. + public func actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners", + 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_hosted_hyphen_runner_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.actions_hyphen_hosted_hyphen_runner.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 GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/github-owned", + parameters: [ + input.path.org + ] + ) + 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_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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 + ) + ) + } + } + ) + } + /// Get partner images for GitHub-hosted runners in an organization + /// + /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/partner", + parameters: [ + input.path.org + ] + ) + 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_hosted_hyphen_runners_hyphen_partner_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_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 + ) + ) + } + } + ) + } + /// Get limits on GitHub-hosted runners for an organization + /// + /// Get the GitHub-hosted runners limits for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/limits", + parameters: [ + input.path.org + ] + ) + 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_hosted_hyphen_runners_hyphen_limits_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.actions_hyphen_hosted_hyphen_runner_hyphen_limits.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 GitHub-hosted runners machine specs for an organization + /// + /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/machine-sizes", + parameters: [ + input.path.org + ] + ) + 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_hosted_hyphen_runners_hyphen_machine_hyphen_specs_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_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_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 + ) + ) + } + } + ) + } + /// Get platforms for GitHub-hosted runners in an organization + /// + /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/platforms", + parameters: [ + input.path.org + ] + ) + 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_hosted_hyphen_runners_hyphen_platforms_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_get_hyphen_hosted_hyphen_runners_hyphen_platforms_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 + ) + ) + } + } + ) + } + /// Get a GitHub-hosted runner for an organization + /// + /// Gets a GitHub-hosted runner configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/{}", + parameters: [ + input.path.org, + input.path.hosted_runner_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 headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_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_get_hyphen_hosted_hyphen_runner_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.actions_hyphen_hosted_hyphen_runner.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 + ) + ) + } + } + ) + } + /// Update a GitHub-hosted runner for an organization + /// + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + public func actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/{}", + parameters: [ + input.path.org, + input.path.hosted_runner_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_hosted_hyphen_runner_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.actions_hyphen_hosted_hyphen_runner.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 GitHub-hosted runner for an organization + /// + /// Deletes a GitHub-hosted runner for an organization. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + public func actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/{}", + parameters: [ + input.path.org, + input.path.hosted_runner_id + ] + ) + 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 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.actions_hyphen_hosted_hyphen_runner.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get GitHub Actions permissions for an organization /// /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. @@ -1127,6 +1824,95 @@ public struct Client: APIProtocol { } ) } + /// List GitHub-hosted runners in a group for an organization + /// + /// Lists the GitHub-hosted runners in an 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}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public func actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_github_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_github_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/{}/hosted-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_github_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_github_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_github_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 + ) + ) + } + } + ) + } /// 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. @@ -1851,6 +2637,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unprocessableContent(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.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 .conflict(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5886,6 +6694,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unprocessableContent(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.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 .conflict(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -8303,6 +9133,9 @@ public struct Client: APIProtocol { } /// Get workflow run usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// Anyone with read access to the repository can use this endpoint. @@ -9528,6 +10361,9 @@ public struct Client: APIProtocol { } /// Get workflow usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index f07fda0212c..e3a45d02a04 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -31,6 +31,82 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. func actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output + /// List GitHub-hosted runners for an organization + /// + /// Lists all GitHub-hosted runners configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. + func actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Output + /// Create a GitHub-hosted runner for an organization + /// + /// Creates a GitHub-hosted runner for an organization. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. + func actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output + /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Output + /// Get partner images for GitHub-hosted runners in an organization + /// + /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Output + /// Get limits on GitHub-hosted runners for an organization + /// + /// Get the GitHub-hosted runners limits for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Output + /// Get GitHub-hosted runners machine specs for an organization + /// + /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output + /// Get platforms for GitHub-hosted runners in an organization + /// + /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output + /// Get a GitHub-hosted runner for an organization + /// + /// Gets a GitHub-hosted runner configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + func actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output + /// Update a GitHub-hosted runner for an organization + /// + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + func actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output + /// Delete a GitHub-hosted runner for an organization + /// + /// Deletes a GitHub-hosted runner for an organization. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + func actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(_ input: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output /// Get GitHub Actions permissions for an organization /// /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. @@ -171,6 +247,15 @@ public protocol APIProtocol: Sendable { /// - 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 GitHub-hosted runners in a group for an organization + /// + /// Lists the GitHub-hosted runners in an 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}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + func actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(_ input: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input) async throws -> Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_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. @@ -1194,6 +1279,9 @@ public protocol APIProtocol: Sendable { func actions_sol_re_hyphen_run_hyphen_workflow_hyphen_failed_hyphen_jobs(_ input: Operations.actions_sol_re_hyphen_run_hyphen_workflow_hyphen_failed_hyphen_jobs.Input) async throws -> Operations.actions_sol_re_hyphen_run_hyphen_workflow_hyphen_failed_hyphen_jobs.Output /// Get workflow run usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// Anyone with read access to the repository can use this endpoint. @@ -1383,6 +1471,9 @@ public protocol APIProtocol: Sendable { func actions_sol_list_hyphen_workflow_hyphen_runs(_ input: Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Input) async throws -> Operations.actions_sol_list_hyphen_workflow_hyphen_runs.Output /// Get workflow usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. @@ -1549,6 +1640,168 @@ extension APIProtocol { headers: headers )) } + /// List GitHub-hosted runners for an organization + /// + /// Lists all GitHub-hosted runners configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. + public func actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org( + path: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Output { + try await actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org(Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a GitHub-hosted runner for an organization + /// + /// Creates a GitHub-hosted runner for an organization. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. + public func actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org( + path: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Get partner images for GitHub-hosted runners in an organization + /// + /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Get limits on GitHub-hosted runners for an organization + /// + /// Get the GitHub-hosted runners limits for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Get GitHub-hosted runners machine specs for an organization + /// + /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Get platforms for GitHub-hosted runners in an organization + /// + /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Get a GitHub-hosted runner for an organization + /// + /// Gets a GitHub-hosted runner configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public func actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Update a GitHub-hosted runner for an organization + /// + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + public func actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org( + path: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a GitHub-hosted runner for an organization + /// + /// Deletes a GitHub-hosted runner for an organization. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + public func actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org( + path: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output { + try await actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org(Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } /// Get GitHub Actions permissions for an organization /// /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. @@ -1799,6 +2052,25 @@ extension APIProtocol { 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 GitHub-hosted runners in a group for an organization + /// + /// Lists the GitHub-hosted runners in an 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}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public func actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org( + path: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output { + try await actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org(Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } /// 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. @@ -3514,6 +3786,9 @@ extension APIProtocol { } /// Get workflow run usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// Anyone with read access to the repository can use this endpoint. @@ -3827,6 +4102,9 @@ extension APIProtocol { } /// Get workflow usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. @@ -4264,6 +4542,138 @@ public enum Components { case errors } } + /// An enterprise on GitHub. + /// + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. + public var node_id: Swift.String + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. + public var avatar_url: Swift.String + /// Creates a new `enterprise`. + /// + /// - Parameters: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise + /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: + /// - avatar_url: + public init( + description: Swift.String? = nil, + html_url: Swift.String, + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String + ) { + self.description = description + self.html_url = html_url + self.website_url = website_url + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at + self.avatar_url = avatar_url + } + public enum CodingKeys: String, CodingKey { + case description + case html_url + case website_url + case id + case node_id + case name + case slug + case created_at + case updated_at + case avatar_url + } + } + /// 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 + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -4409,55 +4819,6 @@ public enum Components { case user_view_type } } - /// 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 - } - } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -5290,504 +5651,316 @@ public enum Components { case html_url } } - /// Groups of organization members that gives permissions on specified repositories. + /// 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. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/nullable-integration`. + public struct nullable_hyphen_integration: Codable, Hashable, Sendable { + /// Unique identifier of the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team + /// The slug name of the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team + /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. + public var slug: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var client_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload + /// The name of the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. public var description: Swift.String? - /// Permission that the team will have for its repositories + /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. + public var external_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. + public var updated_at: Foundation.Date + /// The set of permissions for the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. + public var issues: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. + public var checks: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. + public var metadata: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. + public var contents: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. + public var deployments: Swift.String? + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - issues: + /// - checks: + /// - metadata: + /// - contents: + /// - deployments: + /// - additionalProperties: A container of undocumented properties. + public init( + issues: Swift.String? = nil, + checks: Swift.String? = nil, + metadata: Swift.String? = nil, + contents: Swift.String? = nil, + deployments: Swift.String? = nil, + additionalProperties: [String: Swift.String] = .init() + ) { + self.issues = issues + self.checks = checks + self.metadata = metadata + self.contents = contents + self.deployments = deployments + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case issues + case checks + case metadata + case contents + case deployments + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + issues = try container.decodeIfPresent( + Swift.String.self, + forKey: .issues + ) + checks = try container.decodeIfPresent( + Swift.String.self, + forKey: .checks + ) + metadata = try container.decodeIfPresent( + Swift.String.self, + forKey: .metadata + ) + contents = try container.decodeIfPresent( + Swift.String.self, + forKey: .contents + ) + deployments = try container.decodeIfPresent( + Swift.String.self, + forKey: .deployments + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "issues", + "checks", + "metadata", + "contents", + "deployments" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + issues, + forKey: .issues + ) + try container.encodeIfPresent( + checks, + forKey: .checks + ) + try container.encodeIfPresent( + metadata, + forKey: .metadata + ) + try container.encodeIfPresent( + contents, + forKey: .contents + ) + try container.encodeIfPresent( + deployments, + forKey: .deployments + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The set of permissions for the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public var permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload + /// The list of events for the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment + /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. + public var events: [Swift.String] + /// The number of installations associated with the GitHub app /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. + public var installations_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. + public var client_secret: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. + public var webhook_secret: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. + public var pem: Swift.String? + /// Creates a new `nullable_hyphen_integration`. /// /// - Parameters: - /// - id: Unique identifier of the team + /// - id: Unique identifier of the GitHub app + /// - slug: The slug name of the GitHub app /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set + /// - client_id: + /// - owner: + /// - name: The name of the GitHub app + /// - description: + /// - external_url: /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + /// - created_at: + /// - updated_at: + /// - permissions: The set of permissions for the GitHub app + /// - events: The list of events for the GitHub app + /// - installations_count: The number of installations associated with the GitHub app + /// - client_secret: + /// - webhook_secret: + /// - pem: public init( id: Swift.Int, + slug: Swift.String? = nil, node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, + client_id: Swift.String? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, + external_url: Swift.String, html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil + created_at: Foundation.Date, + updated_at: Foundation.Date, + permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, + events: [Swift.String], + installations_count: Swift.Int? = nil, + client_secret: Swift.String? = nil, + webhook_secret: Swift.String? = nil, + pem: Swift.String? = nil ) { self.id = id + self.slug = slug self.node_id = node_id - self.url = url - self.members_url = members_url + self.client_id = client_id + self.owner = owner self.name = name self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting + self.external_url = external_url self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn + self.created_at = created_at + self.updated_at = updated_at + self.permissions = permissions + self.events = events + self.installations_count = installations_count + self.client_secret = client_secret + self.webhook_secret = webhook_secret + self.pem = pem } public enum CodingKeys: String, CodingKey { case id + case slug case node_id - case url - case members_url + case client_id + case owner case name case description - case permission - case privacy - case notification_setting + case external_url case html_url - case repositories_url - case slug - case ldap_dn + case created_at + case updated_at + case permissions + case events + case installations_count + case client_secret + case webhook_secret + case pem } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct advanced_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? + /// Creates a new `advanced_securityPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { + self.status = status } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case status } } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// 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. - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration`. - public struct nullable_hyphen_integration: Codable, Hashable, Sendable { - /// Unique identifier of the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. - public var id: Swift.Int - /// The slug name of the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. - public var slug: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. - public var client_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? - /// The name of the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. - public var external_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. - public var updated_at: Foundation.Date - /// The set of permissions for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. - public var issues: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. - public var checks: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. - public var metadata: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. - public var contents: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. - public var deployments: Swift.String? - /// A container of undocumented properties. - public var additionalProperties: [String: Swift.String] - /// Creates a new `permissionsPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. /// /// - Parameters: - /// - issues: - /// - checks: - /// - metadata: - /// - contents: - /// - deployments: - /// - additionalProperties: A container of undocumented properties. - public init( - issues: Swift.String? = nil, - checks: Swift.String? = nil, - metadata: Swift.String? = nil, - contents: Swift.String? = nil, - deployments: Swift.String? = nil, - additionalProperties: [String: Swift.String] = .init() - ) { - self.issues = issues - self.checks = checks - self.metadata = metadata - self.contents = contents - self.deployments = deployments - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case issues - case checks - case metadata - case contents - case deployments - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - issues = try container.decodeIfPresent( - Swift.String.self, - forKey: .issues - ) - checks = try container.decodeIfPresent( - Swift.String.self, - forKey: .checks - ) - metadata = try container.decodeIfPresent( - Swift.String.self, - forKey: .metadata - ) - contents = try container.decodeIfPresent( - Swift.String.self, - forKey: .contents - ) - deployments = try container.decodeIfPresent( - Swift.String.self, - forKey: .deployments - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "issues", - "checks", - "metadata", - "contents", - "deployments" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - issues, - forKey: .issues - ) - try container.encodeIfPresent( - checks, - forKey: .checks - ) - try container.encodeIfPresent( - metadata, - forKey: .metadata - ) - try container.encodeIfPresent( - contents, - forKey: .contents - ) - try container.encodeIfPresent( - deployments, - forKey: .deployments - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// The set of permissions for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. - public var permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload - /// The list of events for the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. - public var events: [Swift.String] - /// The number of installations associated with the GitHub app - /// - /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. - public var installations_count: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var client_secret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhook_secret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? - /// Creates a new `nullable_hyphen_integration`. - /// - /// - Parameters: - /// - id: Unique identifier of the GitHub app - /// - slug: The slug name of the GitHub app - /// - node_id: - /// - client_id: - /// - owner: - /// - name: The name of the GitHub app - /// - description: - /// - external_url: - /// - html_url: - /// - created_at: - /// - updated_at: - /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installations_count: The number of installations associated with the GitHub app - /// - client_secret: - /// - webhook_secret: - /// - pem: - public init( - id: Swift.Int, - slug: Swift.String? = nil, - node_id: Swift.String, - client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, - name: Swift.String, - description: Swift.String? = nil, - external_url: Swift.String, - html_url: Swift.String, - created_at: Foundation.Date, - updated_at: Foundation.Date, - permissions: Components.Schemas.nullable_hyphen_integration.permissionsPayload, - events: [Swift.String], - installations_count: Swift.Int? = nil, - client_secret: Swift.String? = nil, - webhook_secret: Swift.String? = nil, - pem: Swift.String? = nil - ) { - self.id = id - self.slug = slug - self.node_id = node_id - self.client_id = client_id - self.owner = owner - self.name = name - self.description = description - self.external_url = external_url - self.html_url = html_url - self.created_at = created_at - self.updated_at = updated_at - self.permissions = permissions - self.events = events - self.installations_count = installations_count - self.client_secret = client_secret - self.webhook_secret = webhook_secret - self.pem = pem - } - public enum CodingKeys: String, CodingKey { - case id - case slug - case node_id - case client_id - case owner - case name - case description - case external_url - case html_url - case created_at - case updated_at - case permissions - case events - case installations_count - case client_secret - case webhook_secret - case pem - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public struct advanced_securityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? - /// Creates a new `advanced_securityPayload`. - /// - /// - Parameters: - /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { - self.status = status + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status } public enum CodingKeys: String, CodingKey { case status } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -5910,6 +6083,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -5917,6 +6091,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -5924,6 +6099,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -5932,6 +6108,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -6622,90 +6799,439 @@ public enum Components { case active_caches_count } } - /// An object without any properties. + /// Provides details of a hosted runner image /// - /// - Remark: Generated from `#/components/schemas/empty-object`. - public struct empty_hyphen_object: Codable, Hashable, Sendable { - /// Creates a new `empty_hyphen_object`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image`. + public struct nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image: Codable, Hashable, Sendable { + /// The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/id`. + public var id: Swift.String + /// Image size in GB. + /// + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/size_gb`. + public var size_gb: Swift.Int + /// Display name for this image. + /// + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/display_name`. + public var display_name: Swift.String + /// The image provider. + /// + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/source`. + @frozen public enum sourcePayload: String, Codable, Hashable, Sendable { + case github = "github" + case partner = "partner" + case custom = "custom" } - } - /// The policy that controls the repositories in the organization that are allowed to run GitHub Actions. - /// - /// - Remark: Generated from `#/components/schemas/enabled-repositories`. - @frozen public enum enabled_hyphen_repositories: String, Codable, Hashable, Sendable { - case all = "all" - case none = "none" - case selected = "selected" - } - /// The permissions policy that controls the actions and reusable workflows that are allowed to run. - /// - /// - Remark: Generated from `#/components/schemas/allowed-actions`. - @frozen public enum allowed_hyphen_actions: String, Codable, Hashable, Sendable { - case all = "all" - case local_only = "local_only" - case selected = "selected" - } - /// The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. - /// - /// - Remark: Generated from `#/components/schemas/selected-actions-url`. - public typealias selected_hyphen_actions_hyphen_url = Swift.String - /// - Remark: Generated from `#/components/schemas/actions-organization-permissions`. - public struct actions_hyphen_organization_hyphen_permissions: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/enabled_repositories`. - public var enabled_repositories: Components.Schemas.enabled_hyphen_repositories - /// The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. + /// The image provider. /// - /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/selected_repositories_url`. - public var selected_repositories_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/allowed_actions`. - public var allowed_actions: Components.Schemas.allowed_hyphen_actions? - /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/selected_actions_url`. - public var selected_actions_url: Components.Schemas.selected_hyphen_actions_hyphen_url? - /// Creates a new `actions_hyphen_organization_hyphen_permissions`. + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/source`. + public var source: Components.Schemas.nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image.sourcePayload + /// Creates a new `nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image`. /// /// - Parameters: - /// - enabled_repositories: - /// - selected_repositories_url: The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. - /// - allowed_actions: - /// - selected_actions_url: + /// - id: The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// - size_gb: Image size in GB. + /// - display_name: Display name for this image. + /// - source: The image provider. public init( - enabled_repositories: Components.Schemas.enabled_hyphen_repositories, - selected_repositories_url: Swift.String? = nil, - allowed_actions: Components.Schemas.allowed_hyphen_actions? = nil, - selected_actions_url: Components.Schemas.selected_hyphen_actions_hyphen_url? = nil + id: Swift.String, + size_gb: Swift.Int, + display_name: Swift.String, + source: Components.Schemas.nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image.sourcePayload ) { - self.enabled_repositories = enabled_repositories - self.selected_repositories_url = selected_repositories_url - self.allowed_actions = allowed_actions - self.selected_actions_url = selected_actions_url + self.id = id + self.size_gb = size_gb + self.display_name = display_name + self.source = source } public enum CodingKeys: String, CodingKey { - case enabled_repositories - case selected_repositories_url - case allowed_actions - case selected_actions_url + case id + case size_gb + case display_name + case source } } - /// - Remark: Generated from `#/components/schemas/selected-actions`. - public struct selected_hyphen_actions: Codable, Hashable, Sendable { - /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// Provides details of a particular machine spec. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-machine-spec`. + public struct actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec: Codable, Hashable, Sendable { + /// The ID used for the `size` parameter when creating a new runner. /// - /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. - public var github_owned_allowed: Swift.Bool? - /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-machine-spec/id`. + public var id: Swift.String + /// The number of cores. /// - /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. - public var verified_allowed: Swift.Bool? - /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-machine-spec/cpu_cores`. + public var cpu_cores: Swift.Int + /// The available RAM for the machine spec. /// - /// > [!NOTE] - /// > The `patterns_allowed` setting only applies to public repositories. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-machine-spec/memory_gb`. + public var memory_gb: Swift.Int + /// The available SSD storage for the machine spec. /// - /// - Remark: Generated from `#/components/schemas/selected-actions/patterns_allowed`. - public var patterns_allowed: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-machine-spec/storage_gb`. + public var storage_gb: Swift.Int + /// Creates a new `actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec`. + /// + /// - Parameters: + /// - id: The ID used for the `size` parameter when creating a new runner. + /// - cpu_cores: The number of cores. + /// - memory_gb: The available RAM for the machine spec. + /// - storage_gb: The available SSD storage for the machine spec. + public init( + id: Swift.String, + cpu_cores: Swift.Int, + memory_gb: Swift.Int, + storage_gb: Swift.Int + ) { + self.id = id + self.cpu_cores = cpu_cores + self.memory_gb = memory_gb + self.storage_gb = storage_gb + } + public enum CodingKeys: String, CodingKey { + case id + case cpu_cores + case memory_gb + case storage_gb + } + } + /// Provides details of Public IP for a GitHub-hosted larger runners + /// + /// - Remark: Generated from `#/components/schemas/public-ip`. + public struct public_hyphen_ip: Codable, Hashable, Sendable { + /// Whether public IP is enabled. + /// + /// - Remark: Generated from `#/components/schemas/public-ip/enabled`. + public var enabled: Swift.Bool? + /// The prefix for the public IP. + /// + /// - Remark: Generated from `#/components/schemas/public-ip/prefix`. + public var prefix: Swift.String? + /// The length of the IP prefix. + /// + /// - Remark: Generated from `#/components/schemas/public-ip/length`. + public var length: Swift.Int? + /// Creates a new `public_hyphen_ip`. + /// + /// - Parameters: + /// - enabled: Whether public IP is enabled. + /// - prefix: The prefix for the public IP. + /// - length: The length of the IP prefix. + public init( + enabled: Swift.Bool? = nil, + prefix: Swift.String? = nil, + length: Swift.Int? = nil + ) { + self.enabled = enabled + self.prefix = prefix + self.length = length + } + public enum CodingKeys: String, CodingKey { + case enabled + case prefix + case length + } + } + /// A Github-hosted hosted runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner`. + public struct actions_hyphen_hosted_hyphen_runner: Codable, Hashable, Sendable { + /// The unique identifier of the hosted runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/id`. + public var id: Swift.Int + /// The name of the hosted runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/name`. + public var name: Swift.String + /// The unique identifier of the group that the hosted runner belongs to. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/runner_group_id`. + public var runner_group_id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/image_details`. + public var image_details: Components.Schemas.nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image? + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/machine_size_details`. + public var machine_size_details: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec + /// The status of the runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case Ready = "Ready" + case Provisioning = "Provisioning" + case Shutdown = "Shutdown" + case Deleting = "Deleting" + case Stuck = "Stuck" + } + /// The status of the runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/status`. + public var status: Components.Schemas.actions_hyphen_hosted_hyphen_runner.statusPayload + /// The operating system of the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/platform`. + public var platform: Swift.String + /// The maximum amount of hosted runners. Runners will not scale automatically above this number. Use this setting to limit your cost. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/maximum_runners`. + public var maximum_runners: Swift.Int? + /// Whether public IP is enabled for the hosted runners. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/public_ip_enabled`. + public var public_ip_enabled: Swift.Bool + /// The public IP ranges when public IP is enabled for the hosted runners. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/public_ips`. + public var public_ips: [Components.Schemas.public_hyphen_ip]? + /// The time at which the runner was last used, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/last_active_on`. + public var last_active_on: Foundation.Date? + /// Creates a new `actions_hyphen_hosted_hyphen_runner`. + /// + /// - Parameters: + /// - id: The unique identifier of the hosted runner. + /// - name: The name of the hosted runner. + /// - runner_group_id: The unique identifier of the group that the hosted runner belongs to. + /// - image_details: + /// - machine_size_details: + /// - status: The status of the runner. + /// - platform: The operating system of the image. + /// - maximum_runners: The maximum amount of hosted runners. Runners will not scale automatically above this number. Use this setting to limit your cost. + /// - public_ip_enabled: Whether public IP is enabled for the hosted runners. + /// - public_ips: The public IP ranges when public IP is enabled for the hosted runners. + /// - last_active_on: The time at which the runner was last used, in ISO 8601 format. + public init( + id: Swift.Int, + name: Swift.String, + runner_group_id: Swift.Int? = nil, + image_details: Components.Schemas.nullable_hyphen_actions_hyphen_hosted_hyphen_runner_hyphen_pool_hyphen_image? = nil, + machine_size_details: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec, + status: Components.Schemas.actions_hyphen_hosted_hyphen_runner.statusPayload, + platform: Swift.String, + maximum_runners: Swift.Int? = nil, + public_ip_enabled: Swift.Bool, + public_ips: [Components.Schemas.public_hyphen_ip]? = nil, + last_active_on: Foundation.Date? = nil + ) { + self.id = id + self.name = name + self.runner_group_id = runner_group_id + self.image_details = image_details + self.machine_size_details = machine_size_details + self.status = status + self.platform = platform + self.maximum_runners = maximum_runners + self.public_ip_enabled = public_ip_enabled + self.public_ips = public_ips + self.last_active_on = last_active_on + } + public enum CodingKeys: String, CodingKey { + case id + case name + case runner_group_id + case image_details + case machine_size_details + case status + case platform + case maximum_runners + case public_ip_enabled + case public_ips + case last_active_on + } + } + /// Provides details of a hosted runner image + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image`. + public struct actions_hyphen_hosted_hyphen_runner_hyphen_image: Codable, Hashable, Sendable { + /// The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/id`. + public var id: Swift.String + /// The operating system of the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/platform`. + public var platform: Swift.String + /// Image size in GB. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/size_gb`. + public var size_gb: Swift.Int + /// Display name for this image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/display_name`. + public var display_name: Swift.String + /// The image provider. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/source`. + @frozen public enum sourcePayload: String, Codable, Hashable, Sendable { + case github = "github" + case partner = "partner" + case custom = "custom" + } + /// The image provider. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/source`. + public var source: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image.sourcePayload + /// Creates a new `actions_hyphen_hosted_hyphen_runner_hyphen_image`. + /// + /// - Parameters: + /// - id: The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// - platform: The operating system of the image. + /// - size_gb: Image size in GB. + /// - display_name: Display name for this image. + /// - source: The image provider. + public init( + id: Swift.String, + platform: Swift.String, + size_gb: Swift.Int, + display_name: Swift.String, + source: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image.sourcePayload + ) { + self.id = id + self.platform = platform + self.size_gb = size_gb + self.display_name = display_name + self.source = source + } + public enum CodingKeys: String, CodingKey { + case id + case platform + case size_gb + case display_name + case source + } + } + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-limits`. + public struct actions_hyphen_hosted_hyphen_runner_hyphen_limits: Codable, Hashable, Sendable { + /// Provides details of static public IP limits for GitHub-hosted Hosted Runners + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-limits/public_ips`. + public struct public_ipsPayload: Codable, Hashable, Sendable { + /// The maximum number of static public IP addresses that can be used for Hosted Runners. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-limits/public_ips/maximum`. + public var maximum: Swift.Int + /// The current number of static public IP addresses in use by Hosted Runners. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-limits/public_ips/current_usage`. + public var current_usage: Swift.Int + /// Creates a new `public_ipsPayload`. + /// + /// - Parameters: + /// - maximum: The maximum number of static public IP addresses that can be used for Hosted Runners. + /// - current_usage: The current number of static public IP addresses in use by Hosted Runners. + public init( + maximum: Swift.Int, + current_usage: Swift.Int + ) { + self.maximum = maximum + self.current_usage = current_usage + } + public enum CodingKeys: String, CodingKey { + case maximum + case current_usage + } + } + /// Provides details of static public IP limits for GitHub-hosted Hosted Runners + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-limits/public_ips`. + public var public_ips: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_limits.public_ipsPayload + /// Creates a new `actions_hyphen_hosted_hyphen_runner_hyphen_limits`. + /// + /// - Parameters: + /// - public_ips: Provides details of static public IP limits for GitHub-hosted Hosted Runners + public init(public_ips: Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_limits.public_ipsPayload) { + self.public_ips = public_ips + } + public enum CodingKeys: String, CodingKey { + case public_ips + } + } + /// An object without any properties. + /// + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct empty_hyphen_object: Codable, Hashable, Sendable { + /// Creates a new `empty_hyphen_object`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// The policy that controls the repositories in the organization that are allowed to run GitHub Actions. + /// + /// - Remark: Generated from `#/components/schemas/enabled-repositories`. + @frozen public enum enabled_hyphen_repositories: String, Codable, Hashable, Sendable { + case all = "all" + case none = "none" + case selected = "selected" + } + /// The permissions policy that controls the actions and reusable workflows that are allowed to run. + /// + /// - Remark: Generated from `#/components/schemas/allowed-actions`. + @frozen public enum allowed_hyphen_actions: String, Codable, Hashable, Sendable { + case all = "all" + case local_only = "local_only" + case selected = "selected" + } + /// The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions-url`. + public typealias selected_hyphen_actions_hyphen_url = Swift.String + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions`. + public struct actions_hyphen_organization_hyphen_permissions: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/enabled_repositories`. + public var enabled_repositories: Components.Schemas.enabled_hyphen_repositories + /// The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. + /// + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/selected_repositories_url`. + public var selected_repositories_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/allowed_actions`. + public var allowed_actions: Components.Schemas.allowed_hyphen_actions? + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/selected_actions_url`. + public var selected_actions_url: Components.Schemas.selected_hyphen_actions_hyphen_url? + /// Creates a new `actions_hyphen_organization_hyphen_permissions`. + /// + /// - Parameters: + /// - enabled_repositories: + /// - selected_repositories_url: The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. + /// - allowed_actions: + /// - selected_actions_url: + public init( + enabled_repositories: Components.Schemas.enabled_hyphen_repositories, + selected_repositories_url: Swift.String? = nil, + allowed_actions: Components.Schemas.allowed_hyphen_actions? = nil, + selected_actions_url: Components.Schemas.selected_hyphen_actions_hyphen_url? = nil + ) { + self.enabled_repositories = enabled_repositories + self.selected_repositories_url = selected_repositories_url + self.allowed_actions = allowed_actions + self.selected_actions_url = selected_actions_url + } + public enum CodingKeys: String, CodingKey { + case enabled_repositories + case selected_repositories_url + case allowed_actions + case selected_actions_url + } + } + /// - Remark: Generated from `#/components/schemas/selected-actions`. + public struct selected_hyphen_actions: Codable, Hashable, Sendable { + /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. + public var github_owned_allowed: Swift.Bool? + /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. + public var verified_allowed: Swift.Bool? + /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// + /// > [!NOTE] + /// > The `patterns_allowed` setting only applies to public repositories. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/patterns_allowed`. + public var patterns_allowed: [Swift.String]? /// Creates a new `selected_hyphen_actions`. /// /// - Parameters: @@ -6802,6 +7328,10 @@ public enum Components { public var runners_url: Swift.String /// - Remark: Generated from `#/components/schemas/runner-groups-org/hosted_runners_url`. public var hosted_runners_url: Swift.String? + /// The identifier of a hosted compute network configuration. + /// + /// - Remark: Generated from `#/components/schemas/runner-groups-org/network_configuration_id`. + public var network_configuration_id: 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`. @@ -6830,6 +7360,7 @@ public enum Components { /// - 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: + /// - network_configuration_id: The identifier of a hosted compute network configuration. /// - inherited: /// - inherited_allows_public_repositories: /// - allows_public_repositories: @@ -6844,6 +7375,7 @@ public enum Components { selected_repositories_url: Swift.String? = nil, runners_url: Swift.String, hosted_runners_url: Swift.String? = nil, + network_configuration_id: Swift.String? = nil, inherited: Swift.Bool, inherited_allows_public_repositories: Swift.Bool? = nil, allows_public_repositories: Swift.Bool, @@ -6858,6 +7390,7 @@ public enum Components { self.selected_repositories_url = selected_repositories_url self.runners_url = runners_url self.hosted_runners_url = hosted_runners_url + self.network_configuration_id = network_configuration_id self.inherited = inherited self.inherited_allows_public_repositories = inherited_allows_public_repositories self.allows_public_repositories = allows_public_repositories @@ -6873,6 +7406,7 @@ public enum Components { case selected_repositories_url case runners_url case hosted_runners_url + case network_configuration_id case inherited case inherited_allows_public_repositories case allows_public_repositories @@ -6929,11 +7463,11 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/runner`. public struct runner: Codable, Hashable, Sendable { - /// The id of the runner. + /// The ID of the runner. /// /// - Remark: Generated from `#/components/schemas/runner/id`. public var id: Swift.Int - /// The id of the runner group. + /// The ID of the runner group. /// /// - Remark: Generated from `#/components/schemas/runner/runner_group_id`. public var runner_group_id: Swift.Int? @@ -6953,16 +7487,19 @@ public enum Components { public var busy: Swift.Bool /// - Remark: Generated from `#/components/schemas/runner/labels`. public var labels: [Components.Schemas.runner_hyphen_label] + /// - Remark: Generated from `#/components/schemas/runner/ephemeral`. + public var ephemeral: Swift.Bool? /// Creates a new `runner`. /// /// - Parameters: - /// - id: The id of the runner. - /// - runner_group_id: The id of the runner group. + /// - id: The ID of the runner. + /// - runner_group_id: The ID of the runner group. /// - name: The name of the runner. /// - os: The Operating System of the runner. /// - status: The status of the runner. /// - busy: /// - labels: + /// - ephemeral: public init( id: Swift.Int, runner_group_id: Swift.Int? = nil, @@ -6970,7 +7507,8 @@ public enum Components { os: Swift.String, status: Swift.String, busy: Swift.Bool, - labels: [Components.Schemas.runner_hyphen_label] + labels: [Components.Schemas.runner_hyphen_label], + ephemeral: Swift.Bool? = nil ) { self.id = id self.runner_group_id = runner_group_id @@ -6979,6 +7517,7 @@ public enum Components { self.status = status self.busy = busy self.labels = labels + self.ephemeral = ephemeral } public enum CodingKeys: String, CodingKey { case id @@ -6988,6 +7527,7 @@ public enum Components { case status case busy case labels + case ephemeral } } /// Runner Application @@ -7280,206 +7820,459 @@ public enum Components { case selected_repositories_url } } - /// An artifact + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/artifact`. - public struct artifact: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/artifact/id`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/artifact/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. public var node_id: Swift.String - /// The name of the artifact. + /// URL for the team /// - /// - Remark: Generated from `#/components/schemas/artifact/name`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. public var name: Swift.String - /// The size in bytes of the artifact. + /// Description of the team /// - /// - Remark: Generated from `#/components/schemas/artifact/size_in_bytes`. - public var size_in_bytes: Swift.Int - /// - Remark: Generated from `#/components/schemas/artifact/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/artifact/archive_download_url`. - public var archive_download_url: Swift.String - /// Whether or not the artifact has expired. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories /// - /// - Remark: Generated from `#/components/schemas/artifact/expired`. - public var expired: Swift.Bool - /// - Remark: Generated from `#/components/schemas/artifact/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/artifact/expires_at`. - public var expires_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/artifact/updated_at`. - public var updated_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run`. - public struct workflow_runPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/repository_id`. - public var repository_id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_repository_id`. - public var head_repository_id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_branch`. - public var head_branch: Swift.String? - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_sha`. - public var head_sha: Swift.String? - /// Creates a new `workflow_runPayload`. - /// - /// - Parameters: - /// - id: - /// - repository_id: - /// - head_repository_id: - /// - head_branch: - /// - head_sha: - public init( - id: Swift.Int? = nil, - repository_id: Swift.Int? = nil, - head_repository_id: Swift.Int? = nil, - head_branch: Swift.String? = nil, - head_sha: Swift.String? = nil - ) { - self.id = id - self.repository_id = repository_id - self.head_repository_id = head_repository_id - self.head_branch = head_branch - self.head_sha = head_sha - } - public enum CodingKeys: String, CodingKey { - case id - case repository_id - case head_repository_id - case head_branch - case head_sha - } - } - /// - Remark: Generated from `#/components/schemas/artifact/workflow_run`. - public var workflow_run: Components.Schemas.artifact.workflow_runPayload? - /// Creates a new `artifact`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. /// /// - Parameters: - /// - id: + /// - id: Unique identifier of the team /// - node_id: - /// - name: The name of the artifact. - /// - size_in_bytes: The size in bytes of the artifact. - /// - url: - /// - archive_download_url: - /// - expired: Whether or not the artifact has expired. - /// - created_at: - /// - expires_at: - /// - updated_at: - /// - workflow_run: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment public init( id: Swift.Int, node_id: Swift.String, - name: Swift.String, - size_in_bytes: Swift.Int, url: Swift.String, - archive_download_url: Swift.String, - expired: Swift.Bool, - created_at: Foundation.Date? = nil, - expires_at: Foundation.Date? = nil, - updated_at: Foundation.Date? = nil, - workflow_run: Components.Schemas.artifact.workflow_runPayload? = nil + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil ) { self.id = id self.node_id = node_id - self.name = name - self.size_in_bytes = size_in_bytes self.url = url - self.archive_download_url = archive_download_url - self.expired = expired - self.created_at = created_at - self.expires_at = expires_at - self.updated_at = updated_at - self.workflow_run = workflow_run + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn } public enum CodingKeys: String, CodingKey { case id case node_id - case name - case size_in_bytes case url - case archive_download_url - case expired - case created_at - case expires_at - case updated_at - case workflow_run + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn } } - /// Repository actions caches + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/actions-cache-list`. - public struct actions_hyphen_cache_hyphen_list: Codable, Hashable, Sendable { - /// Total number of caches - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-list/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload`. - public struct actions_cachesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/ref`. - public var ref: Swift.String? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/key`. - public var key: Swift.String? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/version`. - public var version: Swift.String? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/last_accessed_at`. - public var last_accessed_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/size_in_bytes`. - public var size_in_bytes: Swift.Int? - /// Creates a new `actions_cachesPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. /// /// - Parameters: - /// - id: - /// - ref: - /// - key: - /// - version: - /// - last_accessed_at: - /// - created_at: - /// - size_in_bytes: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - id: Swift.Int? = nil, - ref: Swift.String? = nil, - key: Swift.String? = nil, - version: Swift.String? = nil, - last_accessed_at: Foundation.Date? = nil, - created_at: Foundation.Date? = nil, - size_in_bytes: Swift.Int? = nil + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.id = id - self.ref = ref - self.key = key - self.version = version - self.last_accessed_at = last_accessed_at - self.created_at = created_at - self.size_in_bytes = size_in_bytes + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } public enum CodingKeys: String, CodingKey { - case id - case ref - case key - case version - case last_accessed_at - case created_at - case size_in_bytes + case pull + case triage + case push + case maintain + case admin } } - /// Array of caches - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_caches`. - public typealias actions_cachesPayload = [Components.Schemas.actions_hyphen_cache_hyphen_list.actions_cachesPayloadPayload] - /// Array of caches - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_caches`. - public var actions_caches: Components.Schemas.actions_hyphen_cache_hyphen_list.actions_cachesPayload - /// Creates a new `actions_hyphen_cache_hyphen_list`. + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. /// /// - Parameters: - /// - total_count: Total number of caches - /// - actions_caches: Array of caches + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } + /// An artifact + /// + /// - Remark: Generated from `#/components/schemas/artifact`. + public struct artifact: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/artifact/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/artifact/node_id`. + public var node_id: Swift.String + /// The name of the artifact. + /// + /// - Remark: Generated from `#/components/schemas/artifact/name`. + public var name: Swift.String + /// The size in bytes of the artifact. + /// + /// - Remark: Generated from `#/components/schemas/artifact/size_in_bytes`. + public var size_in_bytes: Swift.Int + /// - Remark: Generated from `#/components/schemas/artifact/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/artifact/archive_download_url`. + public var archive_download_url: Swift.String + /// Whether or not the artifact has expired. + /// + /// - Remark: Generated from `#/components/schemas/artifact/expired`. + public var expired: Swift.Bool + /// - Remark: Generated from `#/components/schemas/artifact/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/artifact/expires_at`. + public var expires_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/artifact/updated_at`. + public var updated_at: Foundation.Date? + /// The SHA256 digest of the artifact. This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. For older versions, this field will be null. + /// + /// - Remark: Generated from `#/components/schemas/artifact/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run`. + public struct workflow_runPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/repository_id`. + public var repository_id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_repository_id`. + public var head_repository_id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_branch`. + public var head_branch: Swift.String? + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run/head_sha`. + public var head_sha: Swift.String? + /// Creates a new `workflow_runPayload`. + /// + /// - Parameters: + /// - id: + /// - repository_id: + /// - head_repository_id: + /// - head_branch: + /// - head_sha: + public init( + id: Swift.Int? = nil, + repository_id: Swift.Int? = nil, + head_repository_id: Swift.Int? = nil, + head_branch: Swift.String? = nil, + head_sha: Swift.String? = nil + ) { + self.id = id + self.repository_id = repository_id + self.head_repository_id = head_repository_id + self.head_branch = head_branch + self.head_sha = head_sha + } + public enum CodingKeys: String, CodingKey { + case id + case repository_id + case head_repository_id + case head_branch + case head_sha + } + } + /// - Remark: Generated from `#/components/schemas/artifact/workflow_run`. + public var workflow_run: Components.Schemas.artifact.workflow_runPayload? + /// Creates a new `artifact`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: The name of the artifact. + /// - size_in_bytes: The size in bytes of the artifact. + /// - url: + /// - archive_download_url: + /// - expired: Whether or not the artifact has expired. + /// - created_at: + /// - expires_at: + /// - updated_at: + /// - digest: The SHA256 digest of the artifact. This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. For older versions, this field will be null. + /// - workflow_run: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + size_in_bytes: Swift.Int, + url: Swift.String, + archive_download_url: Swift.String, + expired: Swift.Bool, + created_at: Foundation.Date? = nil, + expires_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + digest: Swift.String? = nil, + workflow_run: Components.Schemas.artifact.workflow_runPayload? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.size_in_bytes = size_in_bytes + self.url = url + self.archive_download_url = archive_download_url + self.expired = expired + self.created_at = created_at + self.expires_at = expires_at + self.updated_at = updated_at + self.digest = digest + self.workflow_run = workflow_run + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case size_in_bytes + case url + case archive_download_url + case expired + case created_at + case expires_at + case updated_at + case digest + case workflow_run + } + } + /// Repository actions caches + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-list`. + public struct actions_hyphen_cache_hyphen_list: Codable, Hashable, Sendable { + /// Total number of caches + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-list/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload`. + public struct actions_cachesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/ref`. + public var ref: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/key`. + public var key: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/version`. + public var version: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/last_accessed_at`. + public var last_accessed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_cachesPayload/size_in_bytes`. + public var size_in_bytes: Swift.Int? + /// Creates a new `actions_cachesPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - ref: + /// - key: + /// - version: + /// - last_accessed_at: + /// - created_at: + /// - size_in_bytes: + public init( + id: Swift.Int? = nil, + ref: Swift.String? = nil, + key: Swift.String? = nil, + version: Swift.String? = nil, + last_accessed_at: Foundation.Date? = nil, + created_at: Foundation.Date? = nil, + size_in_bytes: Swift.Int? = nil + ) { + self.id = id + self.ref = ref + self.key = key + self.version = version + self.last_accessed_at = last_accessed_at + self.created_at = created_at + self.size_in_bytes = size_in_bytes + } + public enum CodingKeys: String, CodingKey { + case id + case ref + case key + case version + case last_accessed_at + case created_at + case size_in_bytes + } + } + /// Array of caches + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_caches`. + public typealias actions_cachesPayload = [Components.Schemas.actions_hyphen_cache_hyphen_list.actions_cachesPayloadPayload] + /// Array of caches + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-list/actions_caches`. + public var actions_caches: Components.Schemas.actions_hyphen_cache_hyphen_list.actions_cachesPayload + /// Creates a new `actions_hyphen_cache_hyphen_list`. + /// + /// - Parameters: + /// - total_count: Total number of caches + /// - actions_caches: Array of caches public init( total_count: Swift.Int, actions_caches: Components.Schemas.actions_hyphen_cache_hyphen_list.actions_cachesPayload @@ -9488,6 +10281,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias org = Swift.String + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/components/parameters/hosted-runner-id`. + public typealias hosted_hyphen_runner_hyphen_id = Swift.Int /// The unique identifier of the repository. /// /// - Remark: Generated from `#/components/parameters/repository-id`. @@ -9627,470 +10424,2029 @@ public enum Components { } catch { errors.append(error) } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`. + /// + /// - Remark: Generated from `#/components/parameters/environment-name`. + public typealias environment_hyphen_name = 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 validation_failed_simple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.validation_hyphen_error_hyphen_simple) + /// 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.validation_hyphen_error_hyphen_simple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.validation_failed_simple.Body + /// Creates a new `validation_failed_simple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.validation_failed_simple.Body) { + self.body = body + } + } + 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 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 conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/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.conflict.Body + /// Creates a new `conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.conflict.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 actions_runner_jitconfig: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json/runner`. + public var runner: Components.Schemas.runner + /// The base64 encoded runner configuration. + /// + /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json/encoded_jit_config`. + public var encoded_jit_config: Swift.String + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - runner: + /// - encoded_jit_config: The base64 encoded runner configuration. + public init( + runner: Components.Schemas.runner, + encoded_jit_config: Swift.String + ) { + self.runner = runner + self.encoded_jit_config = encoded_jit_config + } + public enum CodingKeys: String, CodingKey { + case runner + case encoded_jit_config + } + } + /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/application\/json`. + case json(Components.Responses.actions_runner_jitconfig.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.actions_runner_jitconfig.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.actions_runner_jitconfig.Body + /// Creates a new `actions_runner_jitconfig`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.actions_runner_jitconfig.Body) { + self.body = body + } + } + public struct actions_runner_labels: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json/labels`. + public var labels: [Components.Schemas.runner_hyphen_label] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - labels: + public init( + total_count: Swift.Int, + labels: [Components.Schemas.runner_hyphen_label] + ) { + self.total_count = total_count + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case total_count + case labels + } + } + /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/application\/json`. + case json(Components.Responses.actions_runner_labels.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.actions_runner_labels.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.actions_runner_labels.Body + /// Creates a new `actions_runner_labels`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.actions_runner_labels.Body) { + self.body = body + } + } + public struct actions_runner_labels_readonly: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json/labels`. + public var labels: [Components.Schemas.runner_hyphen_label] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - labels: + public init( + total_count: Swift.Int, + labels: [Components.Schemas.runner_hyphen_label] + ) { + self.total_count = total_count + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case total_count + case labels + } + } + /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/application\/json`. + case json(Components.Responses.actions_runner_labels_readonly.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.actions_runner_labels_readonly.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.actions_runner_labels_readonly.Body + /// Creates a new `actions_runner_labels_readonly`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.actions_runner_labels_readonly.Body) { + self.body = body + } + } + public struct gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/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.gone.Body + /// Creates a new `gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.gone.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 + /// - Remark: Generated from `#/components/headers/location`. + public typealias location = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// Get GitHub Actions cache usage for an organization + /// + /// Gets the total GitHub Actions cache usage for an organization. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)`. + public enum actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-actions-cache-usage-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/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.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/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.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_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/cache/usage/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_org_hyphen_enterprise) + /// 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.actions_hyphen_cache_hyphen_usage_hyphen_org_hyphen_enterprise { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_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_actions_hyphen_cache_hyphen_usage_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 + ] + } + } + } + /// List repositories with GitHub Actions cache usage for an organization + /// + /// Lists repositories and their GitHub Actions cache usage for an organization. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. + public enum actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-actions-cache-usage-by-repo-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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/cache/usage-by-repository/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/cache/usage-by-repository/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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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/cache/usage-by-repository/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/repository_cache_usages`. + public var repository_cache_usages: [Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repository] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - repository_cache_usages: + public init( + total_count: Swift.Int, + repository_cache_usages: [Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repository] + ) { + self.total_count = total_count + self.repository_cache_usages = repository_cache_usages + } + public enum CodingKeys: String, CodingKey { + case total_count + case repository_cache_usages + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_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 + ] + } + } + } + /// List GitHub-hosted runners for an organization + /// + /// Lists all GitHub-hosted runners configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. + public enum actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/list-hosted-runners-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/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_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-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/hosted-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/hosted-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_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-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_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_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/hosted-runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-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_hosted_hyphen_runners_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.actions_hyphen_hosted_hyphen_runner] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - runners: + public init( + total_count: Swift.Int, + runners: [Components.Schemas.actions_hyphen_hosted_hyphen_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/hosted-runners/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_list_hyphen_hosted_hyphen_runners_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_hosted_hyphen_runners_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_hosted_hyphen_runners_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_hosted_hyphen_runners_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_list_hyphen_hosted_hyphen_runners_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_list_hyphen_hosted_hyphen_runners_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_hosted_hyphen_runners_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 GitHub-hosted runner for an organization + /// + /// Creates a GitHub-hosted runner for an organization. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. + public enum actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/create-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/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_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/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_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/name`. + public var name: Swift.String + /// The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image`. + public struct imagePayload: Codable, Hashable, Sendable { + /// The unique identifier of the runner image. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image/id`. + public var id: Swift.String? + /// The source of the runner image. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image/source`. + @frozen public enum sourcePayload: String, Codable, Hashable, Sendable { + case github = "github" + case partner = "partner" + case custom = "custom" + } + /// The source of the runner image. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image/source`. + public var source: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload.imagePayload.sourcePayload? + /// Creates a new `imagePayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the runner image. + /// - source: The source of the runner image. + public init( + id: Swift.String? = nil, + source: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload.imagePayload.sourcePayload? = nil + ) { + self.id = id + self.source = source + } + public enum CodingKeys: String, CodingKey { + case id + case source + } + } + /// The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image`. + public var image: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload.imagePayload + /// The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/size`. + public var size: Swift.String + /// The existing runner group to add this runner to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/runner_group_id`. + public var runner_group_id: Swift.Int + /// The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/maximum_runners`. + public var maximum_runners: Swift.Int? + /// Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/enable_static_ip`. + public var enable_static_ip: Swift.Bool? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// - image: The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`. + /// - size: The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes` + /// - runner_group_id: The existing runner group to add this runner to. + /// - maximum_runners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// - enable_static_ip: Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` + public init( + name: Swift.String, + image: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload.imagePayload, + size: Swift.String, + runner_group_id: Swift.Int, + maximum_runners: Swift.Int? = nil, + enable_static_ip: Swift.Bool? = nil + ) { + self.name = name + self.image = image + self.size = size + self.runner_group_id = runner_group_id + self.maximum_runners = maximum_runners + self.enable_static_ip = enable_static_ip + } + public enum CodingKeys: String, CodingKey { + case name + case image + case size + case runner_group_id + case maximum_runners + case enable_static_ip + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/content/application\/json`. + case json(Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_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/hosted-runners/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/responses/201/content/application\/json`. + case json(Components.Schemas.actions_hyphen_hosted_hyphen_runner) + /// 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.actions_hyphen_hosted_hyphen_runner { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_create_hyphen_hosted_hyphen_runner_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_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.actions_sol_create_hyphen_hosted_hyphen_runner_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_hosted_hyphen_runner_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 GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runners-github-owned-images-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/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_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/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_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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/hosted-runners/images/github-owned/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - images: + public init( + total_count: Swift.Int, + images: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image] + ) { + self.total_count = total_count + self.images = images + } + public enum CodingKeys: String, CodingKey { + case total_count + case images + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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_hosted_hyphen_runners_hyphen_github_hyphen_owned_hyphen_images_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) } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) } - public func encode(to encoder: any Encoder) throws { + public var rawValue: Swift.String { switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) + case let .other(string): + return string + case .json: + return "application/json" } } + public static var allCases: [Self] { + [ + .json + ] + } } - /// The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`. - /// - /// - Remark: Generated from `#/components/parameters/environment-name`. - public typealias environment_hyphen_name = 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 validation_failed_simple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.validation_hyphen_error_hyphen_simple) - /// The associated value of the enum case if `self` is `.json`. + /// Get partner images for GitHub-hosted runners in an organization + /// + /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runners-partner-images-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.validation_hyphen_error_hyphen_simple { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/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 } } - /// Received HTTP response body - public var body: Components.Responses.validation_failed_simple.Body - /// Creates a new `validation_failed_simple`. + public var path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/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_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.validation_failed_simple.Body) { - self.body = body + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.headers = headers } } - 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 + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - images: + public init( + total_count: Swift.Int, + images: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_image] + ) { + self.total_count = total_count + self.images = images + } + public enum CodingKeys: String, CodingKey { + case total_count + case images + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_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_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_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_hosted_hyphen_runners_hyphen_partner_hyphen_images_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.not_found.Body - /// Creates a new `not_found`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.not_found.Body) { - self.body = body + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_partner_hyphen_images_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_hosted_hyphen_runners_hyphen_partner_hyphen_images_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) } - 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 - ) - } - } + @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) } - /// - 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`. + } + 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 limits on GitHub-hosted runners for an organization + /// + /// Get the GitHub-hosted runners limits for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runners-limits-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - 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 - ) - } - } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/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_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/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 } } - /// Received HTTP response body - public var body: Components.Responses.bad_request.Body - /// Creates a new `bad_request`. + public var headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.bad_request.Body) { - self.body = body + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.headers = headers } } - 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 + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content/application\/json`. + case json(Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_limits) + /// 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.actions_hyphen_hosted_hyphen_runner_hyphen_limits { + get throws { + switch self { + case let .json(body): + return body + } } } } + /// Received HTTP response body + public var body: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_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_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.forbidden.Body - /// Creates a new `forbidden`. + /// Response /// - /// - 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 - } + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_limits_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_hosted_hyphen_runners_hyphen_limits_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { - self.body = body + /// 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 + ] } } - public struct conflict: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// The associated value of the enum case if `self` is `.json`. + } + /// Get GitHub-hosted runners machine specs for an organization + /// + /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runners-machine-specs-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - 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 - } - } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/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 } } - /// Received HTTP response body - public var body: Components.Responses.conflict.Body - /// Creates a new `conflict`. + public var path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/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_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.conflict.Body) { - self.body = body + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.headers = headers } } - public struct actions_runner_jitconfig: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json/runner`. - public var runner: Components.Schemas.runner - /// The base64 encoded runner configuration. - /// - /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/json/encoded_jit_config`. - public var encoded_jit_config: Swift.String - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - runner: - /// - encoded_jit_config: The base64 encoded runner configuration. - public init( - runner: Components.Schemas.runner, - encoded_jit_config: Swift.String - ) { - self.runner = runner - self.encoded_jit_config = encoded_jit_config + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/machine_specs`. + public var machine_specs: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - machine_specs: + public init( + total_count: Swift.Int, + machine_specs: [Components.Schemas.actions_hyphen_hosted_hyphen_runner_hyphen_machine_hyphen_spec] + ) { + self.total_count = total_count + self.machine_specs = machine_specs + } + public enum CodingKeys: String, CodingKey { + case total_count + case machine_specs + } } - public enum CodingKeys: String, CodingKey { - case runner - case encoded_jit_config + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_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_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } } } - /// - Remark: Generated from `#/components/responses/actions_runner_jitconfig/content/application\/json`. - case json(Components.Responses.actions_runner_jitconfig.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. + /// Received HTTP response body + public var body: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Responses.actions_runner_jitconfig.Body.jsonPayload { - get throws { - switch self { - case let .json(body): - return body - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_machine_hyphen_specs_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_hosted_hyphen_runners_hyphen_machine_hyphen_specs_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.actions_runner_jitconfig.Body - /// Creates a new `actions_runner_jitconfig`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.actions_runner_jitconfig.Body) { - self.body = body + /// 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 + ] } } - public struct actions_runner_labels: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/json/labels`. - public var labels: [Components.Schemas.runner_hyphen_label] - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_count: - /// - labels: - public init( - total_count: Swift.Int, - labels: [Components.Schemas.runner_hyphen_label] - ) { - self.total_count = total_count - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case total_count - case labels - } + } + /// Get platforms for GitHub-hosted runners in an organization + /// + /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runners-platforms-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/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 } - /// - Remark: Generated from `#/components/responses/actions_runner_labels/content/application\/json`. - case json(Components.Responses.actions_runner_labels.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. + } + public var path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Responses.actions_runner_labels.Body.jsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - /// Received HTTP response body - public var body: Components.Responses.actions_runner_labels.Body - /// Creates a new `actions_runner_labels`. + public var headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.actions_runner_labels.Body) { - self.body = body + /// - path: + /// - headers: + public init( + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Input.Headers = .init() + ) { + self.path = path + self.headers = headers } } - public struct actions_runner_labels_readonly: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/json/labels`. - public var labels: [Components.Schemas.runner_hyphen_label] - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_count: - /// - labels: - public init( - total_count: Swift.Int, - labels: [Components.Schemas.runner_hyphen_label] - ) { - self.total_count = total_count - self.labels = labels + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/platforms`. + public var platforms: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - platforms: + public init( + total_count: Swift.Int, + platforms: [Swift.String] + ) { + self.total_count = total_count + self.platforms = platforms + } + public enum CodingKeys: String, CodingKey { + case total_count + case platforms + } } - public enum CodingKeys: String, CodingKey { - case total_count - case labels + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_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_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } } } - /// - Remark: Generated from `#/components/responses/actions_runner_labels_readonly/content/application\/json`. - case json(Components.Responses.actions_runner_labels_readonly.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. + /// Received HTTP response body + public var body: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Responses.actions_runner_labels_readonly.Body.jsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body } } - /// Received HTTP response body - public var body: Components.Responses.actions_runner_labels_readonly.Body - /// Creates a new `actions_runner_labels_readonly`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.actions_runner_labels_readonly.Body) { - self.body = body - } - } - public struct gone: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/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 - } + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runners_hyphen_platforms_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_hosted_hyphen_runners_hyphen_platforms_hyphen_for_hyphen_org.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.gone.Body - /// Creates a new `gone`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.gone.Body) { - self.body = body - } + /// 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 - /// - Remark: Generated from `#/components/headers/location`. - public typealias location = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// Get GitHub Actions cache usage for an organization + /// Get a GitHub-hosted runner for an organization /// - /// Gets the total GitHub Actions cache usage for an organization. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// Gets a GitHub-hosted runner configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)`. - public enum actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org { - public static let id: Swift.String = "actions/get-actions-cache-usage-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public enum actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/get-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/org`. public var org: Components.Parameters.org + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/hosted_runner_id`. + public var hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.org) { + /// - hosted_runner_id: Unique identifier of the GitHub-hosted runner. + public init( + org: Components.Parameters.org, + hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id + ) { self.org = org + self.hosted_runner_id = hosted_runner_id } } - public var path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/header`. + public var path: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_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.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Headers + public var headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Path, - headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Input.Headers = .init() + path: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -10098,9 +12454,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers/Link`. public var Link: Components.Headers.link? /// Creates a new `Headers`. /// @@ -10111,16 +12467,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content`. + public var headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_org_hyphen_enterprise) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.actions_hyphen_hosted_hyphen_runner) /// 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.actions_hyphen_cache_hyphen_usage_hyphen_org_hyphen_enterprise { + public var json: Components.Schemas.actions_hyphen_hosted_hyphen_runner { get throws { switch self { case let .json(body): @@ -10130,15 +12486,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Body + public var body: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), - body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok.Body + headers: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok.Body ) { self.headers = headers self.body = body @@ -10146,15 +12502,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok) + case ok(Operations.actions_sol_get_hyphen_hosted_hyphen_runner_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_actions_hyphen_cache_hyphen_usage_hyphen_for_hyphen_org.Output.Ok { + public var ok: Operations.actions_sol_get_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok { get throws { switch self { case let .ok(response): @@ -10198,133 +12554,269 @@ public enum Operations { } } } - /// List repositories with GitHub Actions cache usage for an organization - /// - /// Lists repositories and their GitHub Actions cache usage for an organization. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// Update a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. - public enum actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org { - public static let id: Swift.String = "actions/get-actions-cache-usage-by-repo-for-org" + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + public enum actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/update-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/org`. public var org: Components.Parameters.org + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/hosted_runner_id`. + public var hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.org) { + /// - hosted_runner_id: Unique identifier of the GitHub-hosted runner. + public init( + org: Components.Parameters.org, + hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id + ) { self.org = org + self.hosted_runner_id = hosted_runner_id } } - public var path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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)." + public var path: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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)." + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The existing runner group to add this runner to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/runner_group_id`. + public var runner_group_id: Swift.Int? + /// The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/maximum_runners`. + public var maximum_runners: Swift.Int? + /// Whether this runner should be updated with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/enable_static_ip`. + public var enable_static_ip: Swift.Bool? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// - runner_group_id: The existing runner group to add this runner to. + /// - maximum_runners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// - enable_static_ip: Whether this runner should be updated with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` + public init( + name: Swift.String? = nil, + runner_group_id: Swift.Int? = nil, + maximum_runners: Swift.Int? = nil, + enable_static_ip: Swift.Bool? = nil + ) { + self.name = name + self.runner_group_id = runner_group_id + self.maximum_runners = maximum_runners + self.enable_static_ip = enable_static_ip + } + public enum CodingKeys: String, CodingKey { + case name + case runner_group_id + case maximum_runners + case enable_static_ip + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_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/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.actions_hyphen_hosted_hyphen_runner) + /// 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.actions_hyphen_hosted_hyphen_runner { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/query/page`. - public var page: Components.Parameters.page? - /// Creates a new `Query`. + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.actions_sol_update_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_update_hyphen_hosted_hyphen_runner_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_hosted_hyphen_runner_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 GitHub-hosted runner for an organization + /// + /// Deletes a GitHub-hosted runner for an organization. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + public enum actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/delete-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_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/hosted-runners/{hosted_runner_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/hosted_runner_id`. + public var hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id + /// Creates a new `Path`. /// /// - 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)." + /// - org: The organization name. The name is not case sensitive. + /// - hosted_runner_id: Unique identifier of the GitHub-hosted runner. public init( - per_page: Components.Parameters.per_hyphen_page? = nil, - page: Components.Parameters.page? = nil + org: Components.Parameters.org, + hosted_runner_id: Components.Parameters.hosted_hyphen_runner_hyphen_id ) { - self.per_page = per_page - self.page = page + self.org = org + self.hosted_runner_id = hosted_runner_id } } - public var query: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/header`. + public var path: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/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.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Headers + public var headers: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Path, - query: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Query = .init(), - headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Input.Headers = .init() + path: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Input.Path, + headers: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_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/cache/usage-by-repository/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/repository_cache_usages`. - public var repository_cache_usages: [Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repository] - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_count: - /// - repository_cache_usages: - public init( - total_count: Swift.Int, - repository_cache_usages: [Components.Schemas.actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repository] - ) { - self.total_count = total_count - self.repository_cache_usages = repository_cache_usages - } - public enum CodingKeys: String, CodingKey { - case total_count - case repository_cache_usages - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/application\/json`. - case json(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload) + @frozen public enum Output: Sendable, Hashable { + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content/application\/json`. + case json(Components.Schemas.actions_hyphen_hosted_hyphen_runner) /// 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_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Body.jsonPayload { + public var json: Components.Schemas.actions_hyphen_hosted_hyphen_runner { get throws { switch self { case let .json(body): @@ -10334,38 +12826,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Accepted.Body + /// Creates a new `Accepted`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), - body: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Accepted.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)/responses/202`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `202 accepted`. + case accepted(Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.actions_sol_get_hyphen_actions_hyphen_cache_hyphen_usage_hyphen_by_hyphen_repo_hyphen_for_hyphen_org.Output.Ok { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.actions_sol_delete_hyphen_hosted_hyphen_runner_hyphen_for_hyphen_org.Output.Accepted { get throws { switch self { - case let .ok(response): + case let .accepted(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "accepted", response: self ) } @@ -11772,6 +14259,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_workflows`. public var selected_workflows: [Swift.String]? + /// The identifier of a hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/network_configuration_id`. + public var network_configuration_id: Swift.String? /// Creates a new `jsonPayload`. /// /// - Parameters: @@ -11782,6 +14273,7 @@ public enum Operations { /// - 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`. + /// - network_configuration_id: The identifier of a hosted compute network configuration. 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, @@ -11789,7 +14281,8 @@ public enum Operations { runners: [Swift.Int]? = nil, allows_public_repositories: Swift.Bool? = nil, restricted_to_workflows: Swift.Bool? = nil, - selected_workflows: [Swift.String]? = nil + selected_workflows: [Swift.String]? = nil, + network_configuration_id: Swift.String? = nil ) { self.name = name self.visibility = visibility @@ -11798,6 +14291,7 @@ public enum Operations { self.allows_public_repositories = allows_public_repositories self.restricted_to_workflows = restricted_to_workflows self.selected_workflows = selected_workflows + self.network_configuration_id = network_configuration_id } public enum CodingKeys: String, CodingKey { case name @@ -11807,6 +14301,7 @@ public enum Operations { case allows_public_repositories case restricted_to_workflows case selected_workflows + case network_configuration_id } } /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. @@ -12134,6 +14629,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. public var selected_workflows: [Swift.String]? + /// The identifier of a hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/network_configuration_id`. + public var network_configuration_id: Swift.String? /// Creates a new `jsonPayload`. /// /// - Parameters: @@ -12142,18 +14641,21 @@ public enum Operations { /// - 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`. + /// - network_configuration_id: The identifier of a hosted compute network configuration. 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 + selected_workflows: [Swift.String]? = nil, + network_configuration_id: 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 + self.network_configuration_id = network_configuration_id } public enum CodingKeys: String, CodingKey { case name @@ -12161,6 +14663,7 @@ public enum Operations { case allows_public_repositories case restricted_to_workflows case selected_workflows + case network_configuration_id } } /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. @@ -12343,6 +14846,218 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } + /// List GitHub-hosted runners in a group for an organization + /// + /// Lists the GitHub-hosted runners in an 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}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public enum actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org { + public static let id: Swift.String = "actions/list-github-hosted-runners-in-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-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}/hosted-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}/hosted-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_github_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}/hosted-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}/hosted-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}/hosted-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_github_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}/hosted-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_github_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_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Path, + query: Operations.actions_sol_list_hyphen_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.actions_sol_list_hyphen_github_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}/hosted-runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-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_github_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}/hosted-runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-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}/hosted-runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.actions_hyphen_hosted_hyphen_runner] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - runners: + public init( + total_count: Swift.Double, + runners: [Components.Schemas.actions_hyphen_hosted_hyphen_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}/hosted-runners/GET/responses/200/content/application\/json`. + case json(Operations.actions_sol_list_hyphen_github_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_github_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_github_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_github_hyphen_hosted_hyphen_runners_hyphen_in_hyphen_group_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.actions_sol_list_hyphen_github_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}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.actions_sol_list_hyphen_github_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_github_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 + ] + } + } + } /// 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. @@ -13817,6 +16532,29 @@ public enum Operations { } } } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -15735,11 +18473,11 @@ public enum Operations { /// Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/actions/secrets#get-an-organization-public-key) endpoint. /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/encrypted_value`. - public var encrypted_value: Swift.String? + public var encrypted_value: Swift.String /// ID of the key you used to encrypt the secret. /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/key_id`. - public var key_id: Swift.String? + public var key_id: Swift.String /// Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/visibility`. @@ -15764,8 +18502,8 @@ public enum Operations { /// - visibility: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. /// - selected_repository_ids: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. public init( - encrypted_value: Swift.String? = nil, - key_id: Swift.String? = nil, + encrypted_value: Swift.String, + key_id: Swift.String, visibility: Operations.actions_sol_create_hyphen_or_hyphen_update_hyphen_org_hyphen_secret.Input.Body.jsonPayload.visibilityPayload, selected_repository_ids: [Swift.Int]? = nil ) { @@ -21998,6 +24736,29 @@ public enum Operations { } } } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-repo)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -26810,6 +29571,9 @@ public enum Operations { } /// Get workflow run usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// Anyone with read access to the repository can use this endpoint. @@ -27537,19 +30301,19 @@ public enum Operations { /// Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/secrets/{secret_name}/PUT/requestBody/json/encrypted_value`. - public var encrypted_value: Swift.String? + public var encrypted_value: Swift.String /// ID of the key you used to encrypt the secret. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/secrets/{secret_name}/PUT/requestBody/json/key_id`. - public var key_id: Swift.String? + public var key_id: Swift.String /// Creates a new `jsonPayload`. /// /// - Parameters: /// - encrypted_value: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint. /// - key_id: ID of the key you used to encrypt the secret. public init( - encrypted_value: Swift.String? = nil, - key_id: Swift.String? = nil + encrypted_value: Swift.String, + key_id: Swift.String ) { self.encrypted_value = encrypted_value self.key_id = key_id @@ -29684,6 +32448,9 @@ public enum Operations { } /// Get workflow usage /// + /// > [!WARNING] + /// > This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information. + /// /// Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// /// You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. From 413b761864c88bf8b7bfa38dfe125f0d0aab8dfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:39:44 +0000 Subject: [PATCH 03/37] Commit via running ake Sources/activity --- Sources/activity/Types.swift | 494 ++++++++++++++++++++++++++--------- 1 file changed, 367 insertions(+), 127 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 1452bab8ffc..6f47ce2a5da 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -1025,149 +1025,87 @@ public enum Components { case status } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type } } /// Validation Error @@ -1295,6 +1233,151 @@ public enum Components { case errors } } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -2298,6 +2381,96 @@ public enum Components { case due_on } } + /// The type of issue. + /// + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct issue_hyphen_type: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var node_id: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.issue_hyphen_type.colorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var created_at: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updated_at: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var is_enabled: Swift.Bool? + /// Creates a new `issue_hyphen_type`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - node_id: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - created_at: The time the issue type created. + /// - updated_at: The time the issue type last updated. + /// - is_enabled: The enabled state of the issue type. + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.issue_hyphen_type.colorPayload? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + is_enabled: Swift.Bool? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.description = description + self.color = color + self.created_at = created_at + self.updated_at = updated_at + self.is_enabled = is_enabled + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case description + case color + case created_at + case updated_at + case is_enabled + } + } /// 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. /// /// - Remark: Generated from `#/components/schemas/nullable-integration`. @@ -2315,7 +2488,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. @@ -2475,7 +2683,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -2859,6 +3067,8 @@ public enum Components { public var body_text: Swift.String? /// - Remark: Generated from `#/components/schemas/issue/timeline_url`. public var timeline_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/type`. + public var _type: Components.Schemas.issue_hyphen_type? /// - Remark: Generated from `#/components/schemas/issue/repository`. public var repository: Components.Schemas.repository? /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. @@ -2902,6 +3112,7 @@ public enum Components { /// - body_html: /// - body_text: /// - timeline_url: + /// - _type: /// - repository: /// - performed_via_github_app: /// - author_association: @@ -2938,6 +3149,7 @@ public enum Components { body_html: Swift.String? = nil, body_text: Swift.String? = nil, timeline_url: Swift.String? = nil, + _type: Components.Schemas.issue_hyphen_type? = nil, repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, @@ -2974,6 +3186,7 @@ public enum Components { self.body_html = body_html self.body_text = body_text self.timeline_url = timeline_url + self._type = _type self.repository = repository self.performed_via_github_app = performed_via_github_app self.author_association = author_association @@ -3011,6 +3224,7 @@ public enum Components { case body_html case body_text case timeline_url + case _type = "type" case repository case performed_via_github_app case author_association @@ -3498,6 +3712,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -3620,6 +3856,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -3627,6 +3864,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -3634,6 +3872,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -3642,6 +3881,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection From 536f007c47473cc1f64c397979761de6a3e09ced Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:40:07 +0000 Subject: [PATCH 04/37] Commit via running ake Sources/apps --- Sources/apps/Types.swift | 473 +++++++++++++++++++++------------------ 1 file changed, 254 insertions(+), 219 deletions(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index e91faf1ea61..11643af50bb 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -1190,149 +1190,87 @@ public enum Components { case errors } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - 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. @@ -1352,7 +1290,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/integration/owner`. + public var owner: Components.Schemas.integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/integration/name`. @@ -1512,7 +1485,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -1657,7 +1630,7 @@ public enum Components { /// Unique identifier of the webhook delivery. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/id`. - public var id: Swift.Int + public var id: Swift.Int64 /// Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/guid`. @@ -1693,11 +1666,11 @@ public enum Components { /// The id of the GitHub App installation associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/installation_id`. - public var installation_id: Swift.Int? + public var installation_id: Swift.Int64? /// The id of the repository associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/repository_id`. - public var repository_id: Swift.Int? + public var repository_id: Swift.Int64? /// Time when the webhook delivery was throttled. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/throttled_at`. @@ -1718,7 +1691,7 @@ public enum Components { /// - repository_id: The id of the repository associated with this event. /// - throttled_at: Time when the webhook delivery was throttled. public init( - id: Swift.Int, + id: Swift.Int64, guid: Swift.String, delivered_at: Foundation.Date, redelivery: Swift.Bool, @@ -1727,8 +1700,8 @@ public enum Components { status_code: Swift.Int, event: Swift.String, action: Swift.String? = nil, - installation_id: Swift.Int? = nil, - repository_id: Swift.Int? = nil, + installation_id: Swift.Int64? = nil, + repository_id: Swift.Int64? = nil, throttled_at: Foundation.Date? = nil ) { self.id = id @@ -2176,89 +2149,6 @@ public enum Components { case response } } - /// An enterprise on GitHub. - /// - /// - Remark: Generated from `#/components/schemas/enterprise`. - public struct enterprise: Codable, Hashable, Sendable { - /// A short description of the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. - public var html_url: Swift.String - /// The enterprise's website URL. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. - public var website_url: Swift.String? - /// Unique identifier of the enterprise - /// - /// - Remark: Generated from `#/components/schemas/enterprise/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. - public var node_id: Swift.String - /// The name of the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/name`. - public var name: Swift.String - /// The slug url identifier for the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. - public var updated_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. - public var avatar_url: Swift.String - /// Creates a new `enterprise`. - /// - /// - Parameters: - /// - description: A short description of the enterprise. - /// - html_url: - /// - website_url: The enterprise's website URL. - /// - id: Unique identifier of the enterprise - /// - node_id: - /// - name: The name of the enterprise. - /// - slug: The slug url identifier for the enterprise. - /// - created_at: - /// - updated_at: - /// - avatar_url: - public init( - description: Swift.String? = nil, - html_url: Swift.String, - website_url: Swift.String? = nil, - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - created_at: Foundation.Date? = nil, - updated_at: Foundation.Date? = nil, - avatar_url: Swift.String - ) { - self.description = description - self.html_url = html_url - self.website_url = website_url - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.created_at = created_at - self.updated_at = updated_at - self.avatar_url = avatar_url - } - public enum CodingKeys: String, CodingKey { - case description - case html_url - case website_url - case id - case node_id - case name - case slug - case created_at - case updated_at - case avatar_url - } - } /// Request to install an integration on a target /// /// - Remark: Generated from `#/components/schemas/integration-installation-request`. @@ -2408,14 +2298,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/contents`. public var contents: Components.Schemas.app_hyphen_permissions.contentsPayload? - /// The leve of permission to grant the access token to manage Dependabot secrets. + /// The level of permission to grant the access token to manage Dependabot secrets. /// /// - Remark: Generated from `#/components/schemas/app-permissions/dependabot_secrets`. @frozen public enum dependabot_secretsPayload: String, Codable, Hashable, Sendable { case read = "read" case write = "write" } - /// The leve of permission to grant the access token to manage Dependabot secrets. + /// The level of permission to grant the access token to manage Dependabot secrets. /// /// - Remark: Generated from `#/components/schemas/app-permissions/dependabot_secrets`. public var dependabot_secrets: Components.Schemas.app_hyphen_permissions.dependabot_secretsPayload? @@ -2887,7 +2777,7 @@ public enum Components { /// - checks: The level of permission to grant the access token for checks on code. /// - codespaces: The level of permission to grant the access token to create, edit, delete, and list Codespaces. /// - contents: The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. - /// - dependabot_secrets: The leve of permission to grant the access token to manage Dependabot secrets. + /// - dependabot_secrets: The level of permission to grant the access token to manage Dependabot secrets. /// - deployments: The level of permission to grant the access token for deployments and deployment statuses. /// - environments: The level of permission to grant the access token for managing repository environments. /// - issues: The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. @@ -3080,6 +2970,151 @@ public enum Components { case starring } } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } /// Installation /// /// - Remark: Generated from `#/components/schemas/installation`. From d369184306f4b882cbb5b769669db608bf609fa7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:40:31 +0000 Subject: [PATCH 05/37] Commit via running ake Sources/billing --- Sources/billing/Types.swift | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 6ad744b92e7..607928e5ff5 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -690,19 +690,19 @@ 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. + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. 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`. + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. /// /// - 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`. + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. /// /// - 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`. + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. /// /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. public typealias billing_hyphen_usage_hyphen_report_hyphen_hour = Swift.Int @@ -795,34 +795,6 @@ public enum Components { 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 { @@ -908,6 +880,34 @@ public enum Components { 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 + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} @@ -943,29 +943,29 @@ public enum Operations { 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. + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. 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`. + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. /// /// - 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`. + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. /// /// - 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`. + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. /// /// - 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`. + /// - 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, `2025`. 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`. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. public init( year: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_year? = nil, month: Components.Parameters.billing_hyphen_usage_hyphen_report_hyphen_month? = nil, From c42f3cc0730a262b66431f1d1140ef3f9fc64b11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:40:54 +0000 Subject: [PATCH 06/37] Commit via running ake Sources/checks --- Sources/checks/Client.swift | 2 +- Sources/checks/Types.swift | 259 ++++++++++++++++++------------------ 2 files changed, 130 insertions(+), 131 deletions(-) diff --git a/Sources/checks/Client.swift b/Sources/checks/Client.swift index c5b2d196a42..38920d58672 100644 --- a/Sources/checks/Client.swift +++ b/Sources/checks/Client.swift @@ -362,7 +362,7 @@ public struct Client: APIProtocol { } /// Rerequest a check run /// - /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, the `status` of the check suite it belongs to is reset to `queued` and the `conclusion` is cleared. The check run itself is not updated. GitHub apps recieving the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) with the `rerequested` action should then decide if the check run should be reset or updated and call the [update `check_run` endpoint](https://docs.github.com/rest/checks/runs#update-a-check-run) to update the check_run if desired. /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index 5a86e0e5cf2..36299b84caf 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -60,7 +60,7 @@ public protocol APIProtocol: Sendable { func checks_sol_list_hyphen_annotations(_ input: Operations.checks_sol_list_hyphen_annotations.Input) async throws -> Operations.checks_sol_list_hyphen_annotations.Output /// Rerequest a check run /// - /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, the `status` of the check suite it belongs to is reset to `queued` and the `conclusion` is cleared. The check run itself is not updated. GitHub apps recieving the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) with the `rerequested` action should then decide if the check run should be reset or updated and call the [update `check_run` endpoint](https://docs.github.com/rest/checks/runs#update-a-check-run) to update the check_run if desired. /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// @@ -239,7 +239,7 @@ extension APIProtocol { } /// Rerequest a check run /// - /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, the `status` of the check suite it belongs to is reset to `queued` and the `conclusion` is cleared. The check run itself is not updated. GitHub apps recieving the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) with the `rerequested` action should then decide if the check run should be reset or updated and call the [update `check_run` endpoint](https://docs.github.com/rest/checks/runs#update-a-check-run) to update the check_run if desired. /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// @@ -599,149 +599,87 @@ public enum Components { case status } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type } } /// Code Of Conduct @@ -804,7 +742,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. @@ -964,7 +937,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -1040,6 +1013,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -1162,6 +1157,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -1169,6 +1165,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -1176,6 +1173,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -1184,6 +1182,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -3604,7 +3603,7 @@ public enum Operations { } /// Rerequest a check run /// - /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + /// Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, the `status` of the check suite it belongs to is reset to `queued` and the `conclusion` is cleared. The check run itself is not updated. GitHub apps recieving the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) with the `rerequested` action should then decide if the check run should be reset or updated and call the [update `check_run` endpoint](https://docs.github.com/rest/checks/runs#update-a-check-run) to update the check_run if desired. /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// From 16594cc59ad216e97bf100748882e7dab9d2f923 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:41:17 +0000 Subject: [PATCH 07/37] Commit via running ake Sources/code-scanning --- Sources/code-scanning/Client.swift | 542 +++++++++++ Sources/code-scanning/Types.swift | 1343 ++++++++++++++++++++++++++-- 2 files changed, 1803 insertions(+), 82 deletions(-) diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 694f4025f5c..c9fefb816da 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -651,6 +651,37 @@ 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 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.code_scanning_forbidden_write.Body @@ -729,6 +760,517 @@ public struct Client: APIProtocol { } ) } + /// Get the status of an autofix for a code scanning alert + /// + /// Gets the status and description of an autofix for a code scanning alert. + /// + /// 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. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)`. + public func code_hyphen_scanning_sol_get_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-scanning/alerts/{}/autofix", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alert_number + ] + ) + 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.code_hyphen_scanning_sol_get_hyphen_autofix.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.code_hyphen_scanning_hyphen_autofix.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.code_scanning_bad_request.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 .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.code_scanning_forbidden_read.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 an autofix for a code scanning alert + /// + /// Creates an autofix for a code scanning alert. + /// + /// If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. + /// + /// If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. + /// + /// 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. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)`. + public func code_hyphen_scanning_sol_create_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-scanning/alerts/{}/autofix", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alert_number + ] + ) + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.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.code_hyphen_scanning_hyphen_autofix.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.code_hyphen_scanning_hyphen_autofix.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.code_scanning_bad_request.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 .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.code_scanning_autofix_create_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()) + 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 + ) + ) + } + } + ) + } + /// Commit an autofix for a code scanning alert + /// + /// Commits an autofix for a code scanning alert. + /// + /// If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response. + /// + /// 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 `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)`. + public func code_hyphen_scanning_sol_commit_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-scanning/alerts/{}/autofix/commits", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alert_number + ] + ) + 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 .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + 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.code_hyphen_scanning_sol_commit_hyphen_autofix.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.code_hyphen_scanning_hyphen_autofix_hyphen_commits_hyphen_response.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.code_scanning_bad_request.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 .badRequest(.init(body: body)) + 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 422: + return .unprocessableContent(.init()) + 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 + ) + ) + } + } + ) + } /// List instances of a code scanning alert /// /// Lists all instances of the specified code scanning alert. diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index f1a2bfceab7..ada491d0dd3 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -52,6 +52,39 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/patch(code-scanning/update-alert)`. func code_hyphen_scanning_sol_update_hyphen_alert(_ input: Operations.code_hyphen_scanning_sol_update_hyphen_alert.Input) async throws -> Operations.code_hyphen_scanning_sol_update_hyphen_alert.Output + /// Get the status of an autofix for a code scanning alert + /// + /// Gets the status and description of an autofix for a code scanning alert. + /// + /// 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. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)`. + func code_hyphen_scanning_sol_get_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Output + /// Create an autofix for a code scanning alert + /// + /// Creates an autofix for a code scanning alert. + /// + /// If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. + /// + /// If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. + /// + /// 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. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)`. + func code_hyphen_scanning_sol_create_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output + /// Commit an autofix for a code scanning alert + /// + /// Commits an autofix for a code scanning alert. + /// + /// If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response. + /// + /// 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 `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)`. + func code_hyphen_scanning_sol_commit_hyphen_autofix(_ input: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input) async throws -> Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Output /// List instances of a code scanning alert /// /// Lists all instances of the specified code scanning alert. @@ -389,6 +422,65 @@ extension APIProtocol { body: body )) } + /// Get the status of an autofix for a code scanning alert + /// + /// Gets the status and description of an autofix for a code scanning alert. + /// + /// 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. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)`. + public func code_hyphen_scanning_sol_get_hyphen_autofix( + path: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Output { + try await code_hyphen_scanning_sol_get_hyphen_autofix(Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input( + path: path, + headers: headers + )) + } + /// Create an autofix for a code scanning alert + /// + /// Creates an autofix for a code scanning alert. + /// + /// If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. + /// + /// If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. + /// + /// 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. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)`. + public func code_hyphen_scanning_sol_create_hyphen_autofix( + path: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output { + try await code_hyphen_scanning_sol_create_hyphen_autofix(Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input( + path: path, + headers: headers + )) + } + /// Commit an autofix for a code scanning alert + /// + /// Commits an autofix for a code scanning alert. + /// + /// If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response. + /// + /// 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 `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)`. + public func code_hyphen_scanning_sol_commit_hyphen_autofix( + path: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Headers = .init(), + body: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Body? = nil + ) async throws -> Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Output { + try await code_hyphen_scanning_sol_commit_hyphen_autofix(Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input( + path: path, + headers: headers, + body: body + )) + } /// List instances of a code scanning alert /// /// Lists all instances of the specified code scanning alert. @@ -965,6 +1057,55 @@ public enum Components { 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 + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -1110,83 +1251,6 @@ public enum Components { case user_view_type } } - /// 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 - } - } - /// The security alert number. - /// - /// - Remark: Generated from `#/components/schemas/alert-number`. - public typealias alert_hyphen_number = Swift.Int - /// The REST API URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-url`. - public typealias alert_hyphen_url = Swift.String - /// The GitHub URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-html-url`. - public typealias alert_hyphen_html_hyphen_url = Swift.String - /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-created-at`. - public typealias alert_hyphen_created_hyphen_at = Foundation.Date - /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-updated-at`. - public typealias alert_hyphen_updated_hyphen_at = Foundation.Date - /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-dismissed-at`. - public typealias alert_hyphen_dismissed_hyphen_at = Foundation.Date - /// The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-fixed-at`. - public typealias alert_hyphen_fixed_hyphen_at = Foundation.Date /// A GitHub repository. /// /// - Remark: Generated from `#/components/schemas/simple-repository`. @@ -1566,6 +1630,34 @@ public enum Components { case hooks_url } } + /// The security alert number. + /// + /// - Remark: Generated from `#/components/schemas/alert-number`. + public typealias alert_hyphen_number = Swift.Int + /// The REST API URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-url`. + public typealias alert_hyphen_url = Swift.String + /// The GitHub URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-html-url`. + public typealias alert_hyphen_html_hyphen_url = Swift.String + /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-created-at`. + public typealias alert_hyphen_created_hyphen_at = Foundation.Date + /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-updated-at`. + public typealias alert_hyphen_updated_hyphen_at = Foundation.Date + /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-dismissed-at`. + public typealias alert_hyphen_dismissed_hyphen_at = Foundation.Date + /// The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-fixed-at`. + public typealias alert_hyphen_fixed_hyphen_at = Foundation.Date /// An object without any properties. /// /// - Remark: Generated from `#/components/schemas/empty-object`. @@ -1955,6 +2047,8 @@ public enum Components { public var most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/repository`. public var repository: Components.Schemas.simple_hyphen_repository + /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/dismissal_approved_by`. + public var dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// Creates a new `code_hyphen_scanning_hyphen_organization_hyphen_alert_hyphen_items`. /// /// - Parameters: @@ -1974,6 +2068,7 @@ public enum Components { /// - tool: /// - most_recent_instance: /// - repository: + /// - dismissal_approved_by: public init( number: Components.Schemas.alert_hyphen_number, created_at: Components.Schemas.alert_hyphen_created_hyphen_at, @@ -1990,7 +2085,8 @@ public enum Components { rule: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_rule_hyphen_summary, tool: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_tool, most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance, - repository: Components.Schemas.simple_hyphen_repository + repository: Components.Schemas.simple_hyphen_repository, + dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil ) { self.number = number self.created_at = created_at @@ -2008,6 +2104,7 @@ public enum Components { self.tool = tool self.most_recent_instance = most_recent_instance self.repository = repository + self.dismissal_approved_by = dismissal_approved_by } public enum CodingKeys: String, CodingKey { case number @@ -2026,6 +2123,7 @@ public enum Components { case tool case most_recent_instance case repository + case dismissal_approved_by } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items`. @@ -2060,6 +2158,8 @@ public enum Components { public var tool: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_tool /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/most_recent_instance`. public var most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/dismissal_approved_by`. + public var dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// Creates a new `code_hyphen_scanning_hyphen_alert_hyphen_items`. /// /// - Parameters: @@ -2078,6 +2178,7 @@ public enum Components { /// - rule: /// - tool: /// - most_recent_instance: + /// - dismissal_approved_by: public init( number: Components.Schemas.alert_hyphen_number, created_at: Components.Schemas.alert_hyphen_created_hyphen_at, @@ -2093,7 +2194,8 @@ public enum Components { dismissed_comment: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_comment? = nil, rule: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_rule_hyphen_summary, tool: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_tool, - most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance + most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance, + dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil ) { self.number = number self.created_at = created_at @@ -2110,6 +2212,7 @@ public enum Components { self.rule = rule self.tool = tool self.most_recent_instance = most_recent_instance + self.dismissal_approved_by = dismissal_approved_by } public enum CodingKeys: String, CodingKey { case number @@ -2127,6 +2230,7 @@ public enum Components { case rule case tool case most_recent_instance + case dismissal_approved_by } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule`. @@ -2262,6 +2366,8 @@ public enum Components { public var tool: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_tool /// - Remark: Generated from `#/components/schemas/code-scanning-alert/most_recent_instance`. public var most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance + /// - Remark: Generated from `#/components/schemas/code-scanning-alert/dismissal_approved_by`. + public var dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// Creates a new `code_hyphen_scanning_hyphen_alert`. /// /// - Parameters: @@ -2280,6 +2386,7 @@ public enum Components { /// - rule: /// - tool: /// - most_recent_instance: + /// - dismissal_approved_by: public init( number: Components.Schemas.alert_hyphen_number, created_at: Components.Schemas.alert_hyphen_created_hyphen_at, @@ -2295,7 +2402,8 @@ public enum Components { dismissed_comment: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_comment? = nil, rule: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_rule, tool: Components.Schemas.code_hyphen_scanning_hyphen_analysis_hyphen_tool, - most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance + most_recent_instance: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_instance, + dismissal_approved_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil ) { self.number = number self.created_at = created_at @@ -2312,6 +2420,7 @@ public enum Components { self.rule = rule self.tool = tool self.most_recent_instance = most_recent_instance + self.dismissal_approved_by = dismissal_approved_by } public enum CodingKeys: String, CodingKey { case number @@ -2329,6 +2438,7 @@ public enum Components { case rule case tool case most_recent_instance + case dismissal_approved_by } } /// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. @@ -2338,6 +2448,112 @@ public enum Components { case open = "open" case dismissed = "dismissed" } + /// If `true`, attempt to create an alert dismissal request. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-create-request`. + public typealias code_hyphen_scanning_hyphen_alert_hyphen_create_hyphen_request = Swift.Bool + /// The status of an autofix. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-status`. + @frozen public enum code_hyphen_scanning_hyphen_autofix_hyphen_status: String, Codable, Hashable, Sendable { + case pending = "pending" + case error = "error" + case success = "success" + case outdated = "outdated" + } + /// The description of an autofix. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-description`. + public typealias code_hyphen_scanning_hyphen_autofix_hyphen_description = Swift.String + /// The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-started-at`. + public typealias code_hyphen_scanning_hyphen_autofix_hyphen_started_hyphen_at = Foundation.Date + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix`. + public struct code_hyphen_scanning_hyphen_autofix: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix/status`. + public var status: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_status + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix/description`. + public var description: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_description? + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix/started_at`. + public var started_at: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_started_hyphen_at + /// Creates a new `code_hyphen_scanning_hyphen_autofix`. + /// + /// - Parameters: + /// - status: + /// - description: + /// - started_at: + public init( + status: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_status, + description: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_description? = nil, + started_at: Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_started_hyphen_at + ) { + self.status = status + self.description = description + self.started_at = started_at + } + public enum CodingKeys: String, CodingKey { + case status + case description + case started_at + } + } + /// Commit an autofix for a code scanning alert + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits`. + public struct code_hyphen_scanning_hyphen_autofix_hyphen_commits: Codable, Hashable, Sendable { + /// The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits/target_ref`. + public var target_ref: Swift.String? + /// Commit message to be used. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits/message`. + public var message: Swift.String? + /// Creates a new `code_hyphen_scanning_hyphen_autofix_hyphen_commits`. + /// + /// - Parameters: + /// - target_ref: The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// - message: Commit message to be used. + public init( + target_ref: Swift.String? = nil, + message: Swift.String? = nil + ) { + self.target_ref = target_ref + self.message = message + } + public enum CodingKeys: String, CodingKey { + case target_ref + case message + } + } + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits-response`. + public struct code_hyphen_scanning_hyphen_autofix_hyphen_commits_hyphen_response: Codable, Hashable, Sendable { + /// The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits-response/target_ref`. + public var target_ref: Swift.String? + /// SHA of commit with autofix. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-autofix-commits-response/sha`. + public var sha: Swift.String? + /// Creates a new `code_hyphen_scanning_hyphen_autofix_hyphen_commits_hyphen_response`. + /// + /// - Parameters: + /// - target_ref: The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + /// - sha: SHA of commit with autofix. + public init( + target_ref: Swift.String? = nil, + sha: Swift.String? = nil + ) { + self.target_ref = target_ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case target_ref + case sha + } + } /// An identifier for the upload. /// /// - Remark: Generated from `#/components/schemas/code-scanning-analysis-sarif-id`. @@ -2598,6 +2814,7 @@ public enum Components { case javascript = "javascript" case python = "python" case ruby = "ruby" + case rust = "rust" case swift = "swift" } /// Repository Identifier @@ -3018,6 +3235,7 @@ public enum Components { public var state: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.statePayload? /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/languagesPayload`. @frozen public enum languagesPayloadPayload: String, Codable, Hashable, Sendable { + case actions = "actions" case c_hyphen_cpp = "c-cpp" case csharp = "csharp" case go = "go" @@ -3037,6 +3255,21 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/languages`. public var languages: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.languagesPayload? + /// Runner type to be used. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/runner_type`. + @frozen public enum runner_typePayload: String, Codable, Hashable, Sendable { + case standard = "standard" + case labeled = "labeled" + } + /// Runner type to be used. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/runner_type`. + public var runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.runner_typePayload? + /// Runner label to be used if the runner type is labeled. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/runner_label`. + public var runner_label: Swift.String? /// CodeQL query suite to be used. /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/query_suite`. @@ -3067,18 +3300,24 @@ public enum Components { /// - Parameters: /// - state: Code scanning default setup has been configured or not. /// - languages: Languages to be analyzed. - /// - query_suite: CodeQL query suite to be used. + /// - runner_type: Runner type to be used. + /// - runner_label: Runner label to be used if the runner type is labeled. + /// - query_suite: CodeQL query suite to be used. /// - updated_at: Timestamp of latest configuration update. /// - schedule: The frequency of the periodic analysis. public init( state: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.statePayload? = nil, languages: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.languagesPayload? = nil, + runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.runner_typePayload? = nil, + runner_label: Swift.String? = nil, query_suite: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.query_suitePayload? = nil, updated_at: Foundation.Date? = nil, schedule: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup.schedulePayload? = nil ) { self.state = state self.languages = languages + self.runner_type = runner_type + self.runner_label = runner_label self.query_suite = query_suite self.updated_at = updated_at self.schedule = schedule @@ -3086,6 +3325,8 @@ public enum Components { public enum CodingKeys: String, CodingKey { case state case languages + case runner_type + case runner_label case query_suite case updated_at case schedule @@ -3134,6 +3375,7 @@ public enum Components { public var query_suite: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_update.query_suitePayload? /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-update/languagesPayload`. @frozen public enum languagesPayloadPayload: String, Codable, Hashable, Sendable { + case actions = "actions" case c_hyphen_cpp = "c-cpp" case csharp = "csharp" case go = "go" @@ -3577,6 +3819,62 @@ public enum Components { self.body = body } } + public struct code_scanning_bad_request: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_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 + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.code_scanning_bad_request.Body + /// Creates a new `code_scanning_bad_request`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.code_scanning_bad_request.Body) { + self.body = body + } + } + public struct code_scanning_autofix_create_forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_autofix_create_forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_autofix_create_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.code_scanning_autofix_create_forbidden.Body + /// Creates a new `code_scanning_autofix_create_forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.code_scanning_autofix_create_forbidden.Body) { + self.body = body + } + } public struct found: Sendable, Hashable { /// Creates a new `found`. public init() {} @@ -4564,25 +4862,31 @@ public enum Operations { public var dismissed_reason: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_reason? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/dismissed_comment`. public var dismissed_comment: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_comment? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/json/create_request`. + public var create_request: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_create_hyphen_request? /// Creates a new `jsonPayload`. /// /// - Parameters: /// - state: /// - dismissed_reason: /// - dismissed_comment: + /// - create_request: public init( state: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_set_hyphen_state, dismissed_reason: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_reason? = nil, - dismissed_comment: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_comment? = nil + dismissed_comment: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_dismissed_hyphen_comment? = nil, + create_request: Components.Schemas.code_hyphen_scanning_hyphen_alert_hyphen_create_hyphen_request? = nil ) { self.state = state self.dismissed_reason = dismissed_reason self.dismissed_comment = dismissed_comment + self.create_request = create_request } public enum CodingKeys: String, CodingKey { case state case dismissed_reason case dismissed_comment + case create_request } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. @@ -4657,6 +4961,29 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/patch(code-scanning/update-alert)/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 + ) + } + } + } /// 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/alerts/{alert_number}/patch(code-scanning/update-alert)/responses/403`. @@ -4731,6 +5058,858 @@ public enum Operations { /// 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 the status of an autofix for a code scanning alert + /// + /// Gets the status and description of an autofix for a code scanning alert. + /// + /// 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. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)`. + public enum code_hyphen_scanning_sol_get_hyphen_autofix { + public static let id: Swift.String = "code-scanning/get-autofix" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/GET/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/alerts/{alert_number}/autofix/GET/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/alerts/{alert_number}/autofix/GET/path/repo`. + public var repo: Components.Parameters.repo + /// 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 `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/GET/path/alert_number`. + public var alert_number: Components.Parameters.alert_hyphen_number + /// 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. + /// - alert_number: 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. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + alert_number: Components.Parameters.alert_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.alert_number = alert_number + } + } + public var path: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/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.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_scanning_hyphen_autofix) + /// 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.code_hyphen_scanning_hyphen_autofix { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_scanning_sol_get_hyphen_autofix.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_scanning_sol_get_hyphen_autofix.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.code_hyphen_scanning_sol_get_hyphen_autofix.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.code_scanning_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.code_scanning_bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Response if GitHub Advanced Security is not enabled for this repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.code_scanning_forbidden_read) + /// 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_read { + 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/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/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/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/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 an autofix for a code scanning alert + /// + /// Creates an autofix for a code scanning alert. + /// + /// If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. + /// + /// If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. + /// + /// 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. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)`. + public enum code_hyphen_scanning_sol_create_hyphen_autofix { + public static let id: Swift.String = "code-scanning/create-autofix" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/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/alerts/{alert_number}/autofix/POST/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/alerts/{alert_number}/autofix/POST/path/repo`. + public var repo: Components.Parameters.repo + /// 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 `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/path/alert_number`. + public var alert_number: Components.Parameters.alert_hyphen_number + /// 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. + /// - alert_number: 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. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + alert_number: Components.Parameters.alert_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.alert_number = alert_number + } + } + public var path: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/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.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_scanning_hyphen_autofix) + /// 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.code_hyphen_scanning_hyphen_autofix { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Ok.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_scanning_sol_create_hyphen_autofix.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.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/POST/responses/202/content/application\/json`. + case json(Components.Schemas.code_hyphen_scanning_hyphen_autofix) + /// 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.code_hyphen_scanning_hyphen_autofix { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Accepted.Body) { + self.body = body + } + } + /// Accepted + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.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: Operations.code_hyphen_scanning_sol_create_hyphen_autofix.Output.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.code_scanning_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.code_scanning_bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Response if the repository is archived, if GitHub Advanced Security is not enabled for this repository or if rate limit is exceeded + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.code_scanning_autofix_create_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.code_scanning_autofix_create_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//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/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() {} + } + /// Unprocessable Entity + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.code_hyphen_scanning_sol_create_hyphen_autofix.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.code_hyphen_scanning_sol_create_hyphen_autofix.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/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 + ] + } + } + } + /// Commit an autofix for a code scanning alert + /// + /// Commits an autofix for a code scanning alert. + /// + /// If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response. + /// + /// 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 `POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)`. + public enum code_hyphen_scanning_sol_commit_hyphen_autofix { + public static let id: Swift.String = "code-scanning/commit-autofix" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/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/alerts/{alert_number}/autofix/commits/POST/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/alerts/{alert_number}/autofix/commits/POST/path/repo`. + public var repo: Components.Parameters.repo + /// 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 `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/path/alert_number`. + public var alert_number: Components.Parameters.alert_hyphen_number + /// 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. + /// - alert_number: 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. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + alert_number: Components.Parameters.alert_hyphen_number + ) { + self.owner = owner + self.repo = repo + self.alert_number = alert_number + } + } + public var path: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/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.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/requestBody/content/application\/json`. + case json(Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_commits) + } + public var body: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Path, + headers: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Headers = .init(), + body: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/POST/responses/201/content/application\/json`. + case json(Components.Schemas.code_hyphen_scanning_hyphen_autofix_hyphen_commits_hyphen_response) + /// 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.code_hyphen_scanning_hyphen_autofix_hyphen_commits_hyphen_response { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.Output.Created.Body) { + self.body = body + } + } + /// Created + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.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.code_hyphen_scanning_sol_commit_hyphen_autofix.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.code_scanning_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.code_scanning_bad_request { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + 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/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/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/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/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() {} + } + /// Unprocessable Entity + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.code_hyphen_scanning_sol_commit_hyphen_autofix.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.code_hyphen_scanning_sol_commit_hyphen_autofix.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits/post(code-scanning/commit-autofix)/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) From 91faf223f457c5c741eed96a2f06e89c61e2fefc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:42:26 +0000 Subject: [PATCH 08/37] Commit via running ake Sources/dependabot --- Sources/dependabot/Client.swift | 21 + Sources/dependabot/Types.swift | 1989 +++++++++++++++++-------------- 2 files changed, 1097 insertions(+), 913 deletions(-) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 7b43bc0897b..701e3b3542e 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -94,6 +94,13 @@ public struct Client: APIProtocol { name: "package", value: input.query.package ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "epss_percentage", + value: input.query.epss_percentage + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -314,6 +321,13 @@ public struct Client: APIProtocol { name: "package", value: input.query.package ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "epss_percentage", + value: input.query.epss_percentage + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1146,6 +1160,13 @@ public struct Client: APIProtocol { name: "manifest", value: input.query.manifest ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "epss_percentage", + value: input.query.epss_percentage + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 26aece0dc31..a439100266b 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -628,6 +628,31 @@ public enum Components { case cvss_v4 } } + /// The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss). + /// + /// - Remark: Generated from `#/components/schemas/security-advisory-epss`. + public struct security_hyphen_advisory_hyphen_epss: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-advisory-epss/percentage`. + public var percentage: Swift.Double? + /// - Remark: Generated from `#/components/schemas/security-advisory-epss/percentile`. + public var percentile: Swift.Double? + /// Creates a new `security_hyphen_advisory_hyphen_epss`. + /// + /// - Parameters: + /// - percentage: + /// - percentile: + public init( + percentage: Swift.Double? = nil, + percentile: Swift.Double? = nil + ) { + self.percentage = percentage + self.percentile = percentile + } + public enum CodingKeys: String, CodingKey { + case percentage + case percentile + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/simple-user`. @@ -841,6 +866,55 @@ public enum Components { case errors } } + /// 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 + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -986,55 +1060,6 @@ public enum Components { case user_view_type } } - /// 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 - } - } /// Code Of Conduct /// /// - Remark: Generated from `#/components/schemas/code-of-conduct`. @@ -1078,954 +1103,965 @@ public enum Components { case html_url } } - /// The security alert number. - /// - /// - Remark: Generated from `#/components/schemas/alert-number`. - public typealias alert_hyphen_number = Swift.Int - /// Details for the vulnerable package. + /// A GitHub repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-package`. - public struct dependabot_hyphen_alert_hyphen_package: Codable, Hashable, Sendable { - /// The package's language or package management ecosystem. + /// - Remark: Generated from `#/components/schemas/simple-repository`. + public struct simple_hyphen_repository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-package/ecosystem`. - public var ecosystem: Swift.String - /// The unique package name within its ecosystem. + /// - Remark: Generated from `#/components/schemas/simple-repository/id`. + public var id: Swift.Int64 + /// The GraphQL identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-package/name`. + /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. + public var node_id: Swift.String + /// The name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/name`. public var name: Swift.String - /// Creates a new `dependabot_hyphen_alert_hyphen_package`. + /// The full, globally unique, name of the repository. /// - /// - Parameters: - /// - ecosystem: The package's language or package management ecosystem. - /// - name: The unique package name within its ecosystem. - public init( - ecosystem: Swift.String, - name: Swift.String - ) { - self.ecosystem = ecosystem - self.name = name - } - public enum CodingKeys: String, CodingKey { - case ecosystem - case name - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - ecosystem = try container.decode( - Swift.String.self, - forKey: .ecosystem - ) - name = try container.decode( - Swift.String.self, - forKey: .name - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "ecosystem", - "name" - ]) - } - } - /// Details pertaining to one vulnerable version range for the advisory. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability`. - public struct dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/package`. - public var package: Components.Schemas.dependabot_hyphen_alert_hyphen_package - /// The severity of the vulnerability. + /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// Whether the repository is private. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/severity`. - @frozen public enum severityPayload: String, Codable, Hashable, Sendable { - case low = "low" - case medium = "medium" - case high = "high" - case critical = "critical" - } - /// The severity of the vulnerability. + /// - Remark: Generated from `#/components/schemas/simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/severity`. - public var severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload - /// Conditions that identify vulnerable versions of this vulnerability's package. + /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. + public var html_url: Swift.String + /// The repository description. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/vulnerable_version_range`. - public var vulnerable_version_range: Swift.String - /// Details pertaining to the package version that patches this vulnerability. + /// - Remark: Generated from `#/components/schemas/simple-repository/description`. + public var description: Swift.String? + /// Whether the repository is a fork. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version`. - public struct first_patched_versionPayload: Codable, Hashable, Sendable { - /// The package version that patches this vulnerability. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version/identifier`. - public var identifier: Swift.String - /// Creates a new `first_patched_versionPayload`. - /// - /// - Parameters: - /// - identifier: The package version that patches this vulnerability. - public init(identifier: Swift.String) { - self.identifier = identifier - } - public enum CodingKeys: String, CodingKey { - case identifier - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - identifier = try container.decode( - Swift.String.self, - forKey: .identifier - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "identifier" - ]) - } - } - /// Details pertaining to the package version that patches this vulnerability. + /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. + public var fork: Swift.Bool + /// The URL to get more information about the repository from the GitHub API. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version`. - public var first_patched_version: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload? - /// Creates a new `dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability`. + /// - Remark: Generated from `#/components/schemas/simple-repository/url`. + public var url: Swift.String + /// A template for the API URL to download the repository as an archive. /// - /// - Parameters: - /// - package: - /// - severity: The severity of the vulnerability. - /// - vulnerable_version_range: Conditions that identify vulnerable versions of this vulnerability's package. - /// - first_patched_version: Details pertaining to the package version that patches this vulnerability. - public init( - package: Components.Schemas.dependabot_hyphen_alert_hyphen_package, - severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload, - vulnerable_version_range: Swift.String, - first_patched_version: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload? = nil - ) { - self.package = package - self.severity = severity - self.vulnerable_version_range = vulnerable_version_range - self.first_patched_version = first_patched_version - } - public enum CodingKeys: String, CodingKey { - case package - case severity - case vulnerable_version_range - case first_patched_version - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - package = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_package.self, - forKey: .package - ) - severity = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload.self, - forKey: .severity - ) - vulnerable_version_range = try container.decode( - Swift.String.self, - forKey: .vulnerable_version_range - ) - first_patched_version = try container.decodeIfPresent( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload.self, - forKey: .first_patched_version - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "package", - "severity", - "vulnerable_version_range", - "first_patched_version" - ]) - } - } - /// Details for the GitHub Security Advisory. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory`. - public struct dependabot_hyphen_alert_hyphen_security_hyphen_advisory: Codable, Hashable, Sendable { - /// The unique GitHub Security Advisory ID assigned to the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. + public var archive_url: Swift.String + /// A template for the API URL to list the available assignees for issues in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/ghsa_id`. - public var ghsa_id: Swift.String - /// The unique CVE ID assigned to the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. + public var assignees_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git blob in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cve_id`. - public var cve_id: Swift.String? - /// A short, plain text summary of the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. + public var blobs_url: Swift.String + /// A template for the API URL to get information about branches in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/summary`. - public var summary: Swift.String - /// A long-form Markdown-supported description of the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/branches_url`. + public var branches_url: Swift.String + /// A template for the API URL to get information about collaborators of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/description`. - public var description: Swift.String - /// Vulnerable version range information for the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/collaborators_url`. + public var collaborators_url: Swift.String + /// A template for the API URL to get information about comments on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/vulnerabilities`. - public var vulnerabilities: [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability] - /// The severity of the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/comments_url`. + public var comments_url: Swift.String + /// A template for the API URL to get information about commits on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/severity`. - @frozen public enum severityPayload: String, Codable, Hashable, Sendable { - case low = "low" - case medium = "medium" - case high = "high" - case critical = "critical" - } - /// The severity of the advisory. + /// - Remark: Generated from `#/components/schemas/simple-repository/commits_url`. + public var commits_url: Swift.String + /// A template for the API URL to compare two commits or refs. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/severity`. - public var severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.severityPayload - /// Details for the advisory pertaining to the Common Vulnerability Scoring System. + /// - Remark: Generated from `#/components/schemas/simple-repository/compare_url`. + public var compare_url: Swift.String + /// A template for the API URL to get the contents of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss`. - public struct cvssPayload: Codable, Hashable, Sendable { - /// The overall CVSS score of the advisory. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss/score`. - public var score: Swift.Double - /// The full CVSS vector string for the advisory. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss/vector_string`. - public var vector_string: Swift.String? - /// Creates a new `cvssPayload`. - /// - /// - Parameters: - /// - score: The overall CVSS score of the advisory. - /// - vector_string: The full CVSS vector string for the advisory. - public init( - score: Swift.Double, - vector_string: Swift.String? = nil - ) { - self.score = score - self.vector_string = vector_string - } - public enum CodingKeys: String, CodingKey { - case score - case vector_string - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - score = try container.decode( - Swift.Double.self, - forKey: .score - ) - vector_string = try container.decodeIfPresent( - Swift.String.self, - forKey: .vector_string - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "score", - "vector_string" - ]) - } - } - /// Details for the advisory pertaining to the Common Vulnerability Scoring System. + /// - Remark: Generated from `#/components/schemas/simple-repository/contents_url`. + public var contents_url: Swift.String + /// A template for the API URL to list the contributors to the repository. /// - /// - 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/simple-repository/contributors_url`. + public var contributors_url: Swift.String + /// The API URL to list the deployments of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload`. - public struct cwesPayloadPayload: Codable, Hashable, Sendable { - /// The unique CWE ID. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload/cwe_id`. - public var cwe_id: Swift.String - /// The short, plain text name of the CWE. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload/name`. - public var name: Swift.String - /// Creates a new `cwesPayloadPayload`. - /// - /// - Parameters: - /// - cwe_id: The unique CWE ID. - /// - name: The short, plain text name of the CWE. - public init( - cwe_id: Swift.String, - name: Swift.String - ) { - self.cwe_id = cwe_id - self.name = name - } - public enum CodingKeys: String, CodingKey { - case cwe_id - case name - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - cwe_id = try container.decode( - Swift.String.self, - forKey: .cwe_id - ) - name = try container.decode( - Swift.String.self, - forKey: .name - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "cwe_id", - "name" - ]) - } - } - /// Details for the advisory pertaining to Common Weakness Enumeration. + /// - Remark: Generated from `#/components/schemas/simple-repository/deployments_url`. + public var deployments_url: Swift.String + /// The API URL to list the downloads on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwes`. - public typealias cwesPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayloadPayload] - /// Details for the advisory pertaining to Common Weakness Enumeration. + /// - Remark: Generated from `#/components/schemas/simple-repository/downloads_url`. + public var downloads_url: Swift.String + /// The API URL to list the events of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwes`. - public var cwes: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayload - /// An advisory identifier. + /// - Remark: Generated from `#/components/schemas/simple-repository/events_url`. + public var events_url: Swift.String + /// The API URL to list the forks of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload`. - public struct identifiersPayloadPayload: Codable, Hashable, Sendable { - /// The type of advisory identifier. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable { - case CVE = "CVE" - case GHSA = "GHSA" - } - /// The type of advisory identifier. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/type`. - public var _type: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload - /// The value of the advisory identifer. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/value`. - public var value: Swift.String - /// Creates a new `identifiersPayloadPayload`. - /// - /// - Parameters: - /// - _type: The type of advisory identifier. - /// - value: The value of the advisory identifer. - public init( - _type: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload, - value: Swift.String - ) { - self._type = _type - self.value = value - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case value - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - _type = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload.self, - forKey: ._type - ) - value = try container.decode( - Swift.String.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "type", - "value" - ]) - } - } - /// Values that identify this advisory among security information sources. + /// - Remark: Generated from `#/components/schemas/simple-repository/forks_url`. + public var forks_url: Swift.String + /// A template for the API URL to get information about Git commits of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiers`. - public typealias identifiersPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload] - /// Values that identify this advisory among security information sources. + /// - Remark: Generated from `#/components/schemas/simple-repository/git_commits_url`. + public var git_commits_url: Swift.String + /// A template for the API URL to get information about Git refs of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiers`. - public var identifiers: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayload - /// A link to additional advisory information. + /// - Remark: Generated from `#/components/schemas/simple-repository/git_refs_url`. + public var git_refs_url: Swift.String + /// A template for the API URL to get information about Git tags of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/referencesPayload`. - public struct referencesPayloadPayload: Codable, Hashable, Sendable { - /// The URL of the reference. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/referencesPayload/url`. - public var url: Swift.String - /// Creates a new `referencesPayloadPayload`. - /// - /// - Parameters: - /// - url: The URL of the reference. - public init(url: Swift.String) { - self.url = url - } - public enum CodingKeys: String, CodingKey { - case url - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - url = try container.decode( - Swift.String.self, - forKey: .url - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "url" - ]) - } - } - /// Links to additional advisory information. + /// - Remark: Generated from `#/components/schemas/simple-repository/git_tags_url`. + public var git_tags_url: Swift.String + /// A template for the API URL to get information about issue comments on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/references`. - public typealias referencesPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayloadPayload] - /// Links to additional advisory information. + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_comment_url`. + public var issue_comment_url: Swift.String + /// A template for the API URL to get information about issue events on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/references`. - public var references: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayload - /// The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_events_url`. + public var issue_events_url: Swift.String + /// A template for the API URL to get information about issues on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/published_at`. - public var published_at: Foundation.Date - /// The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/components/schemas/simple-repository/issues_url`. + public var issues_url: Swift.String + /// A template for the API URL to get information about deploy keys on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/updated_at`. - public var updated_at: Foundation.Date - /// The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/components/schemas/simple-repository/keys_url`. + public var keys_url: Swift.String + /// A template for the API URL to get information about labels of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/withdrawn_at`. - public var withdrawn_at: Foundation.Date? - /// Creates a new `dependabot_hyphen_alert_hyphen_security_hyphen_advisory`. + /// - Remark: Generated from `#/components/schemas/simple-repository/labels_url`. + public var labels_url: Swift.String + /// The API URL to get information about the languages of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/languages_url`. + public var languages_url: Swift.String + /// The API URL to merge branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/merges_url`. + public var merges_url: Swift.String + /// A template for the API URL to get information about milestones of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/milestones_url`. + public var milestones_url: Swift.String + /// A template for the API URL to get information about notifications on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/notifications_url`. + public var notifications_url: Swift.String + /// A template for the API URL to get information about pull requests on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/pulls_url`. + public var pulls_url: Swift.String + /// A template for the API URL to get information about releases on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/releases_url`. + public var releases_url: Swift.String + /// The API URL to list the stargazers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/stargazers_url`. + public var stargazers_url: Swift.String + /// A template for the API URL to get information about statuses of a commit. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/statuses_url`. + public var statuses_url: Swift.String + /// The API URL to list the subscribers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscribers_url`. + public var subscribers_url: Swift.String + /// The API URL to subscribe to notifications for this repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscription_url`. + public var subscription_url: Swift.String + /// The API URL to get information about tags on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/tags_url`. + public var tags_url: Swift.String + /// The API URL to list the teams on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/teams_url`. + public var teams_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/trees_url`. + public var trees_url: Swift.String + /// The API URL to list the hooks on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/hooks_url`. + public var hooks_url: Swift.String + /// Creates a new `simple_hyphen_repository`. /// /// - Parameters: - /// - ghsa_id: The unique GitHub Security Advisory ID assigned to the advisory. - /// - cve_id: The unique CVE ID assigned to the advisory. - /// - summary: A short, plain text summary of the advisory. - /// - description: A long-form Markdown-supported description of the advisory. - /// - 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. - /// - published_at: The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - updated_at: The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - withdrawn_at: The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - id: A unique identifier of the repository. + /// - node_id: The GraphQL identifier of the repository. + /// - name: The name of the repository. + /// - full_name: The full, globally unique, name of the repository. + /// - owner: + /// - _private: Whether the repository is private. + /// - html_url: The URL to view the repository on GitHub.com. + /// - description: The repository description. + /// - fork: Whether the repository is a fork. + /// - url: The URL to get more information about the repository from the GitHub API. + /// - archive_url: A template for the API URL to download the repository as an archive. + /// - assignees_url: A template for the API URL to list the available assignees for issues in the repository. + /// - blobs_url: A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - branches_url: A template for the API URL to get information about branches in the repository. + /// - collaborators_url: A template for the API URL to get information about collaborators of the repository. + /// - comments_url: A template for the API URL to get information about comments on the repository. + /// - commits_url: A template for the API URL to get information about commits on the repository. + /// - compare_url: A template for the API URL to compare two commits or refs. + /// - contents_url: A template for the API URL to get the contents of the repository. + /// - contributors_url: A template for the API URL to list the contributors to the repository. + /// - deployments_url: The API URL to list the deployments of the repository. + /// - downloads_url: The API URL to list the downloads on the repository. + /// - events_url: The API URL to list the events of the repository. + /// - forks_url: The API URL to list the forks of the repository. + /// - git_commits_url: A template for the API URL to get information about Git commits of the repository. + /// - git_refs_url: A template for the API URL to get information about Git refs of the repository. + /// - git_tags_url: A template for the API URL to get information about Git tags of the repository. + /// - issue_comment_url: A template for the API URL to get information about issue comments on the repository. + /// - issue_events_url: A template for the API URL to get information about issue events on the repository. + /// - issues_url: A template for the API URL to get information about issues on the repository. + /// - keys_url: A template for the API URL to get information about deploy keys on the repository. + /// - labels_url: A template for the API URL to get information about labels of the repository. + /// - languages_url: The API URL to get information about the languages of the repository. + /// - merges_url: The API URL to merge branches in the repository. + /// - milestones_url: A template for the API URL to get information about milestones of the repository. + /// - notifications_url: A template for the API URL to get information about notifications on the repository. + /// - pulls_url: A template for the API URL to get information about pull requests on the repository. + /// - releases_url: A template for the API URL to get information about releases on the repository. + /// - stargazers_url: The API URL to list the stargazers on the repository. + /// - statuses_url: A template for the API URL to get information about statuses of a commit. + /// - subscribers_url: The API URL to list the subscribers on the repository. + /// - subscription_url: The API URL to subscribe to notifications for this repository. + /// - tags_url: The API URL to get information about tags on the repository. + /// - teams_url: The API URL to list the teams on the repository. + /// - trees_url: A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - hooks_url: The API URL to list the hooks on the repository. + public init( + id: Swift.Int64, + node_id: Swift.String, + name: Swift.String, + full_name: Swift.String, + owner: Components.Schemas.simple_hyphen_user, + _private: Swift.Bool, + html_url: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + 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, + downloads_url: Swift.String, + events_url: Swift.String, + forks_url: Swift.String, + git_commits_url: Swift.String, + git_refs_url: Swift.String, + git_tags_url: 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, + notifications_url: Swift.String, + 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, + hooks_url: Swift.String + ) { + self.id = id + self.node_id = node_id + self.name = name + self.full_name = full_name + self.owner = owner + self._private = _private + self.html_url = html_url + self.description = description + self.fork = fork + self.url = url + 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.downloads_url = downloads_url + self.events_url = events_url + self.forks_url = forks_url + self.git_commits_url = git_commits_url + self.git_refs_url = git_refs_url + self.git_tags_url = git_tags_url + 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.notifications_url = notifications_url + 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.hooks_url = hooks_url + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case full_name + case owner + case _private = "private" + case html_url + case description + case fork + case url + 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 downloads_url + case events_url + case forks_url + case git_commits_url + case git_refs_url + case git_tags_url + 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 notifications_url + 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 hooks_url + } + } + /// The security alert number. + /// + /// - Remark: Generated from `#/components/schemas/alert-number`. + public typealias alert_hyphen_number = Swift.Int + /// Details for the vulnerable package. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-package`. + public struct dependabot_hyphen_alert_hyphen_package: Codable, Hashable, Sendable { + /// The package's language or package management ecosystem. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-package/ecosystem`. + public var ecosystem: Swift.String + /// The unique package name within its ecosystem. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-package/name`. + public var name: Swift.String + /// Creates a new `dependabot_hyphen_alert_hyphen_package`. + /// + /// - Parameters: + /// - ecosystem: The package's language or package management ecosystem. + /// - name: The unique package name within its ecosystem. public init( - ghsa_id: Swift.String, - cve_id: Swift.String? = nil, - summary: Swift.String, - description: Swift.String, - 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, - published_at: Foundation.Date, - updated_at: Foundation.Date, - withdrawn_at: Foundation.Date? = nil + ecosystem: Swift.String, + name: Swift.String ) { - self.ghsa_id = ghsa_id - self.cve_id = cve_id - self.summary = summary - self.description = description - self.vulnerabilities = vulnerabilities - self.severity = severity - self.cvss = cvss - self.cvss_severities = cvss_severities - self.cwes = cwes - self.identifiers = identifiers - self.references = references - self.published_at = published_at - self.updated_at = updated_at - self.withdrawn_at = withdrawn_at + self.ecosystem = ecosystem + self.name = name } public enum CodingKeys: String, CodingKey { - case ghsa_id - case cve_id - case summary - case description - case vulnerabilities - case severity - case cvss - case cvss_severities - case cwes - case identifiers - case references - case published_at - case updated_at - case withdrawn_at + case ecosystem + case name } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - ghsa_id = try container.decode( - Swift.String.self, - forKey: .ghsa_id - ) - cve_id = try container.decodeIfPresent( - Swift.String.self, - forKey: .cve_id - ) - summary = try container.decode( + ecosystem = try container.decode( Swift.String.self, - forKey: .summary + forKey: .ecosystem ) - description = try container.decode( + name = try container.decode( Swift.String.self, - forKey: .description - ) - vulnerabilities = try container.decode( - [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability].self, - forKey: .vulnerabilities - ) - severity = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.severityPayload.self, - forKey: .severity - ) - cvss = try container.decode( - 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 - ) - identifiers = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayload.self, - forKey: .identifiers - ) - references = try container.decode( - Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayload.self, - forKey: .references - ) - published_at = try container.decode( - Foundation.Date.self, - forKey: .published_at - ) - updated_at = try container.decode( - Foundation.Date.self, - forKey: .updated_at - ) - withdrawn_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .withdrawn_at + forKey: .name ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "ghsa_id", - "cve_id", - "summary", - "description", - "vulnerabilities", - "severity", - "cvss", - "cvss_severities", - "cwes", - "identifiers", - "references", - "published_at", - "updated_at", - "withdrawn_at" + "ecosystem", + "name" ]) } } - /// The REST API URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-url`. - public typealias alert_hyphen_url = Swift.String - /// The GitHub URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-html-url`. - public typealias alert_hyphen_html_hyphen_url = Swift.String - /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-created-at`. - public typealias alert_hyphen_created_hyphen_at = Foundation.Date - /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-updated-at`. - public typealias alert_hyphen_updated_hyphen_at = Foundation.Date - /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-dismissed-at`. - public typealias alert_hyphen_dismissed_hyphen_at = Foundation.Date - /// The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-fixed-at`. - public typealias alert_hyphen_fixed_hyphen_at = Foundation.Date - /// The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-auto-dismissed-at`. - public typealias alert_hyphen_auto_hyphen_dismissed_hyphen_at = Foundation.Date - /// A GitHub repository. + /// Details pertaining to one vulnerable version range for the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository`. - public struct simple_hyphen_repository: Codable, Hashable, Sendable { - /// A unique identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/id`. - public var id: Swift.Int64 - /// The GraphQL identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. - public var node_id: Swift.String - /// The name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/name`. - public var name: Swift.String - /// The full, globally unique, name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. - public var owner: Components.Schemas.simple_hyphen_user - /// Whether the repository is private. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/private`. - public var _private: Swift.Bool - /// The URL to view the repository on GitHub.com. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. - public var html_url: Swift.String - /// The repository description. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/description`. - public var description: Swift.String? - /// Whether the repository is a fork. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. - public var fork: Swift.Bool - /// The URL to get more information about the repository from the GitHub API. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/url`. - public var url: Swift.String - /// A template for the API URL to download the repository as an archive. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. - public var archive_url: Swift.String - /// A template for the API URL to list the available assignees for issues in the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. - public var assignees_url: Swift.String - /// A template for the API URL to create or retrieve a raw Git blob in the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. - public var blobs_url: Swift.String - /// A template for the API URL to get information about branches in the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/branches_url`. - public var branches_url: Swift.String - /// A template for the API URL to get information about collaborators of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/collaborators_url`. - public var collaborators_url: Swift.String - /// A template for the API URL to get information about comments on the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/comments_url`. - public var comments_url: Swift.String - /// A template for the API URL to get information about commits on the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/commits_url`. - public var commits_url: Swift.String - /// A template for the API URL to compare two commits or refs. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/compare_url`. - public var compare_url: Swift.String - /// A template for the API URL to get the contents of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/contents_url`. - public var contents_url: Swift.String - /// A template for the API URL to list the contributors to the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/contributors_url`. - public var contributors_url: Swift.String - /// The API URL to list the deployments of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability`. + public struct dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/package`. + public var package: Components.Schemas.dependabot_hyphen_alert_hyphen_package + /// The severity of the vulnerability. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/deployments_url`. - public var deployments_url: Swift.String - /// The API URL to list the downloads on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/severity`. + @frozen public enum severityPayload: String, Codable, Hashable, Sendable { + case low = "low" + case medium = "medium" + case high = "high" + case critical = "critical" + } + /// The severity of the vulnerability. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/downloads_url`. - public var downloads_url: Swift.String - /// The API URL to list the events of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/severity`. + public var severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload + /// Conditions that identify vulnerable versions of this vulnerability's package. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/events_url`. - public var events_url: Swift.String - /// The API URL to list the forks of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/vulnerable_version_range`. + public var vulnerable_version_range: Swift.String + /// Details pertaining to the package version that patches this vulnerability. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/forks_url`. - public var forks_url: Swift.String - /// A template for the API URL to get information about Git commits of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version`. + public struct first_patched_versionPayload: Codable, Hashable, Sendable { + /// The package version that patches this vulnerability. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version/identifier`. + public var identifier: Swift.String + /// Creates a new `first_patched_versionPayload`. + /// + /// - Parameters: + /// - identifier: The package version that patches this vulnerability. + public init(identifier: Swift.String) { + self.identifier = identifier + } + public enum CodingKeys: String, CodingKey { + case identifier + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + identifier = try container.decode( + Swift.String.self, + forKey: .identifier + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "identifier" + ]) + } + } + /// Details pertaining to the package version that patches this vulnerability. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_commits_url`. - public var git_commits_url: Swift.String - /// A template for the API URL to get information about Git refs of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-vulnerability/first_patched_version`. + public var first_patched_version: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload? + /// Creates a new `dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability`. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_refs_url`. - public var git_refs_url: Swift.String - /// A template for the API URL to get information about Git tags of the repository. + /// - Parameters: + /// - package: + /// - severity: The severity of the vulnerability. + /// - vulnerable_version_range: Conditions that identify vulnerable versions of this vulnerability's package. + /// - first_patched_version: Details pertaining to the package version that patches this vulnerability. + public init( + package: Components.Schemas.dependabot_hyphen_alert_hyphen_package, + severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload, + vulnerable_version_range: Swift.String, + first_patched_version: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload? = nil + ) { + self.package = package + self.severity = severity + self.vulnerable_version_range = vulnerable_version_range + self.first_patched_version = first_patched_version + } + public enum CodingKeys: String, CodingKey { + case package + case severity + case vulnerable_version_range + case first_patched_version + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + package = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_package.self, + forKey: .package + ) + severity = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.severityPayload.self, + forKey: .severity + ) + vulnerable_version_range = try container.decode( + Swift.String.self, + forKey: .vulnerable_version_range + ) + first_patched_version = try container.decodeIfPresent( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability.first_patched_versionPayload.self, + forKey: .first_patched_version + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "package", + "severity", + "vulnerable_version_range", + "first_patched_version" + ]) + } + } + /// Details for the GitHub Security Advisory. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory`. + public struct dependabot_hyphen_alert_hyphen_security_hyphen_advisory: Codable, Hashable, Sendable { + /// The unique GitHub Security Advisory ID assigned to the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_tags_url`. - public var git_tags_url: Swift.String - /// A template for the API URL to get information about issue comments on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/ghsa_id`. + public var ghsa_id: Swift.String + /// The unique CVE ID assigned to the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issue_comment_url`. - public var issue_comment_url: Swift.String - /// A template for the API URL to get information about issue events on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cve_id`. + public var cve_id: Swift.String? + /// A short, plain text summary of the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issue_events_url`. - public var issue_events_url: Swift.String - /// A template for the API URL to get information about issues on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/summary`. + public var summary: Swift.String + /// A long-form Markdown-supported description of the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issues_url`. - public var issues_url: Swift.String - /// A template for the API URL to get information about deploy keys on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/description`. + public var description: Swift.String + /// Vulnerable version range information for the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/keys_url`. - public var keys_url: Swift.String - /// A template for the API URL to get information about labels of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/vulnerabilities`. + public var vulnerabilities: [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability] + /// The severity of the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/labels_url`. - public var labels_url: Swift.String - /// The API URL to get information about the languages of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/severity`. + @frozen public enum severityPayload: String, Codable, Hashable, Sendable { + case low = "low" + case medium = "medium" + case high = "high" + case critical = "critical" + } + /// The severity of the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/languages_url`. - public var languages_url: Swift.String - /// The API URL to merge branches in the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/severity`. + public var severity: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.severityPayload + /// Details for the advisory pertaining to the Common Vulnerability Scoring System. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/merges_url`. - public var merges_url: Swift.String - /// A template for the API URL to get information about milestones of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss`. + public struct cvssPayload: Codable, Hashable, Sendable { + /// The overall CVSS score of the advisory. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss/score`. + public var score: Swift.Double + /// The full CVSS vector string for the advisory. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss/vector_string`. + public var vector_string: Swift.String? + /// Creates a new `cvssPayload`. + /// + /// - Parameters: + /// - score: The overall CVSS score of the advisory. + /// - vector_string: The full CVSS vector string for the advisory. + public init( + score: Swift.Double, + vector_string: Swift.String? = nil + ) { + self.score = score + self.vector_string = vector_string + } + public enum CodingKeys: String, CodingKey { + case score + case vector_string + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + score = try container.decode( + Swift.Double.self, + forKey: .score + ) + vector_string = try container.decodeIfPresent( + Swift.String.self, + forKey: .vector_string + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "score", + "vector_string" + ]) + } + } + /// Details for the advisory pertaining to the Common Vulnerability Scoring System. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/milestones_url`. - public var milestones_url: Swift.String - /// A template for the API URL to get information about notifications on the repository. + /// - 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? + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/epss`. + public var epss: Components.Schemas.security_hyphen_advisory_hyphen_epss? + /// A CWE weakness assigned to the advisory. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/notifications_url`. - public var notifications_url: Swift.String - /// A template for the API URL to get information about pull requests on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload`. + public struct cwesPayloadPayload: Codable, Hashable, Sendable { + /// The unique CWE ID. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload/cwe_id`. + public var cwe_id: Swift.String + /// The short, plain text name of the CWE. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwesPayload/name`. + public var name: Swift.String + /// Creates a new `cwesPayloadPayload`. + /// + /// - Parameters: + /// - cwe_id: The unique CWE ID. + /// - name: The short, plain text name of the CWE. + public init( + cwe_id: Swift.String, + name: Swift.String + ) { + self.cwe_id = cwe_id + self.name = name + } + public enum CodingKeys: String, CodingKey { + case cwe_id + case name + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + cwe_id = try container.decode( + Swift.String.self, + forKey: .cwe_id + ) + name = try container.decode( + Swift.String.self, + forKey: .name + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "cwe_id", + "name" + ]) + } + } + /// Details for the advisory pertaining to Common Weakness Enumeration. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/pulls_url`. - public var pulls_url: Swift.String - /// A template for the API URL to get information about releases on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwes`. + public typealias cwesPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayloadPayload] + /// Details for the advisory pertaining to Common Weakness Enumeration. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/releases_url`. - public var releases_url: Swift.String - /// The API URL to list the stargazers on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cwes`. + public var cwes: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayload + /// An advisory identifier. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/stargazers_url`. - public var stargazers_url: Swift.String - /// A template for the API URL to get information about statuses of a commit. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload`. + public struct identifiersPayloadPayload: Codable, Hashable, Sendable { + /// The type of advisory identifier. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case CVE = "CVE" + case GHSA = "GHSA" + } + /// The type of advisory identifier. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/type`. + public var _type: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload + /// The value of the advisory identifer. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiersPayload/value`. + public var value: Swift.String + /// Creates a new `identifiersPayloadPayload`. + /// + /// - Parameters: + /// - _type: The type of advisory identifier. + /// - value: The value of the advisory identifer. + public init( + _type: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload, + value: Swift.String + ) { + self._type = _type + self.value = value + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case value + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + _type = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload._typePayload.self, + forKey: ._type + ) + value = try container.decode( + Swift.String.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "type", + "value" + ]) + } + } + /// Values that identify this advisory among security information sources. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/statuses_url`. - public var statuses_url: Swift.String - /// The API URL to list the subscribers on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiers`. + public typealias identifiersPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayloadPayload] + /// Values that identify this advisory among security information sources. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/subscribers_url`. - public var subscribers_url: Swift.String - /// The API URL to subscribe to notifications for this repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/identifiers`. + public var identifiers: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayload + /// A link to additional advisory information. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/subscription_url`. - public var subscription_url: Swift.String - /// The API URL to get information about tags on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/referencesPayload`. + public struct referencesPayloadPayload: Codable, Hashable, Sendable { + /// The URL of the reference. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/referencesPayload/url`. + public var url: Swift.String + /// Creates a new `referencesPayloadPayload`. + /// + /// - Parameters: + /// - url: The URL of the reference. + public init(url: Swift.String) { + self.url = url + } + public enum CodingKeys: String, CodingKey { + case url + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + url = try container.decode( + Swift.String.self, + forKey: .url + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "url" + ]) + } + } + /// Links to additional advisory information. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/tags_url`. - public var tags_url: Swift.String - /// The API URL to list the teams on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/references`. + public typealias referencesPayload = [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayloadPayload] + /// Links to additional advisory information. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/teams_url`. - public var teams_url: Swift.String - /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/references`. + public var references: Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayload + /// The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/trees_url`. - public var trees_url: Swift.String - /// The API URL to list the hooks on the repository. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/published_at`. + public var published_at: Foundation.Date + /// The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/hooks_url`. - public var hooks_url: Swift.String - /// Creates a new `simple_hyphen_repository`. + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/updated_at`. + public var updated_at: Foundation.Date + /// The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/withdrawn_at`. + public var withdrawn_at: Foundation.Date? + /// Creates a new `dependabot_hyphen_alert_hyphen_security_hyphen_advisory`. /// /// - Parameters: - /// - id: A unique identifier of the repository. - /// - node_id: The GraphQL identifier of the repository. - /// - name: The name of the repository. - /// - full_name: The full, globally unique, name of the repository. - /// - owner: - /// - _private: Whether the repository is private. - /// - html_url: The URL to view the repository on GitHub.com. - /// - description: The repository description. - /// - fork: Whether the repository is a fork. - /// - url: The URL to get more information about the repository from the GitHub API. - /// - archive_url: A template for the API URL to download the repository as an archive. - /// - assignees_url: A template for the API URL to list the available assignees for issues in the repository. - /// - blobs_url: A template for the API URL to create or retrieve a raw Git blob in the repository. - /// - branches_url: A template for the API URL to get information about branches in the repository. - /// - collaborators_url: A template for the API URL to get information about collaborators of the repository. - /// - comments_url: A template for the API URL to get information about comments on the repository. - /// - commits_url: A template for the API URL to get information about commits on the repository. - /// - compare_url: A template for the API URL to compare two commits or refs. - /// - contents_url: A template for the API URL to get the contents of the repository. - /// - contributors_url: A template for the API URL to list the contributors to the repository. - /// - deployments_url: The API URL to list the deployments of the repository. - /// - downloads_url: The API URL to list the downloads on the repository. - /// - events_url: The API URL to list the events of the repository. - /// - forks_url: The API URL to list the forks of the repository. - /// - git_commits_url: A template for the API URL to get information about Git commits of the repository. - /// - git_refs_url: A template for the API URL to get information about Git refs of the repository. - /// - git_tags_url: A template for the API URL to get information about Git tags of the repository. - /// - issue_comment_url: A template for the API URL to get information about issue comments on the repository. - /// - issue_events_url: A template for the API URL to get information about issue events on the repository. - /// - issues_url: A template for the API URL to get information about issues on the repository. - /// - keys_url: A template for the API URL to get information about deploy keys on the repository. - /// - labels_url: A template for the API URL to get information about labels of the repository. - /// - languages_url: The API URL to get information about the languages of the repository. - /// - merges_url: The API URL to merge branches in the repository. - /// - milestones_url: A template for the API URL to get information about milestones of the repository. - /// - notifications_url: A template for the API URL to get information about notifications on the repository. - /// - pulls_url: A template for the API URL to get information about pull requests on the repository. - /// - releases_url: A template for the API URL to get information about releases on the repository. - /// - stargazers_url: The API URL to list the stargazers on the repository. - /// - statuses_url: A template for the API URL to get information about statuses of a commit. - /// - subscribers_url: The API URL to list the subscribers on the repository. - /// - subscription_url: The API URL to subscribe to notifications for this repository. - /// - tags_url: The API URL to get information about tags on the repository. - /// - teams_url: The API URL to list the teams on the repository. - /// - trees_url: A template for the API URL to create or retrieve a raw Git tree of the repository. - /// - hooks_url: The API URL to list the hooks on the repository. + /// - ghsa_id: The unique GitHub Security Advisory ID assigned to the advisory. + /// - cve_id: The unique CVE ID assigned to the advisory. + /// - summary: A short, plain text summary of the advisory. + /// - description: A long-form Markdown-supported description of the advisory. + /// - 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: + /// - epss: + /// - 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. + /// - published_at: The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - updated_at: The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - withdrawn_at: The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. public init( - id: Swift.Int64, - node_id: Swift.String, - name: Swift.String, - full_name: Swift.String, - owner: Components.Schemas.simple_hyphen_user, - _private: Swift.Bool, - html_url: Swift.String, - description: Swift.String? = nil, - fork: Swift.Bool, - url: Swift.String, - 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, - downloads_url: Swift.String, - events_url: Swift.String, - forks_url: Swift.String, - git_commits_url: Swift.String, - git_refs_url: Swift.String, - git_tags_url: 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, - notifications_url: Swift.String, - 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, - hooks_url: Swift.String + ghsa_id: Swift.String, + cve_id: Swift.String? = nil, + summary: Swift.String, + description: Swift.String, + 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, + epss: Components.Schemas.security_hyphen_advisory_hyphen_epss? = 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, + published_at: Foundation.Date, + updated_at: Foundation.Date, + withdrawn_at: Foundation.Date? = nil ) { - self.id = id - self.node_id = node_id - self.name = name - self.full_name = full_name - self.owner = owner - self._private = _private - self.html_url = html_url + self.ghsa_id = ghsa_id + self.cve_id = cve_id + self.summary = summary self.description = description - self.fork = fork - self.url = url - 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.downloads_url = downloads_url - self.events_url = events_url - self.forks_url = forks_url - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - 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.notifications_url = notifications_url - 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.hooks_url = hooks_url + self.vulnerabilities = vulnerabilities + self.severity = severity + self.cvss = cvss + self.cvss_severities = cvss_severities + self.epss = epss + self.cwes = cwes + self.identifiers = identifiers + self.references = references + self.published_at = published_at + self.updated_at = updated_at + self.withdrawn_at = withdrawn_at } public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case full_name - case owner - case _private = "private" - case html_url + case ghsa_id + case cve_id + case summary case description - case fork - case url - 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 downloads_url - case events_url - case forks_url - case git_commits_url - case git_refs_url - case git_tags_url - 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 notifications_url - 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 hooks_url + case vulnerabilities + case severity + case cvss + case cvss_severities + case epss + case cwes + case identifiers + case references + case published_at + case updated_at + case withdrawn_at + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + ghsa_id = try container.decode( + Swift.String.self, + forKey: .ghsa_id + ) + cve_id = try container.decodeIfPresent( + Swift.String.self, + forKey: .cve_id + ) + summary = try container.decode( + Swift.String.self, + forKey: .summary + ) + description = try container.decode( + Swift.String.self, + forKey: .description + ) + vulnerabilities = try container.decode( + [Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_vulnerability].self, + forKey: .vulnerabilities + ) + severity = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.severityPayload.self, + forKey: .severity + ) + cvss = try container.decode( + 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 + ) + epss = try container.decodeIfPresent( + Components.Schemas.security_hyphen_advisory_hyphen_epss.self, + forKey: .epss + ) + cwes = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.cwesPayload.self, + forKey: .cwes + ) + identifiers = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.identifiersPayload.self, + forKey: .identifiers + ) + references = try container.decode( + Components.Schemas.dependabot_hyphen_alert_hyphen_security_hyphen_advisory.referencesPayload.self, + forKey: .references + ) + published_at = try container.decode( + Foundation.Date.self, + forKey: .published_at + ) + updated_at = try container.decode( + Foundation.Date.self, + forKey: .updated_at + ) + withdrawn_at = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .withdrawn_at + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "ghsa_id", + "cve_id", + "summary", + "description", + "vulnerabilities", + "severity", + "cvss", + "cvss_severities", + "epss", + "cwes", + "identifiers", + "references", + "published_at", + "updated_at", + "withdrawn_at" + ]) } } + /// The REST API URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-url`. + public typealias alert_hyphen_url = Swift.String + /// The GitHub URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-html-url`. + public typealias alert_hyphen_html_hyphen_url = Swift.String + /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-created-at`. + public typealias alert_hyphen_created_hyphen_at = Foundation.Date + /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-updated-at`. + public typealias alert_hyphen_updated_hyphen_at = Foundation.Date + /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-dismissed-at`. + public typealias alert_hyphen_dismissed_hyphen_at = Foundation.Date + /// The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-fixed-at`. + public typealias alert_hyphen_fixed_hyphen_at = Foundation.Date + /// The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-auto-dismissed-at`. + public typealias alert_hyphen_auto_hyphen_dismissed_hyphen_at = Foundation.Date /// A Dependabot alert. /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository`. @@ -2066,25 +2102,49 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/dependency/scope`. public var scope: Components.Schemas.dependabot_hyphen_alert_hyphen_with_hyphen_repository.dependencyPayload.scopePayload? + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/dependency/relationship`. + @frozen public enum relationshipPayload: String, Codable, Hashable, Sendable { + case unknown = "unknown" + case direct = "direct" + case transitive = "transitive" + } + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-with-repository/dependency/relationship`. + public var relationship: Components.Schemas.dependabot_hyphen_alert_hyphen_with_hyphen_repository.dependencyPayload.relationshipPayload? /// Creates a new `dependencyPayload`. /// /// - Parameters: /// - package: /// - manifest_path: The full path to the dependency manifest file, relative to the root of the repository. /// - scope: The execution scope of the vulnerable dependency. + /// - relationship: The vulnerable dependency's relationship to your project. public init( package: Components.Schemas.dependabot_hyphen_alert_hyphen_package? = nil, manifest_path: Swift.String? = nil, - scope: Components.Schemas.dependabot_hyphen_alert_hyphen_with_hyphen_repository.dependencyPayload.scopePayload? = nil + scope: Components.Schemas.dependabot_hyphen_alert_hyphen_with_hyphen_repository.dependencyPayload.scopePayload? = nil, + relationship: Components.Schemas.dependabot_hyphen_alert_hyphen_with_hyphen_repository.dependencyPayload.relationshipPayload? = nil ) { self.package = package self.manifest_path = manifest_path self.scope = scope + self.relationship = relationship } public enum CodingKeys: String, CodingKey { case package case manifest_path case scope + case relationship } } /// Details for the vulnerable dependency. @@ -2313,6 +2373,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -2435,6 +2517,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -2442,6 +2525,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -2449,6 +2533,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -2457,6 +2542,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -3217,25 +3303,49 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. public var scope: Components.Schemas.dependabot_hyphen_alert.dependencyPayload.scopePayload? + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + @frozen public enum relationshipPayload: String, Codable, Hashable, Sendable { + case unknown = "unknown" + case direct = "direct" + case transitive = "transitive" + } + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + public var relationship: Components.Schemas.dependabot_hyphen_alert.dependencyPayload.relationshipPayload? /// Creates a new `dependencyPayload`. /// /// - Parameters: /// - package: /// - manifest_path: The full path to the dependency manifest file, relative to the root of the repository. /// - scope: The execution scope of the vulnerable dependency. + /// - relationship: The vulnerable dependency's relationship to your project. public init( package: Components.Schemas.dependabot_hyphen_alert_hyphen_package? = nil, manifest_path: Swift.String? = nil, - scope: Components.Schemas.dependabot_hyphen_alert.dependencyPayload.scopePayload? = nil + scope: Components.Schemas.dependabot_hyphen_alert.dependencyPayload.scopePayload? = nil, + relationship: Components.Schemas.dependabot_hyphen_alert.dependencyPayload.relationshipPayload? = nil ) { self.package = package self.manifest_path = manifest_path self.scope = scope + self.relationship = relationship } public enum CodingKeys: String, CodingKey { case package case manifest_path case scope + case relationship } } /// Details for the vulnerable dependency. @@ -3514,6 +3624,15 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-packages`. public typealias dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages = Swift.String + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. + public typealias dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss = Swift.String /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @@ -3524,11 +3643,13 @@ public enum Components { /// The property by which to sort the results. /// `created` means when the alert was created. /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. @frozen public enum dependabot_hyphen_alert_hyphen_sort: String, Codable, Hashable, Sendable { case created = "created" case updated = "updated" + case epss_percentage = "epss_percentage" } /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. /// This parameter must not be used in combination with `last`. @@ -3806,6 +3927,15 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/package`. public var package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. + public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -3819,10 +3949,12 @@ public enum Operations { @frozen public enum dependabot_hyphen_alert_hyphen_sort: String, Codable, Hashable, Sendable { case created = "created" case updated = "updated" + case epss_percentage = "epss_percentage" } /// The property by which to sort the results. /// `created` means when the alert was created. /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/sort`. public var sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? @@ -3866,6 +3998,7 @@ public enum Operations { /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: /// - 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. @@ -3879,6 +4012,7 @@ public enum Operations { severity: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_severities? = nil, ecosystem: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_ecosystems? = nil, package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, + epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -3892,6 +4026,7 @@ public enum Operations { self.severity = severity self.ecosystem = ecosystem self.package = package + self.epss_percentage = epss_percentage self.scope = scope self.sort = sort self.direction = direction @@ -4158,6 +4293,15 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/package`. public var package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/epss_percentage`. + public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -4171,10 +4315,12 @@ public enum Operations { @frozen public enum dependabot_hyphen_alert_hyphen_sort: String, Codable, Hashable, Sendable { case created = "created" case updated = "updated" + case epss_percentage = "epss_percentage" } /// The property by which to sort the results. /// `created` means when the alert was created. /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/sort`. public var sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? @@ -4218,6 +4364,7 @@ public enum Operations { /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: /// - 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. @@ -4231,6 +4378,7 @@ public enum Operations { severity: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_severities? = nil, ecosystem: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_ecosystems? = nil, package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, + epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -4244,6 +4392,7 @@ public enum Operations { self.severity = severity self.ecosystem = ecosystem self.package = package + self.epss_percentage = epss_percentage self.scope = scope self.sort = sort self.direction = direction @@ -5861,6 +6010,15 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/manifest`. public var manifest: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_manifests? + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/epss_percentage`. + public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -5874,10 +6032,12 @@ public enum Operations { @frozen public enum dependabot_hyphen_alert_hyphen_sort: String, Codable, Hashable, Sendable { case created = "created" case updated = "updated" + case epss_percentage = "epss_percentage" } /// The property by which to sort the results. /// `created` means when the alert was created. /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/sort`. public var sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? @@ -5928,6 +6088,7 @@ public enum Operations { /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - manifest: A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. + /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: /// - 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. @@ -5943,6 +6104,7 @@ public enum Operations { ecosystem: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_ecosystems? = nil, package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, manifest: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_manifests? = nil, + epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -5958,6 +6120,7 @@ public enum Operations { self.ecosystem = ecosystem self.package = package self.manifest = manifest + self.epss_percentage = epss_percentage self.scope = scope self.sort = sort self.direction = direction From 20d0bc1e4fc63d5eddfe282b34393cf5e8d4dff9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:42:50 +0000 Subject: [PATCH 09/37] Commit via running ake Sources/dependency-graph --- Sources/dependency-graph/Types.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/dependency-graph/Types.swift b/Sources/dependency-graph/Types.swift index f122c1d51fb..7150249fc09 100644 --- a/Sources/dependency-graph/Types.swift +++ b/Sources/dependency-graph/Types.swift @@ -1387,7 +1387,7 @@ public enum Operations { } } } - /// Response if GitHub Advanced Security is not enabled for this repository + /// Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dependency-graph/compare/{basehead}/get(dependency-graph/diff-range)/responses/403`. /// From e42299d13ec57c25aed924727ba8841d5ef52fdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:43:13 +0000 Subject: [PATCH 10/37] Commit via running ake Sources/gists --- Sources/gists/Types.swift | 268 ++++++++++++++++++++------------------ 1 file changed, 143 insertions(+), 125 deletions(-) diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index 8a02d7d31ea..80f879d245d 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -755,6 +755,131 @@ public enum Components { case status } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -900,131 +1025,6 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } /// How the author is associated with the repository. /// /// - Remark: Generated from `#/components/schemas/author-association`. @@ -1137,6 +1137,8 @@ public enum Components { public var description: Swift.String? /// - Remark: Generated from `#/components/schemas/base-gist/comments`. public var comments: Swift.Int + /// - Remark: Generated from `#/components/schemas/base-gist/comments_enabled`. + public var comments_enabled: Swift.Bool? /// - Remark: Generated from `#/components/schemas/base-gist/user`. public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// - Remark: Generated from `#/components/schemas/base-gist/comments_url`. @@ -1166,6 +1168,7 @@ public enum Components { /// - updated_at: /// - description: /// - comments: + /// - comments_enabled: /// - user: /// - comments_url: /// - owner: @@ -1187,6 +1190,7 @@ public enum Components { updated_at: Foundation.Date, description: Swift.String? = nil, comments: Swift.Int, + comments_enabled: Swift.Bool? = nil, user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, comments_url: Swift.String, owner: Components.Schemas.simple_hyphen_user? = nil, @@ -1208,6 +1212,7 @@ public enum Components { self.updated_at = updated_at self.description = description self.comments = comments + self.comments_enabled = comments_enabled self.user = user self.comments_url = comments_url self.owner = owner @@ -1230,6 +1235,7 @@ public enum Components { case updated_at case description case comments + case comments_enabled case user case comments_url case owner @@ -1947,6 +1953,8 @@ public enum Components { public var description: Swift.String? /// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments`. public var comments: Swift.Int + /// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments_enabled`. + public var comments_enabled: Swift.Bool? /// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/user`. public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments_url`. @@ -1976,6 +1984,7 @@ public enum Components { /// - updated_at: /// - description: /// - comments: + /// - comments_enabled: /// - user: /// - comments_url: /// - owner: @@ -1997,6 +2006,7 @@ public enum Components { updated_at: Foundation.Date, description: Swift.String? = nil, comments: Swift.Int, + comments_enabled: Swift.Bool? = nil, user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, comments_url: Swift.String, owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, @@ -2018,6 +2028,7 @@ public enum Components { self.updated_at = updated_at self.description = description self.comments = comments + self.comments_enabled = comments_enabled self.user = user self.comments_url = comments_url self.owner = owner @@ -2040,6 +2051,7 @@ public enum Components { case updated_at case description case comments + case comments_enabled case user case comments_url case owner @@ -2159,6 +2171,8 @@ public enum Components { public var description: Swift.String? /// - Remark: Generated from `#/components/schemas/gist-simple/comments`. public var comments: Swift.Int? + /// - Remark: Generated from `#/components/schemas/gist-simple/comments_enabled`. + public var comments_enabled: Swift.Bool? /// - Remark: Generated from `#/components/schemas/gist-simple/user`. public var user: Swift.String? /// - Remark: Generated from `#/components/schemas/gist-simple/comments_url`. @@ -2187,6 +2201,7 @@ public enum Components { /// - updated_at: /// - description: /// - comments: + /// - comments_enabled: /// - user: /// - comments_url: /// - owner: @@ -2209,6 +2224,7 @@ public enum Components { updated_at: Swift.String? = nil, description: Swift.String? = nil, comments: Swift.Int? = nil, + comments_enabled: Swift.Bool? = nil, user: Swift.String? = nil, comments_url: Swift.String? = nil, owner: Components.Schemas.simple_hyphen_user? = nil, @@ -2231,6 +2247,7 @@ public enum Components { self.updated_at = updated_at self.description = description self.comments = comments + self.comments_enabled = comments_enabled self.user = user self.comments_url = comments_url self.owner = owner @@ -2254,6 +2271,7 @@ public enum Components { case updated_at case description case comments + case comments_enabled case user case comments_url case owner From 812e7573f66a61e4605d262cc746a3a2372a993c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:43:36 +0000 Subject: [PATCH 11/37] Commit via running ake Sources/git --- Sources/git/Client.swift | 22 +--------------------- Sources/git/Types.swift | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/Sources/git/Client.swift b/Sources/git/Client.swift index 2582d086ed0..2280cc04948 100644 --- a/Sources/git/Client.swift +++ b/Sources/git/Client.swift @@ -1185,27 +1185,7 @@ public struct Client: APIProtocol { case 204: return .noContent(.init()) 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)) + return .unprocessableContent(.init()) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.conflict.Body diff --git a/Sources/git/Types.swift b/Sources/git/Types.swift index 0b965a2d425..69f8478cfe9 100644 --- a/Sources/git/Types.swift +++ b/Sources/git/Types.swift @@ -1456,19 +1456,19 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/git-tree/sha`. public var sha: Swift.String /// - Remark: Generated from `#/components/schemas/git-tree/url`. - public var url: Swift.String + public var url: Swift.String? /// - Remark: Generated from `#/components/schemas/git-tree/truncated`. public var truncated: Swift.Bool /// - Remark: Generated from `#/components/schemas/git-tree/treePayload`. public struct treePayloadPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/path`. - public var path: Swift.String? + public var path: Swift.String /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/mode`. - public var mode: Swift.String? + public var mode: Swift.String /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/type`. - public var _type: Swift.String? + public var _type: Swift.String /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/sha`. - public var sha: Swift.String? + public var sha: Swift.String /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/size`. public var size: Swift.Int? /// - Remark: Generated from `#/components/schemas/git-tree/treePayload/url`. @@ -1483,10 +1483,10 @@ public enum Components { /// - size: /// - url: public init( - path: Swift.String? = nil, - mode: Swift.String? = nil, - _type: Swift.String? = nil, - sha: Swift.String? = nil, + path: Swift.String, + mode: Swift.String, + _type: Swift.String, + sha: Swift.String, size: Swift.Int? = nil, url: Swift.String? = nil ) { @@ -1523,7 +1523,7 @@ public enum Components { /// - tree: Objects specifying a tree structure public init( sha: Swift.String, - url: Swift.String, + url: Swift.String? = nil, truncated: Swift.Bool, tree: Components.Schemas.git_hyphen_tree.treePayload ) { @@ -3867,17 +3867,21 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Validation failed, an attempt was made to delete the default branch, or the endpoint has been spammed. /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/git/refs/{ref}/delete(git/delete-ref)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.validation_failed) + case unprocessableContent(Operations.git_sol_delete_hyphen_ref.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: Components.Responses.validation_failed { + public var unprocessableContent: Operations.git_sol_delete_hyphen_ref.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): From c5849b39d7d380c60c160eabc6ff9b007148d88f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:44:22 +0000 Subject: [PATCH 12/37] Commit via running ake Sources/issues --- Sources/issues/Client.swift | 14 + Sources/issues/Types.swift | 1309 +++++++++++++++++++++-------------- 2 files changed, 811 insertions(+), 512 deletions(-) diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index a23c6c803f2..b1b75743685 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -303,6 +303,13 @@ public struct Client: APIProtocol { name: "labels", value: input.query.labels ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "type", + value: input.query._type + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -645,6 +652,13 @@ public struct Client: APIProtocol { name: "assignee", value: input.query.assignee ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "type", + value: input.query._type + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index d3005309ce4..a24b16c3d6e 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -1566,149 +1566,87 @@ public enum Components { case errors } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - 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. @@ -1728,7 +1666,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/integration/owner`. + public var owner: Components.Schemas.integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/integration/name`. @@ -1888,7 +1861,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -2114,29 +2087,174 @@ public enum Components { case errors } } - /// License Simple + /// A GitHub user. /// - /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. - public struct nullable_hyphen_license_hyphen_simple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. - public var key: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. - public var spdx_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. - public var html_url: Swift.String? - /// Creates a new `nullable_hyphen_license_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: - /// - key: /// - name: - /// - url: - /// - spdx_id: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } + /// License Simple + /// + /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. + public struct nullable_hyphen_license_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. + public var spdx_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. + public var html_url: Swift.String? + /// Creates a new `nullable_hyphen_license_hyphen_simple`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - spdx_id: /// - node_id: /// - html_url: public init( @@ -2903,251 +3021,6 @@ public enum Components { case anonymous_access_enabled } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// A collection of related issues and pull requests. /// /// - Remark: Generated from `#/components/schemas/nullable-milestone`. @@ -3261,13 +3134,103 @@ public enum Components { case state case title case description - case creator - case open_issues - case closed_issues + case creator + case open_issues + case closed_issues + case created_at + case updated_at + case closed_at + case due_on + } + } + /// The type of issue. + /// + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct issue_hyphen_type: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var node_id: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.issue_hyphen_type.colorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var created_at: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updated_at: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var is_enabled: Swift.Bool? + /// Creates a new `issue_hyphen_type`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - node_id: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - created_at: The time the issue type created. + /// - updated_at: The time the issue type last updated. + /// - is_enabled: The enabled state of the issue type. + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.issue_hyphen_type.colorPayload? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + is_enabled: Swift.Bool? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.description = description + self.color = color + self.created_at = created_at + self.updated_at = updated_at + self.is_enabled = is_enabled + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case description + case color case created_at case updated_at - case closed_at - case due_on + case is_enabled } } /// 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. @@ -3287,7 +3250,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. @@ -3447,7 +3445,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -3831,6 +3829,8 @@ public enum Components { public var body_text: Swift.String? /// - Remark: Generated from `#/components/schemas/issue/timeline_url`. public var timeline_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/type`. + public var _type: Components.Schemas.issue_hyphen_type? /// - Remark: Generated from `#/components/schemas/issue/repository`. public var repository: Components.Schemas.repository? /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. @@ -3874,6 +3874,7 @@ public enum Components { /// - body_html: /// - body_text: /// - timeline_url: + /// - _type: /// - repository: /// - performed_via_github_app: /// - author_association: @@ -3910,6 +3911,7 @@ public enum Components { body_html: Swift.String? = nil, body_text: Swift.String? = nil, timeline_url: Swift.String? = nil, + _type: Components.Schemas.issue_hyphen_type? = nil, repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, @@ -3946,6 +3948,7 @@ public enum Components { self.body_html = body_html self.body_text = body_text self.timeline_url = timeline_url + self._type = _type self.repository = repository self.performed_via_github_app = performed_via_github_app self.author_association = author_association @@ -3956,141 +3959,387 @@ public enum Components { case id case node_id case url - case repository_url - case labels_url - case comments_url - case events_url + case repository_url + case labels_url + case comments_url + case events_url + case html_url + case number + case state + case state_reason + case title + case body + case user + case labels + case assignee + case assignees + case milestone + case locked + case active_lock_reason + case comments + case pull_request + case closed_at + case created_at + case updated_at + case draft + case closed_by + case body_html + case body_text + case timeline_url + case _type = "type" + case repository + case performed_via_github_app + case author_association + case reactions + case sub_issues_summary + } + } + /// Comments provide a way for people to collaborate on an issue. + /// + /// - Remark: Generated from `#/components/schemas/issue-comment`. + public struct issue_hyphen_comment: Codable, Hashable, Sendable { + /// Unique identifier of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/issue-comment/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-comment/node_id`. + public var node_id: Swift.String + /// URL for the issue comment + /// + /// - Remark: Generated from `#/components/schemas/issue-comment/url`. + public var url: Swift.String + /// Contents of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/issue-comment/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-comment/body_text`. + public var body_text: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-comment/body_html`. + public var body_html: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-comment/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/issue-comment/user`. + public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/issue-comment/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue-comment/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue-comment/issue_url`. + public var issue_url: Swift.String + /// - Remark: Generated from `#/components/schemas/issue-comment/author_association`. + public var author_association: Components.Schemas.author_hyphen_association + /// - Remark: Generated from `#/components/schemas/issue-comment/performed_via_github_app`. + public var performed_via_github_app: Components.Schemas.nullable_hyphen_integration? + /// - Remark: Generated from `#/components/schemas/issue-comment/reactions`. + public var reactions: Components.Schemas.reaction_hyphen_rollup? + /// Creates a new `issue_hyphen_comment`. + /// + /// - Parameters: + /// - id: Unique identifier of the issue comment + /// - node_id: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment + /// - body_text: + /// - body_html: + /// - html_url: + /// - user: + /// - created_at: + /// - updated_at: + /// - issue_url: + /// - author_association: + /// - performed_via_github_app: + /// - reactions: + public init( + id: Swift.Int64, + node_id: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + body_text: Swift.String? = nil, + body_html: Swift.String? = nil, + html_url: Swift.String, + user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + created_at: Foundation.Date, + updated_at: Foundation.Date, + issue_url: Swift.String, + author_association: Components.Schemas.author_hyphen_association, + performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, + reactions: Components.Schemas.reaction_hyphen_rollup? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.body = body + self.body_text = body_text + self.body_html = body_html + self.html_url = html_url + self.user = user + self.created_at = created_at + self.updated_at = updated_at + self.issue_url = issue_url + self.author_association = author_association + self.performed_via_github_app = performed_via_github_app + self.reactions = reactions + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case body + case body_text + case body_html + case html_url + case user + case created_at + case updated_at + case issue_url + case author_association + case performed_via_github_app + case reactions + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting case html_url - case number - case state - case state_reason - case title - case body - case user - case labels - case assignee - case assignees - case milestone - case locked - case active_lock_reason - case comments - case pull_request - case closed_at - case created_at - case updated_at - case draft - case closed_by - case body_html - case body_text - case timeline_url - case repository - case performed_via_github_app - case author_association - case reactions - case sub_issues_summary + case repositories_url + case slug + case ldap_dn } } - /// Comments provide a way for people to collaborate on an issue. + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/issue-comment`. - public struct issue_hyphen_comment: Codable, Hashable, Sendable { - /// Unique identifier of the issue comment - /// - /// - Remark: Generated from `#/components/schemas/issue-comment/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/issue-comment/node_id`. + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. public var node_id: Swift.String - /// URL for the issue comment - /// - /// - Remark: Generated from `#/components/schemas/issue-comment/url`. + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. public var url: Swift.String - /// Contents of the issue comment - /// - /// - Remark: Generated from `#/components/schemas/issue-comment/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/issue-comment/body_text`. - public var body_text: Swift.String? - /// - Remark: Generated from `#/components/schemas/issue-comment/body_html`. - public var body_html: Swift.String? - /// - Remark: Generated from `#/components/schemas/issue-comment/html_url`. + /// - Remark: Generated from `#/components/schemas/team/html_url`. public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/issue-comment/user`. - public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user? - /// - Remark: Generated from `#/components/schemas/issue-comment/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/issue-comment/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/issue-comment/issue_url`. - public var issue_url: Swift.String - /// - Remark: Generated from `#/components/schemas/issue-comment/author_association`. - public var author_association: Components.Schemas.author_hyphen_association - /// - Remark: Generated from `#/components/schemas/issue-comment/performed_via_github_app`. - public var performed_via_github_app: Components.Schemas.nullable_hyphen_integration? - /// - Remark: Generated from `#/components/schemas/issue-comment/reactions`. - public var reactions: Components.Schemas.reaction_hyphen_rollup? - /// Creates a new `issue_hyphen_comment`. + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. /// /// - Parameters: - /// - id: Unique identifier of the issue comment + /// - id: /// - node_id: - /// - url: URL for the issue comment - /// - body: Contents of the issue comment - /// - body_text: - /// - body_html: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: /// - html_url: - /// - user: - /// - created_at: - /// - updated_at: - /// - issue_url: - /// - author_association: - /// - performed_via_github_app: - /// - reactions: + /// - members_url: + /// - repositories_url: + /// - parent: public init( - id: Swift.Int64, + id: Swift.Int, node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, url: Swift.String, - body: Swift.String? = nil, - body_text: Swift.String? = nil, - body_html: Swift.String? = nil, html_url: Swift.String, - user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, - created_at: Foundation.Date, - updated_at: Foundation.Date, - issue_url: Swift.String, - author_association: Components.Schemas.author_hyphen_association, - performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, - reactions: Components.Schemas.reaction_hyphen_rollup? = nil + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil ) { self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions self.url = url - self.body = body - self.body_text = body_text - self.body_html = body_html self.html_url = html_url - self.user = user - self.created_at = created_at - self.updated_at = updated_at - self.issue_url = issue_url - self.author_association = author_association - self.performed_via_github_app = performed_via_github_app - self.reactions = reactions + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent } public enum CodingKeys: String, CodingKey { case id case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions case url - case body - case body_text - case body_html case html_url - case user - case created_at - case updated_at - case issue_url - case author_association - case performed_via_github_app - case reactions + case members_url + case repositories_url + case parent } } /// Commit Comment @@ -4409,6 +4658,8 @@ public enum Components { public var body_text: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-issue/timeline_url`. public var timeline_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue/type`. + public var _type: Components.Schemas.issue_hyphen_type? /// - Remark: Generated from `#/components/schemas/nullable-issue/repository`. public var repository: Components.Schemas.repository? /// - Remark: Generated from `#/components/schemas/nullable-issue/performed_via_github_app`. @@ -4452,6 +4703,7 @@ public enum Components { /// - body_html: /// - body_text: /// - timeline_url: + /// - _type: /// - repository: /// - performed_via_github_app: /// - author_association: @@ -4488,6 +4740,7 @@ public enum Components { body_html: Swift.String? = nil, body_text: Swift.String? = nil, timeline_url: Swift.String? = nil, + _type: Components.Schemas.issue_hyphen_type? = nil, repository: Components.Schemas.repository? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, author_association: Components.Schemas.author_hyphen_association, @@ -4524,6 +4777,7 @@ public enum Components { self.body_html = body_html self.body_text = body_text self.timeline_url = timeline_url + self._type = _type self.repository = repository self.performed_via_github_app = performed_via_github_app self.author_association = author_association @@ -4561,6 +4815,7 @@ public enum Components { case body_html case body_text case timeline_url + case _type = "type" case repository case performed_via_github_app case author_association @@ -8949,6 +9204,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/labels`. public var labels: Components.Parameters.labels? + /// Can be the name of an issue type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/type`. + public var _type: Swift.String? /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/sort`. @frozen public enum sortPayload: String, Codable, Hashable, Sendable { case created = "created" @@ -8986,6 +9245,7 @@ public enum Operations { /// - filter: Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. /// - state: Indicates the state of the issues to return. /// - labels: A list of comma separated label names. Example: `bug,ui,@high` + /// - _type: Can be the name of an issue type. /// - sort: What to sort results by. /// - direction: The direction to sort the results by. /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. @@ -8995,6 +9255,7 @@ public enum Operations { filter: Operations.issues_sol_list_hyphen_for_hyphen_org.Input.Query.filterPayload? = nil, state: Operations.issues_sol_list_hyphen_for_hyphen_org.Input.Query.statePayload? = nil, labels: Components.Parameters.labels? = nil, + _type: Swift.String? = nil, sort: Operations.issues_sol_list_hyphen_for_hyphen_org.Input.Query.sortPayload? = nil, direction: Components.Parameters.direction? = nil, since: Components.Parameters.since? = nil, @@ -9004,6 +9265,7 @@ public enum Operations { self.filter = filter self.state = state self.labels = labels + self._type = _type self.sort = sort self.direction = direction self.since = since @@ -9615,6 +9877,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/assignee`. public var assignee: Swift.String? + /// Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/type`. + public var _type: Swift.String? /// The user that created the issue. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/creator`. @@ -9664,6 +9930,7 @@ public enum Operations { /// - milestone: If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. /// - state: Indicates the state of the issues to return. /// - assignee: Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. + /// - _type: Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. /// - creator: The user that created the issue. /// - mentioned: A user that's mentioned in the issue. /// - labels: A list of comma separated label names. Example: `bug,ui,@high` @@ -9676,6 +9943,7 @@ public enum Operations { milestone: Swift.String? = nil, state: Operations.issues_sol_list_hyphen_for_hyphen_repo.Input.Query.statePayload? = nil, assignee: Swift.String? = nil, + _type: Swift.String? = nil, creator: Swift.String? = nil, mentioned: Swift.String? = nil, labels: Components.Parameters.labels? = nil, @@ -9688,6 +9956,7 @@ public enum Operations { self.milestone = milestone self.state = state self.assignee = assignee + self._type = _type self.creator = creator self.mentioned = mentioned self.labels = labels @@ -10127,6 +10396,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignees`. public var assignees: [Swift.String]? + /// The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/type`. + public var _type: Swift.String? /// Creates a new `jsonPayload`. /// /// - Parameters: @@ -10136,13 +10409,15 @@ public enum Operations { /// - 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._ + /// - _type: The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ public init( title: Operations.issues_sol_create.Input.Body.jsonPayload.titlePayload, body: Swift.String? = nil, assignee: Swift.String? = nil, milestone: Operations.issues_sol_create.Input.Body.jsonPayload.milestonePayload? = nil, labels: Operations.issues_sol_create.Input.Body.jsonPayload.labelsPayload? = nil, - assignees: [Swift.String]? = nil + assignees: [Swift.String]? = nil, + _type: Swift.String? = nil ) { self.title = title self.body = body @@ -10150,6 +10425,7 @@ public enum Operations { self.milestone = milestone self.labels = labels self.assignees = assignees + self._type = _type } public enum CodingKeys: String, CodingKey { case title @@ -10158,6 +10434,7 @@ public enum Operations { case milestone case labels case assignees + case _type = "type" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/content/application\/json`. @@ -12099,6 +12376,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. public var assignees: [Swift.String]? + /// The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. + public var _type: Swift.String? /// Creates a new `jsonPayload`. /// /// - Parameters: @@ -12110,6 +12391,7 @@ public enum Operations { /// - milestone: /// - labels: Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. /// - assignees: Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// - _type: The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. public init( title: Operations.issues_sol_update.Input.Body.jsonPayload.titlePayload? = nil, body: Swift.String? = nil, @@ -12118,7 +12400,8 @@ public enum Operations { state_reason: Operations.issues_sol_update.Input.Body.jsonPayload.state_reasonPayload? = nil, milestone: Operations.issues_sol_update.Input.Body.jsonPayload.milestonePayload? = nil, labels: Operations.issues_sol_update.Input.Body.jsonPayload.labelsPayload? = nil, - assignees: [Swift.String]? = nil + assignees: [Swift.String]? = nil, + _type: Swift.String? = nil ) { self.title = title self.body = body @@ -12128,6 +12411,7 @@ public enum Operations { self.milestone = milestone self.labels = labels self.assignees = assignees + self._type = _type } public enum CodingKeys: String, CodingKey { case title @@ -12138,6 +12422,7 @@ public enum Operations { case milestone case labels case assignees + case _type = "type" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/content/application\/json`. @@ -15616,14 +15901,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. public struct jsonPayload: Codable, Hashable, Sendable { - /// The sub-issue to remove + /// The id of the sub-issue to remove /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. public var sub_issue_id: Swift.Int /// Creates a new `jsonPayload`. /// /// - Parameters: - /// - sub_issue_id: The sub-issue to remove + /// - sub_issue_id: The id of the sub-issue to remove public init(sub_issue_id: Swift.Int) { self.sub_issue_id = sub_issue_id } @@ -16119,7 +16404,7 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. public struct jsonPayload: Codable, Hashable, Sendable { - /// The sub-issue to add + /// The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. public var sub_issue_id: Swift.Int @@ -16130,7 +16415,7 @@ public enum Operations { /// Creates a new `jsonPayload`. /// /// - Parameters: - /// - sub_issue_id: The sub-issue to add + /// - sub_issue_id: The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue /// - replace_parent: Option that, when true, instructs the operation to replace the sub-issues current parent issue public init( sub_issue_id: Swift.Int, From 927463648c7fc603d661a7a0d87b42a5c9d3eb6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:45:55 +0000 Subject: [PATCH 13/37] Commit via running ake Sources/meta --- Sources/meta/Client.swift | 16 ++++----- Sources/meta/Types.swift | 69 +++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/Sources/meta/Client.swift b/Sources/meta/Client.swift index e09e79607db..b7f4ea34e9d 100644 --- a/Sources/meta/Client.swift +++ b/Sources/meta/Client.swift @@ -42,15 +42,15 @@ public struct Client: APIProtocol { /// /// Get Hypermedia links to resources accessible in GitHub's REST API /// - /// - Remark: HTTP `GET //`. - /// - Remark: Generated from `#/paths////get(meta/root)`. + /// - Remark: HTTP `GET /`. + /// - Remark: Generated from `#/paths///get(meta/root)`. public func meta_sol_root(_ input: Operations.meta_sol_root.Input) async throws -> Operations.meta_sol_root.Output { try await client.send( input: input, forOperation: Operations.meta_sol_root.id, serializer: { input in let path = try converter.renderedPath( - template: "//", + template: "/", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( @@ -358,16 +358,16 @@ public struct Client: APIProtocol { let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "text/plain" ] ) switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Swift.String.self, + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, from: responseBody, transforming: { value in - .json(value) + .plainText(value) } ) default: diff --git a/Sources/meta/Types.swift b/Sources/meta/Types.swift index 938e1e9ec1e..d62139f0f8b 100644 --- a/Sources/meta/Types.swift +++ b/Sources/meta/Types.swift @@ -15,8 +15,8 @@ public protocol APIProtocol: Sendable { /// /// Get Hypermedia links to resources accessible in GitHub's REST API /// - /// - Remark: HTTP `GET //`. - /// - Remark: Generated from `#/paths////get(meta/root)`. + /// - Remark: HTTP `GET /`. + /// - Remark: Generated from `#/paths///get(meta/root)`. func meta_sol_root(_ input: Operations.meta_sol_root.Input) async throws -> Operations.meta_sol_root.Output /// Get GitHub meta information /// @@ -61,8 +61,8 @@ extension APIProtocol { /// /// Get Hypermedia links to resources accessible in GitHub's REST API /// - /// - Remark: HTTP `GET //`. - /// - Remark: Generated from `#/paths////get(meta/root)`. + /// - Remark: HTTP `GET /`. + /// - Remark: Generated from `#/paths///get(meta/root)`. public func meta_sol_root(headers: Operations.meta_sol_root.Input.Headers = .init()) async throws -> Operations.meta_sol_root.Output { try await meta_sol_root(Operations.meta_sol_root.Input(headers: headers)) } @@ -461,6 +461,31 @@ public enum Components { public var packages: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/domains/actions`. public var actions: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/api-overview/domains/actions_inbound`. + public struct actions_inboundPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api-overview/domains/actions_inbound/full_domains`. + public var full_domains: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/api-overview/domains/actions_inbound/wildcard_domains`. + public var wildcard_domains: [Swift.String]? + /// Creates a new `actions_inboundPayload`. + /// + /// - Parameters: + /// - full_domains: + /// - wildcard_domains: + public init( + full_domains: [Swift.String]? = nil, + wildcard_domains: [Swift.String]? = nil + ) { + self.full_domains = full_domains + self.wildcard_domains = wildcard_domains + } + public enum CodingKeys: String, CodingKey { + case full_domains + case wildcard_domains + } + } + /// - Remark: Generated from `#/components/schemas/api-overview/domains/actions_inbound`. + public var actions_inbound: Components.Schemas.api_hyphen_overview.domainsPayload.actions_inboundPayload? /// - Remark: Generated from `#/components/schemas/api-overview/domains/artifact_attestations`. public struct artifact_attestationsPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/api-overview/domains/artifact_attestations/trust_domain`. @@ -494,6 +519,7 @@ public enum Components { /// - copilot: /// - packages: /// - actions: + /// - actions_inbound: /// - artifact_attestations: public init( website: [Swift.String]? = nil, @@ -501,6 +527,7 @@ public enum Components { copilot: [Swift.String]? = nil, packages: [Swift.String]? = nil, actions: [Swift.String]? = nil, + actions_inbound: Components.Schemas.api_hyphen_overview.domainsPayload.actions_inboundPayload? = nil, artifact_attestations: Components.Schemas.api_hyphen_overview.domainsPayload.artifact_attestationsPayload? = nil ) { self.website = website @@ -508,6 +535,7 @@ public enum Components { self.copilot = copilot self.packages = packages self.actions = actions + self.actions_inbound = actions_inbound self.artifact_attestations = artifact_attestations } public enum CodingKeys: String, CodingKey { @@ -516,6 +544,7 @@ public enum Components { case copilot case packages case actions + case actions_inbound case artifact_attestations } } @@ -648,8 +677,8 @@ public enum Operations { /// /// Get Hypermedia links to resources accessible in GitHub's REST API /// - /// - Remark: HTTP `GET //`. - /// - Remark: Generated from `#/paths////get(meta/root)`. + /// - Remark: HTTP `GET /`. + /// - Remark: Generated from `#/paths///get(meta/root)`. public enum meta_sol_root { public static let id: Swift.String = "meta/root" public struct Input: Sendable, Hashable { @@ -704,7 +733,7 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths////get(meta/root)/responses/200`. + /// - Remark: Generated from `#/paths///get(meta/root)/responses/200`. /// /// HTTP response code: `200 ok`. case ok(Operations.meta_sol_root.Output.Ok) @@ -1198,16 +1227,16 @@ public enum Operations { public struct Ok: Sendable, Hashable { /// - Remark: Generated from `#/paths/zen/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/zen/GET/responses/200/content/application\/json`. - case json(Swift.String) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/zen/GET/responses/200/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Swift.String { + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { get throws { switch self { - case let .json(body): + case let .plainText(body): return body } } @@ -1252,12 +1281,12 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { - case json + case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { - case "application/json": - self = .json + case "text/plain": + self = .plainText default: self = .other(rawValue) } @@ -1266,13 +1295,13 @@ public enum Operations { switch self { case let .other(string): return string - case .json: - return "application/json" + case .plainText: + return "text/plain" } } public static var allCases: [Self] { [ - .json + .plainText ] } } From e4611bd9b643ee0845378720a5d9ae179f772083 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:46:18 +0000 Subject: [PATCH 14/37] Commit via running ake Sources/migrations --- Sources/migrations/Types.swift | 276 ++++++++++++++++++--------------- 1 file changed, 151 insertions(+), 125 deletions(-) diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 2ab6b3f543c..aa2a758facf 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -949,6 +949,131 @@ public enum Components { case status } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -1094,131 +1219,6 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -2075,6 +2075,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -2197,6 +2219,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -2204,6 +2227,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -2211,6 +2235,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -2219,6 +2244,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection From cd9372ff73c2681f91ae5c9768ffc74e98f1138b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:47:04 +0000 Subject: [PATCH 15/37] Commit via running ake Sources/orgs --- Sources/orgs/Client.swift | 731 ++++++- Sources/orgs/Types.swift | 4330 ++++++++++++++++++++++++++----------- 2 files changed, 3717 insertions(+), 1344 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 1d3f06e543d..76e06589081 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -131,7 +131,7 @@ public struct Client: APIProtocol { /// /// Gets information about an organization. /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). /// /// To see the full details about an organization, the authenticated user must be an organization owner. /// @@ -512,6 +512,13 @@ public struct Client: APIProtocol { name: "after", value: input.query.after ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "predicate_type", + value: input.query.predicate_type + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3372,14 +3379,442 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.link.self - )) + case 200: + let headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.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.orgs_sol_list_hyphen_invitation_hyphen_teams.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.team].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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 + ) + ) + } + } + ) + } + /// List issue types for an organization + /// + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + public func orgs_sol_list_hyphen_issue_hyphen_types(_ input: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input) async throws -> Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_list_hyphen_issue_hyphen_types.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-types", + parameters: [ + input.path.org + ] + ) + 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_list_hyphen_issue_hyphen_types.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.issue_hyphen_type].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 + ) + ) + } + } + ) + } + /// Create issue type for an organization + /// + /// Create a new issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + public func orgs_sol_create_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_create_hyphen_issue_hyphen_type.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-types", + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.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.issue_hyphen_type.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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.validation_failed_simple.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_hyphen_simple.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 + ) + ) + } + } + ) + } + /// Update issue type for an organization + /// + /// Updates an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + public func orgs_sol_update_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_update_hyphen_issue_hyphen_type.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_update_hyphen_issue_hyphen_type.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-types/{}", + parameters: [ + input.path.org, + input.path.issue_type_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + 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.orgs_sol_update_hyphen_issue_hyphen_type.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.issue_hyphen_type.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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.validation_failed_simple.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_hyphen_simple.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 + ) + ) + } + } + ) + } + /// Delete issue type for an organization + /// + /// Deletes an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + public func orgs_sol_delete_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/issue-types/{}", + parameters: [ + input.path.org, + input.path.issue_type_id + ] + ) + 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 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Body + let body: Components.Responses.validation_failed_simple.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3389,7 +3824,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.team].self, + Components.Schemas.validation_hyphen_error_hyphen_simple.self, from: responseBody, transforming: { value in .json(value) @@ -3398,10 +3833,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.not_found.Body @@ -5055,6 +5487,13 @@ public struct Client: APIProtocol { name: "last_used_after", value: input.query.last_used_after ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "token_id", + value: input.query.token_id + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5742,6 +6181,13 @@ public struct Client: APIProtocol { name: "last_used_after", value: input.query.last_used_after ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "token_id", + value: input.query.token_id + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -6455,6 +6901,10 @@ public struct Client: APIProtocol { /// /// Creates new or updates existing custom properties defined for an organization in a batch. /// + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. @@ -7402,16 +7852,247 @@ public struct Client: APIProtocol { } ) } - /// List security manager teams + /// Get organization ruleset history + /// + /// Get the history of an organization ruleset. + /// + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + public func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history(_ input: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/rulesets/{}/history", + parameters: [ + input.path.org, + input.path.ruleset_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 contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.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.ruleset_hyphen_version].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get organization ruleset version /// - /// Lists teams that are security managers for 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)." + /// Get a version of an organization ruleset. /// - /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + public func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version(_ input: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output { + try await client.send( + input: input, + forOperation: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/rulesets/{}/history/{}", + parameters: [ + input.path.org, + input.path.ruleset_id, + input.path.version_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_org_hyphen_ruleset_hyphen_version.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.ruleset_hyphen_version_hyphen_with_hyphen_state.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List security manager teams /// - /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `GET /orgs/{org}/security-managers`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. + @available(*, deprecated) public func orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams(_ input: Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Input) async throws -> Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Output { try await client.send( input: input, @@ -7472,14 +8153,12 @@ public struct Client: APIProtocol { } /// Add a security manager team /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. + @available(*, deprecated) public func orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team(_ input: Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Input) async throws -> Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Output { try await client.send( input: input, @@ -7517,14 +8196,12 @@ public struct Client: APIProtocol { } /// Remove a security manager team /// - /// Removes the security manager role from a team for 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) team from an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. + @available(*, deprecated) public func orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team(_ input: Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Input) async throws -> Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Output { try await client.send( input: input, diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index d93cd0f981b..ec68e9f9b43 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -25,7 +25,7 @@ public protocol APIProtocol: Sendable { /// /// Gets information about an organization. /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). /// /// To see the full details about an organization, the authenticated user must be an organization owner. /// @@ -361,6 +361,49 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. func orgs_sol_list_hyphen_invitation_hyphen_teams(_ input: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input) async throws -> Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output + /// List issue types for an organization + /// + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + func orgs_sol_list_hyphen_issue_hyphen_types(_ input: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input) async throws -> Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output + /// Create issue type for an organization + /// + /// Create a new issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + func orgs_sol_create_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output + /// Update issue type for an organization + /// + /// Updates an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + func orgs_sol_update_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_update_hyphen_issue_hyphen_type.Output + /// Delete issue type for an organization + /// + /// Deletes an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + func orgs_sol_delete_hyphen_issue_hyphen_type(_ input: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input) async throws -> Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Output /// List organization members /// /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. @@ -634,6 +677,10 @@ public protocol APIProtocol: Sendable { /// /// Creates new or updates existing custom properties defined for an organization in a batch. /// + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. @@ -725,38 +772,46 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. func orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output - /// List security manager teams + /// Get organization ruleset history /// - /// Lists teams that are security managers for 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)." + /// Get the history of an organization ruleset. /// - /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history(_ input: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output + /// Get organization ruleset version /// - /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// Get a version of an organization ruleset. + /// + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version(_ input: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output + /// List security manager teams + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `GET /orgs/{org}/security-managers`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. + @available(*, deprecated) func orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams(_ input: Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Input) async throws -> Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Output /// Add a security manager team /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. + @available(*, deprecated) func orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team(_ input: Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Input) async throws -> Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Output /// Remove a security manager team /// - /// Removes the security manager role from a team for 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) team from an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. + @available(*, deprecated) func orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team(_ input: Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Input) async throws -> Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Output /// Enable or disable a security feature for an organization /// @@ -841,7 +896,7 @@ extension APIProtocol { /// /// Gets information about an organization. /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). /// /// To see the full details about an organization, the authenticated user must be an organization owner. /// @@ -1487,6 +1542,85 @@ extension APIProtocol { headers: headers )) } + /// List issue types for an organization + /// + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + public func orgs_sol_list_hyphen_issue_hyphen_types( + path: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input.Path, + headers: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input.Headers = .init() + ) async throws -> Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output { + try await orgs_sol_list_hyphen_issue_hyphen_types(Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input( + path: path, + headers: headers + )) + } + /// Create issue type for an organization + /// + /// Create a new issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + public func orgs_sol_create_hyphen_issue_hyphen_type( + path: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Headers = .init(), + body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Body + ) async throws -> Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output { + try await orgs_sol_create_hyphen_issue_hyphen_type(Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input( + path: path, + headers: headers, + body: body + )) + } + /// Update issue type for an organization + /// + /// Updates an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + public func orgs_sol_update_hyphen_issue_hyphen_type( + path: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Headers = .init(), + body: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Body + ) async throws -> Operations.orgs_sol_update_hyphen_issue_hyphen_type.Output { + try await orgs_sol_update_hyphen_issue_hyphen_type(Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete issue type for an organization + /// + /// Deletes an issue type for an organization. + /// + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + public func orgs_sol_delete_hyphen_issue_hyphen_type( + path: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input.Headers = .init() + ) async throws -> Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Output { + try await orgs_sol_delete_hyphen_issue_hyphen_type(Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input( + path: path, + headers: headers + )) + } /// List organization members /// /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. @@ -1970,6 +2104,10 @@ extension APIProtocol { /// /// Creates new or updates existing custom properties defined for an organization in a batch. /// + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. @@ -2139,16 +2277,46 @@ extension APIProtocol { public func orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user(path: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path) async throws -> Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output { try await orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user(Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input(path: path)) } - /// List security manager teams + /// Get organization ruleset history + /// + /// Get the history of an organization ruleset. + /// + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + public func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history( + path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Path, + query: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Query = .init(), + headers: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Headers = .init() + ) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output { + try await orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history(Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get organization ruleset version /// - /// Lists teams that are security managers for 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)." + /// Get a version of an organization ruleset. /// - /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + public func orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version( + path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input.Path, + headers: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input.Headers = .init() + ) async throws -> Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output { + try await orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version(Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input( + path: path, + headers: headers + )) + } + /// List security manager teams /// - /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `GET /orgs/{org}/security-managers`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. + @available(*, deprecated) public func orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams( path: Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Input.Path, headers: Operations.orgs_sol_list_hyphen_security_hyphen_manager_hyphen_teams.Input.Headers = .init() @@ -2160,27 +2328,23 @@ extension APIProtocol { } /// Add a security manager team /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. + @available(*, deprecated) public func orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team(path: Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Input.Path) async throws -> Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Output { try await orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team(Operations.orgs_sol_add_hyphen_security_hyphen_manager_hyphen_team.Input(path: path)) } /// Remove a security manager team /// - /// Removes the security manager role from a team for 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) team from an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. + @available(*, deprecated) public func orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team(path: Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Input.Path) async throws -> Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Output { try await orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team(Operations.orgs_sol_remove_hyphen_security_hyphen_manager_hyphen_team.Input(path: path)) } @@ -2522,149 +2686,87 @@ public enum Components { case errors } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 description + case html_url + case website_url + case id + case node_id case name - case email - case login - case id - case node_id + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type } } /// The URL to which the payloads will be delivered. @@ -2760,7 +2862,7 @@ public enum Components { /// Unique identifier of the webhook delivery. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/id`. - public var id: Swift.Int + public var id: Swift.Int64 /// Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/guid`. @@ -2796,11 +2898,11 @@ public enum Components { /// The id of the GitHub App installation associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/installation_id`. - public var installation_id: Swift.Int? + public var installation_id: Swift.Int64? /// The id of the repository associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/repository_id`. - public var repository_id: Swift.Int? + public var repository_id: Swift.Int64? /// Time when the webhook delivery was throttled. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/throttled_at`. @@ -2821,7 +2923,7 @@ public enum Components { /// - repository_id: The id of the repository associated with this event. /// - throttled_at: Time when the webhook delivery was throttled. public init( - id: Swift.Int, + id: Swift.Int64, guid: Swift.String, delivered_at: Foundation.Date, redelivery: Swift.Bool, @@ -2830,8 +2932,8 @@ public enum Components { status_code: Swift.Int, event: Swift.String, action: Swift.String? = nil, - installation_id: Swift.Int? = nil, - repository_id: Swift.Int? = nil, + installation_id: Swift.Int64? = nil, + repository_id: Swift.Int64? = nil, throttled_at: Foundation.Date? = nil ) { self.id = id @@ -3279,89 +3381,6 @@ public enum Components { case response } } - /// An enterprise on GitHub. - /// - /// - Remark: Generated from `#/components/schemas/enterprise`. - public struct enterprise: Codable, Hashable, Sendable { - /// A short description of the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. - public var html_url: Swift.String - /// The enterprise's website URL. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. - public var website_url: Swift.String? - /// Unique identifier of the enterprise - /// - /// - Remark: Generated from `#/components/schemas/enterprise/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. - public var node_id: Swift.String - /// The name of the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/name`. - public var name: Swift.String - /// The slug url identifier for the enterprise. - /// - /// - Remark: Generated from `#/components/schemas/enterprise/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. - public var updated_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. - public var avatar_url: Swift.String - /// Creates a new `enterprise`. - /// - /// - Parameters: - /// - description: A short description of the enterprise. - /// - html_url: - /// - website_url: The enterprise's website URL. - /// - id: Unique identifier of the enterprise - /// - node_id: - /// - name: The name of the enterprise. - /// - slug: The slug url identifier for the enterprise. - /// - created_at: - /// - updated_at: - /// - avatar_url: - public init( - description: Swift.String? = nil, - html_url: Swift.String, - website_url: Swift.String? = nil, - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - created_at: Foundation.Date? = nil, - updated_at: Foundation.Date? = nil, - avatar_url: Swift.String - ) { - self.description = description - self.html_url = html_url - self.website_url = website_url - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.created_at = created_at - self.updated_at = updated_at - self.avatar_url = avatar_url - } - public enum CodingKeys: String, CodingKey { - case description - case html_url - case website_url - case id - case node_id - case name - case slug - case created_at - case updated_at - case avatar_url - } - } /// The permissions granted to the user access token. /// /// - Remark: Generated from `#/components/schemas/app-permissions`. @@ -3421,14 +3440,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/contents`. public var contents: Components.Schemas.app_hyphen_permissions.contentsPayload? - /// The leve of permission to grant the access token to manage Dependabot secrets. + /// The level of permission to grant the access token to manage Dependabot secrets. /// /// - Remark: Generated from `#/components/schemas/app-permissions/dependabot_secrets`. @frozen public enum dependabot_secretsPayload: String, Codable, Hashable, Sendable { case read = "read" case write = "write" } - /// The leve of permission to grant the access token to manage Dependabot secrets. + /// The level of permission to grant the access token to manage Dependabot secrets. /// /// - Remark: Generated from `#/components/schemas/app-permissions/dependabot_secrets`. public var dependabot_secrets: Components.Schemas.app_hyphen_permissions.dependabot_secretsPayload? @@ -3900,7 +3919,7 @@ public enum Components { /// - checks: The level of permission to grant the access token for checks on code. /// - codespaces: The level of permission to grant the access token to create, edit, delete, and list Codespaces. /// - contents: The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. - /// - dependabot_secrets: The leve of permission to grant the access token to manage Dependabot secrets. + /// - dependabot_secrets: The level of permission to grant the access token to manage Dependabot secrets. /// - deployments: The level of permission to grant the access token for deployments and deployment statuses. /// - environments: The level of permission to grant the access token for managing repository environments. /// - issues: The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. @@ -4093,104 +4112,249 @@ public enum Components { case starring } } - /// Installation + /// A GitHub user. /// - /// - Remark: Generated from `#/components/schemas/installation`. - public struct installation: Codable, Hashable, Sendable { - /// The ID of the installation. - /// - /// - Remark: Generated from `#/components/schemas/installation/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/installation/account`. - public struct accountPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/installation/account/value1`. - public var value1: Components.Schemas.simple_hyphen_user? - /// - Remark: Generated from `#/components/schemas/installation/account/value2`. - public var value2: Components.Schemas.enterprise? - /// Creates a new `accountPayload`. - /// - /// - Parameters: - /// - value1: - /// - value2: - public init( - value1: Components.Schemas.simple_hyphen_user? = nil, - value2: Components.Schemas.enterprise? = nil - ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - value1 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - value2 = try .init(from: decoder) - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - value1, - value2 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - try value1?.encode(to: encoder) - try value2?.encode(to: encoder) - } - } - /// - Remark: Generated from `#/components/schemas/installation/account`. - public var account: Components.Schemas.installation.accountPayload? - /// Describe whether all repositories have been selected or there's a selection involved - /// - /// - Remark: Generated from `#/components/schemas/installation/repository_selection`. - @frozen public enum repository_selectionPayload: String, Codable, Hashable, Sendable { - case all = "all" - case selected = "selected" - } - /// Describe whether all repositories have been selected or there's a selection involved - /// - /// - Remark: Generated from `#/components/schemas/installation/repository_selection`. - public var repository_selection: Components.Schemas.installation.repository_selectionPayload - /// - Remark: Generated from `#/components/schemas/installation/access_tokens_url`. - public var access_tokens_url: Swift.String - /// - Remark: Generated from `#/components/schemas/installation/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/installation/html_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/installation/app_id`. - public var app_id: Swift.Int - /// The ID of the user or organization this token is being scoped to. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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`. /// - /// - Remark: Generated from `#/components/schemas/installation/target_id`. - public var target_id: Swift.Int - /// - Remark: Generated from `#/components/schemas/installation/target_type`. - public var target_type: Swift.String - /// - Remark: Generated from `#/components/schemas/installation/permissions`. - public var permissions: Components.Schemas.app_hyphen_permissions - /// - Remark: Generated from `#/components/schemas/installation/events`. - public var events: [Swift.String] - /// - Remark: Generated from `#/components/schemas/installation/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/installation/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/installation/single_file_name`. - public var single_file_name: Swift.String? - /// - Remark: Generated from `#/components/schemas/installation/has_multiple_single_files`. - public var has_multiple_single_files: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/installation/single_file_paths`. - public var single_file_paths: [Swift.String]? - /// - Remark: Generated from `#/components/schemas/installation/app_slug`. - public var app_slug: Swift.String - /// - Remark: Generated from `#/components/schemas/installation/suspended_by`. - public var suspended_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } + /// Installation + /// + /// - Remark: Generated from `#/components/schemas/installation`. + public struct installation: Codable, Hashable, Sendable { + /// The ID of the installation. + /// + /// - Remark: Generated from `#/components/schemas/installation/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/account`. + public struct accountPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/installation/account/value1`. + public var value1: Components.Schemas.simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/installation/account/value2`. + public var value2: Components.Schemas.enterprise? + /// Creates a new `accountPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.simple_hyphen_user? = nil, + value2: Components.Schemas.enterprise? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + value1, + value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try value1?.encode(to: encoder) + try value2?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/installation/account`. + public var account: Components.Schemas.installation.accountPayload? + /// Describe whether all repositories have been selected or there's a selection involved + /// + /// - Remark: Generated from `#/components/schemas/installation/repository_selection`. + @frozen public enum repository_selectionPayload: String, Codable, Hashable, Sendable { + case all = "all" + case selected = "selected" + } + /// Describe whether all repositories have been selected or there's a selection involved + /// + /// - Remark: Generated from `#/components/schemas/installation/repository_selection`. + public var repository_selection: Components.Schemas.installation.repository_selectionPayload + /// - Remark: Generated from `#/components/schemas/installation/access_tokens_url`. + public var access_tokens_url: Swift.String + /// - Remark: Generated from `#/components/schemas/installation/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/installation/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/installation/app_id`. + public var app_id: Swift.Int + /// The ID of the user or organization this token is being scoped to. + /// + /// - Remark: Generated from `#/components/schemas/installation/target_id`. + public var target_id: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/target_type`. + public var target_type: Swift.String + /// - Remark: Generated from `#/components/schemas/installation/permissions`. + public var permissions: Components.Schemas.app_hyphen_permissions + /// - Remark: Generated from `#/components/schemas/installation/events`. + public var events: [Swift.String] + /// - Remark: Generated from `#/components/schemas/installation/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/installation/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/installation/single_file_name`. + public var single_file_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/installation/has_multiple_single_files`. + public var has_multiple_single_files: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/installation/single_file_paths`. + public var single_file_paths: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/installation/app_slug`. + public var app_slug: Swift.String + /// - Remark: Generated from `#/components/schemas/installation/suspended_by`. + public var suspended_by: Components.Schemas.nullable_hyphen_simple_hyphen_user? /// - Remark: Generated from `#/components/schemas/installation/suspended_at`. public var suspended_at: Foundation.Date? /// - Remark: Generated from `#/components/schemas/installation/contact_email`. @@ -4327,249 +4491,94 @@ public enum Components { case html_url } } - /// Groups of organization members that gives permissions on specified repositories. + /// The type of issue. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct issue_hyphen_type: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + /// - Remark: Generated from `#/components/schemas/issue-type/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team + /// The node identifier of the issue type. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var node_id: Swift.String + /// The name of the issue type. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + /// - Remark: Generated from `#/components/schemas/issue-type/name`. public var name: Swift.String - /// Description of the team + /// The description of the issue type. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + /// - Remark: Generated from `#/components/schemas/issue-type/description`. public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.issue_hyphen_type.colorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var created_at: Foundation.Date? + /// The time the issue type last updated. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updated_at: Foundation.Date? + /// The enabled state of the issue type. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var is_enabled: Swift.Bool? + /// Creates a new `issue_hyphen_type`. /// /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + /// - id: The unique identifier of the issue type. + /// - node_id: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - created_at: The time the issue type created. + /// - updated_at: The time the issue type last updated. + /// - is_enabled: The enabled state of the issue type. public init( id: Swift.Int, node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, name: Swift.String, description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + color: Components.Schemas.issue_hyphen_type.colorPayload? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + is_enabled: Swift.Bool? = nil ) { self.id = id self.node_id = node_id self.name = name - self.slug = slug self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent + self.color = color + self.created_at = created_at + self.updated_at = updated_at + self.is_enabled = is_enabled } public enum CodingKeys: String, CodingKey { case id case node_id case name - case slug case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent + case color + case created_at + case updated_at + case is_enabled } } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. @@ -4596,6 +4605,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -4718,6 +4749,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -4725,6 +4757,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -4732,6 +4765,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -4740,6 +4774,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -5905,46 +5940,291 @@ public enum Components { case deploy_keys_enabled_for_repositories } } - /// Organization Invitation + /// Groups of organization members that gives permissions on specified repositories. /// - /// - Remark: Generated from `#/components/schemas/organization-invitation`. - public struct organization_hyphen_invitation: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-invitation/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/organization-invitation/login`. - public var login: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-invitation/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-invitation/role`. - public var role: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-invitation/created_at`. - public var created_at: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-invitation/failed_at`. - public var failed_at: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-invitation/failed_reason`. - public var failed_reason: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-invitation/inviter`. - public var inviter: Components.Schemas.simple_hyphen_user - /// - Remark: Generated from `#/components/schemas/organization-invitation/team_count`. - public var team_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-invitation/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-invitation/invitation_teams_url`. - public var invitation_teams_url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-invitation/invitation_source`. - public var invitation_source: Swift.String? - /// Creates a new `organization_hyphen_invitation`. + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. /// /// - Parameters: - /// - id: - /// - login: - /// - email: - /// - role: - /// - created_at: - /// - failed_at: - /// - failed_reason: - /// - inviter: - /// - team_count: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } + /// Organization Invitation + /// + /// - Remark: Generated from `#/components/schemas/organization-invitation`. + public struct organization_hyphen_invitation: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-invitation/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/organization-invitation/login`. + public var login: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-invitation/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-invitation/role`. + public var role: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-invitation/created_at`. + public var created_at: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-invitation/failed_at`. + public var failed_at: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-invitation/failed_reason`. + public var failed_reason: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-invitation/inviter`. + public var inviter: Components.Schemas.simple_hyphen_user + /// - Remark: Generated from `#/components/schemas/organization-invitation/team_count`. + public var team_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-invitation/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-invitation/invitation_teams_url`. + public var invitation_teams_url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-invitation/invitation_source`. + public var invitation_source: Swift.String? + /// Creates a new `organization_hyphen_invitation`. + /// + /// - Parameters: + /// - id: + /// - login: + /// - email: + /// - role: + /// - created_at: + /// - failed_at: + /// - failed_reason: + /// - inviter: + /// - team_count: /// - node_id: /// - invitation_teams_url: /// - invitation_source: @@ -6351,26 +6631,138 @@ public enum Components { /// /// - 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 { - /// - Remark: Generated from `#/components/schemas/org-membership/url`. - public var url: Swift.String - /// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type`. + public struct organization_hyphen_create_hyphen_issue_hyphen_type: Codable, Hashable, Sendable { + /// Name of the issue type. /// - /// - Remark: Generated from `#/components/schemas/org-membership/state`. - @frozen public enum statePayload: String, Codable, Hashable, Sendable { - case active = "active" - case pending = "pending" + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type/name`. + public var name: Swift.String + /// Whether or not the issue type is enabled at the organization level. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type/is_enabled`. + public var is_enabled: Swift.Bool + /// Description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type/description`. + public var description: Swift.String? + /// Color for the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" } - /// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + /// Color for the issue type. /// - /// - Remark: Generated from `#/components/schemas/org-membership/state`. - public var state: Components.Schemas.org_hyphen_membership.statePayload - /// The user's membership type in the organization. + /// - Remark: Generated from `#/components/schemas/organization-create-issue-type/color`. + public var color: Components.Schemas.organization_hyphen_create_hyphen_issue_hyphen_type.colorPayload? + /// Creates a new `organization_hyphen_create_hyphen_issue_hyphen_type`. /// - /// - Remark: Generated from `#/components/schemas/org-membership/role`. + /// - Parameters: + /// - name: Name of the issue type. + /// - is_enabled: Whether or not the issue type is enabled at the organization level. + /// - description: Description of the issue type. + /// - color: Color for the issue type. + public init( + name: Swift.String, + is_enabled: Swift.Bool, + description: Swift.String? = nil, + color: Components.Schemas.organization_hyphen_create_hyphen_issue_hyphen_type.colorPayload? = nil + ) { + self.name = name + self.is_enabled = is_enabled + self.description = description + self.color = color + } + public enum CodingKeys: String, CodingKey { + case name + case is_enabled + case description + case color + } + } + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type`. + public struct organization_hyphen_update_hyphen_issue_hyphen_type: Codable, Hashable, Sendable { + /// Name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type/name`. + public var name: Swift.String + /// Whether or not the issue type is enabled at the organization level. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type/is_enabled`. + public var is_enabled: Swift.Bool + /// Description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type/description`. + public var description: Swift.String? + /// Color for the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// Color for the issue type. + /// + /// - Remark: Generated from `#/components/schemas/organization-update-issue-type/color`. + public var color: Components.Schemas.organization_hyphen_update_hyphen_issue_hyphen_type.colorPayload? + /// Creates a new `organization_hyphen_update_hyphen_issue_hyphen_type`. + /// + /// - Parameters: + /// - name: Name of the issue type. + /// - is_enabled: Whether or not the issue type is enabled at the organization level. + /// - description: Description of the issue type. + /// - color: Color for the issue type. + public init( + name: Swift.String, + is_enabled: Swift.Bool, + description: Swift.String? = nil, + color: Components.Schemas.organization_hyphen_update_hyphen_issue_hyphen_type.colorPayload? = nil + ) { + self.name = name + self.is_enabled = is_enabled + self.description = description + self.color = color + } + public enum CodingKeys: String, CodingKey { + case name + case is_enabled + case description + case color + } + } + /// Org Membership + /// + /// - Remark: Generated from `#/components/schemas/org-membership`. + public struct org_hyphen_membership: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-membership/url`. + public var url: Swift.String + /// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/state`. + @frozen public enum statePayload: String, Codable, Hashable, Sendable { + case active = "active" + case pending = "pending" + } + /// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/state`. + public var state: Components.Schemas.org_hyphen_membership.statePayload + /// The user's membership type in the organization. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/role`. @frozen public enum rolePayload: String, Codable, Hashable, Sendable { case admin = "admin" case member = "member" @@ -7509,6 +7901,121 @@ public enum Components { case values_editable_by } } + /// Custom property set payload + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload`. + public struct custom_hyphen_property_hyphen_set_hyphen_payload: Codable, Hashable, Sendable { + /// The type of the value for the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/value_type`. + @frozen public enum value_typePayload: String, Codable, Hashable, Sendable { + case string = "string" + case single_select = "single_select" + case multi_select = "multi_select" + case true_false = "true_false" + } + /// The type of the value for the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/value_type`. + public var value_type: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.value_typePayload + /// Whether the property is required. + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/required`. + public var required: Swift.Bool? + /// Default value of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/default_value`. + @frozen public enum default_valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/default_value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/default_value/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Default value of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/default_value`. + public var default_value: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.default_valuePayload? + /// Short description of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/description`. + public var description: Swift.String? + /// An ordered list of the allowed values of the property. + /// The property can have up to 200 allowed values. + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/allowed_values`. + public var allowed_values: [Swift.String]? + /// Who can edit the values of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/values_editable_by`. + @frozen public enum values_editable_byPayload: String, Codable, Hashable, Sendable { + case org_actors = "org_actors" + case org_and_repo_actors = "org_and_repo_actors" + } + /// Who can edit the values of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-set-payload/values_editable_by`. + public var values_editable_by: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.values_editable_byPayload? + /// Creates a new `custom_hyphen_property_hyphen_set_hyphen_payload`. + /// + /// - Parameters: + /// - value_type: The type of the value for the property + /// - required: Whether the property is required. + /// - default_value: Default value of the property + /// - description: Short description of the property + /// - allowed_values: An ordered list of the allowed values of the property. + /// - values_editable_by: Who can edit the values of the property + public init( + value_type: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.value_typePayload, + required: Swift.Bool? = nil, + default_value: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.default_valuePayload? = nil, + description: Swift.String? = nil, + allowed_values: [Swift.String]? = nil, + values_editable_by: Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload.values_editable_byPayload? = nil + ) { + self.value_type = value_type + self.required = required + self.default_value = default_value + self.description = description + self.allowed_values = allowed_values + self.values_editable_by = values_editable_by + } + public enum CodingKeys: String, CodingKey { + case value_type + case required + case default_value + case description + case allowed_values + case values_editable_by + } + } /// Custom property name and associated value /// /// - Remark: Generated from `#/components/schemas/custom-property-value`. @@ -7614,6 +8121,110 @@ public enum Components { case properties } } + /// The historical version of a ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version`. + public struct ruleset_hyphen_version: Codable, Hashable, Sendable { + /// The ID of the previous version of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/version_id`. + public var version_id: Swift.Int + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public struct actorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/type`. + public var _type: Swift.String? + /// Creates a new `actorPayload`. + /// + /// - Parameters: + /// - id: + /// - _type: + public init( + id: Swift.Int? = nil, + _type: Swift.String? = nil + ) { + self.id = id + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + } + } + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public var actor: Components.Schemas.ruleset_hyphen_version.actorPayload + /// - Remark: Generated from `#/components/schemas/ruleset-version/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `ruleset_hyphen_version`. + /// + /// - Parameters: + /// - version_id: The ID of the previous version of the ruleset + /// - actor: The actor who updated the ruleset + /// - updated_at: + public init( + version_id: Swift.Int, + actor: Components.Schemas.ruleset_hyphen_version.actorPayload, + updated_at: Foundation.Date + ) { + self.version_id = version_id + self.actor = actor + self.updated_at = updated_at + } + public enum CodingKeys: String, CodingKey { + case version_id + case actor + case updated_at + } + } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state`. + public struct ruleset_hyphen_version_hyphen_with_hyphen_state: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value1`. + public var value1: Components.Schemas.ruleset_hyphen_version + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// The state of the ruleset version + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2/state`. + public var state: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - state: The state of the ruleset version + public init(state: OpenAPIRuntime.OpenAPIObjectContainer) { + self.state = state + } + public enum CodingKeys: String, CodingKey { + case state + } + } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public var value2: Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state.Value2Payload + /// Creates a new `ruleset_hyphen_version_hyphen_with_hyphen_state`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.ruleset_hyphen_version, + value2: Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -7646,10 +8257,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias page = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias team_hyphen_slug = Swift.String /// An organization ID. Only return organizations with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-org`. @@ -7737,6 +8344,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/invitation-id`. public typealias invitation_hyphen_id = Swift.Int + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/parameters/issue-type-id`. + public typealias issue_hyphen_type_hyphen_id = Swift.Int + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias team_hyphen_slug = Swift.String /// The unique identifier of the role. /// /// - Remark: Generated from `#/components/parameters/role-id`. @@ -7767,6 +8382,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/personal-access-token-after`. public typealias personal_hyphen_access_hyphen_token_hyphen_after = Foundation.Date + /// The ID of the token + /// + /// - Remark: Generated from `#/components/parameters/personal-access-token-token-id`. + public typealias personal_hyphen_access_hyphen_token_hyphen_token_hyphen_id = [Swift.String] /// The unique identifier of the fine-grained personal access token. /// /// - Remark: Generated from `#/components/parameters/fine-grained-personal-access-token-id`. @@ -7802,6 +8421,34 @@ public enum Components { public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. public enum Responses { + public struct validation_failed_simple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.validation_hyphen_error_hyphen_simple) + /// 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.validation_hyphen_error_hyphen_simple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.validation_failed_simple.Body + /// Creates a new `validation_failed_simple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.validation_failed_simple.Body) { + self.body = body + } + } public struct not_found: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/not_found/content`. @frozen public enum Body: Sendable, Hashable { @@ -7998,10 +8645,10 @@ public enum Components { self.body = body } } - public struct internal_error: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. + public struct conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. case json(Components.Schemas.basic_hyphen_error) /// The associated value of the enum case if `self` is `.json`. /// @@ -8017,19 +8664,23 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. + public var body: Components.Responses.conflict.Body + /// Creates a new `conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { + public init(body: Components.Responses.conflict.Body) { self.body = body } } - public struct conflict: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content`. + public struct no_content: Sendable, Hashable { + /// Creates a new `no_content`. + public init() {} + } + 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/conflict/content/application\/json`. + /// - 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`. /// @@ -8045,19 +8696,15 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.conflict.Body - /// Creates a new `conflict`. + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.conflict.Body) { + public init(body: Components.Responses.internal_error.Body) { self.body = body } } - public struct no_content: Sendable, Hashable { - /// Creates a new `no_content`. - public init() {} - } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { @@ -8258,7 +8905,7 @@ public enum Operations { /// /// Gets information about an organization. /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). /// /// To see the full details about an organization, the authenticated user must be an organization owner. /// @@ -9194,20 +9841,28 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.pagination_hyphen_after? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/predicate_type`. + public var predicate_type: Swift.String? /// 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)." /// - 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)." + /// - predicate_type: Optional filter for fetching attestations with a given predicate type. public init( per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.pagination_hyphen_before? = nil, - after: Components.Parameters.pagination_hyphen_after? = nil + after: Components.Parameters.pagination_hyphen_after? = nil, + predicate_type: Swift.String? = nil ) { self.per_page = per_page self.before = before self.after = after + self.predicate_type = predicate_type } } public var query: Operations.orgs_sol_list_hyphen_attestations.Input.Query @@ -9322,21 +9977,27 @@ public enum Operations { public var bundle: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. public var repository_id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle_url`. + public var bundle_url: Swift.String? /// Creates a new `attestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repository_id: + /// - bundle_url: public init( bundle: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? = nil, - repository_id: Swift.Int? = nil + repository_id: Swift.Int? = nil, + bundle_url: Swift.String? = nil ) { self.bundle = bundle self.repository_id = repository_id + self.bundle_url = bundle_url } public enum CodingKeys: String, CodingKey { case bundle case repository_id + case bundle_url } } /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. @@ -14006,34 +14667,887 @@ public enum Operations { } } } - /// 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 + /// 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 + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. + /// + /// 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 `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.api_hyphen_insights_sol_get_hyphen_user_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 + ] + } + } + } + /// List app installations for an organization + /// + /// Lists all GitHub Apps in an organization. The installation count includes + /// all GitHub Apps installed on repositories in the organization. + /// + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/installations`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. + public enum orgs_sol_list_hyphen_app_hyphen_installations { + public static let id: Swift.String = "orgs/list-app-installations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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.orgs_sol_list_hyphen_app_hyphen_installations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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}/installations/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}/installations/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.orgs_sol_list_hyphen_app_hyphen_installations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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.orgs_sol_list_hyphen_app_hyphen_installations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Path, + query: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Query = .init(), + headers: Operations.orgs_sol_list_hyphen_app_hyphen_installations.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}/installations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/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.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. + public var installations: [Components.Schemas.installation] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - installations: + public init( + total_count: Swift.Int, + installations: [Components.Schemas.installation] + ) { + self.total_count = total_count + self.installations = installations + } + public enum CodingKeys: String, CodingKey { + case total_count + case installations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. + case json(Operations.orgs_sol_list_hyphen_app_hyphen_installations.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.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Headers = .init(), + body: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_list_hyphen_app_hyphen_installations.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.orgs_sol_list_hyphen_app_hyphen_installations.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 + ] + } + } + } + /// List pending organization invitations + /// + /// 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`, or `hiring_manager`. If the invitee is not a GitHub + /// member, the `login` field in the return hash will be `null`. + /// + /// - Remark: HTTP `GET /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. + public enum orgs_sol_list_hyphen_pending_hyphen_invitations { + public static let id: Swift.String = "orgs/list-pending-invitations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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}/invitations/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}/invitations/GET/query/page`. + public var page: Components.Parameters.page? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + @frozen public enum rolePayload: String, Codable, Hashable, Sendable { + case all = "all" + case admin = "admin" + case direct_member = "direct_member" + case billing_manager = "billing_manager" + case hiring_manager = "hiring_manager" + } + /// Filter invitations by their member role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + public var role: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.rolePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + @frozen public enum invitation_sourcePayload: String, Codable, Hashable, Sendable { + case all = "all" + case member = "member" + case scim = "scim" + } + /// Filter invitations by their invitation source. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + public var invitation_source: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.invitation_sourcePayload? + /// 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)." + /// - role: Filter invitations by their member role. + /// - invitation_source: Filter invitations by their invitation source. + public init( + per_page: Components.Parameters.per_hyphen_page? = nil, + page: Components.Parameters.page? = nil, + role: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.rolePayload? = nil, + invitation_source: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.invitation_sourcePayload? = nil + ) { + self.per_page = per_page + self.page = page + self.role = role + self.invitation_source = invitation_source + } + } + public var query: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Path, + query: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query = .init(), + headers: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.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}/invitations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.organization_hyphen_invitation]) + /// 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.organization_hyphen_invitation] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Headers = .init(), + body: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.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.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/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 + ] + } + } + } + /// Create an organization invitation + /// + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + /// + /// 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)." + /// + /// - Remark: HTTP `POST /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. + public enum orgs_sol_create_hyphen_invitation { + public static let id: Swift.String = "orgs/create-invitation" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.orgs_sol_create_hyphen_invitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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_create_hyphen_invitation.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. + public var invitee_id: Swift.Int? + /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. + public var email: Swift.String? + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + @frozen public enum rolePayload: String, Codable, Hashable, Sendable { + case admin = "admin" + case direct_member = "direct_member" + case billing_manager = "billing_manager" + case reinstate = "reinstate" + } + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + public var role: Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload.rolePayload? + /// Specify IDs for the teams you want to invite new members to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. + public var team_ids: [Swift.Int]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - invitee_id: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// - role: The role for the new member. + /// - team_ids: Specify IDs for the teams you want to invite new members to. + public init( + invitee_id: Swift.Int? = nil, + email: Swift.String? = nil, + role: Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload.rolePayload? = nil, + team_ids: [Swift.Int]? = nil + ) { + self.invitee_id = invitee_id + self.email = email + self.role = role + self.team_ids = team_ids + } + public enum CodingKeys: String, CodingKey { + case invitee_id + case email + case role + case team_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. + case json(Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload) + } + public var body: Operations.orgs_sol_create_hyphen_invitation.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.orgs_sol_create_hyphen_invitation.Input.Path, + headers: Operations.orgs_sol_create_hyphen_invitation.Input.Headers = .init(), + body: Operations.orgs_sol_create_hyphen_invitation.Input.Body? = nil + ) { + 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}/invitations/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.organization_hyphen_invitation) + /// 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.organization_hyphen_invitation { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_create_hyphen_invitation.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.orgs_sol_create_hyphen_invitation.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.orgs_sol_create_hyphen_invitation.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.orgs_sol_create_hyphen_invitation.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/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 + ] + } + } + } + /// Cancel an organization invitation + /// + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// + /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. + public enum orgs_sol_cancel_hyphen_invitation { + public static let id: Swift.String = "orgs/cancel-invitation" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// The unique identifier of the invitation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. + public var invitation_id: Components.Parameters.invitation_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - invitation_id: The unique identifier of the invitation. + public init( + org: Components.Parameters.org, + invitation_id: Components.Parameters.invitation_hyphen_id + ) { + self.org = org + self.invitation_id = invitation_id + } + } + public var path: Operations.orgs_sol_cancel_hyphen_invitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/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.orgs_sol_cancel_hyphen_invitation.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.orgs_sol_cancel_hyphen_invitation.Input.Path, + headers: Operations.orgs_sol_cancel_hyphen_invitation.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}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.orgs_sol_cancel_hyphen_invitation.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_cancel_hyphen_invitation.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/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 + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. /// - /// 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`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -14070,44 +15584,48 @@ public enum Operations { } } } - /// List app installations for an organization - /// - /// Lists all GitHub Apps in an organization. The installation count includes - /// all GitHub Apps installed on repositories in the organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// List organization invitation teams /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/installations`. - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. - public enum orgs_sol_list_hyphen_app_hyphen_installations { - public static let id: Swift.String = "orgs/list-app-installations" + /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. + public enum orgs_sol_list_hyphen_invitation_hyphen_teams { + public static let id: Swift.String = "orgs/list-invitation-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. public var org: Components.Parameters.org + /// The unique identifier of the invitation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. + public var invitation_id: Components.Parameters.invitation_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.org) { + /// - invitation_id: The unique identifier of the invitation. + public init( + org: Components.Parameters.org, + invitation_id: Components.Parameters.invitation_hyphen_id + ) { self.org = org + self.invitation_id = invitation_id } } - public var path: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query`. + public var path: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/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}/installations/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/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}/installations/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/page`. public var page: Components.Parameters.page? /// Creates a new `Query`. /// @@ -14122,19 +15640,19 @@ public enum Operations { self.page = page } } - public var query: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/header`. + public var query: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/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_list_hyphen_app_hyphen_installations.Input.Headers + public var headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -14142,9 +15660,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Path, - query: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Query = .init(), - headers: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input.Headers = .init() + path: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Path, + query: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Query = .init(), + headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Headers = .init() ) { self.path = path self.query = query @@ -14153,9 +15671,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers/Link`. public var Link: Components.Headers.link? /// Creates a new `Headers`. /// @@ -14166,39 +15684,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. + public var headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. - public var installations: [Components.Schemas.installation] - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_count: - /// - installations: - public init( - total_count: Swift.Int, - installations: [Components.Schemas.installation] - ) { - self.total_count = total_count - self.installations = installations - } - public enum CodingKeys: String, CodingKey { - case total_count - case installations - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. - case json(Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body.jsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.team]) /// 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.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body.jsonPayload { + public var json: [Components.Schemas.team] { get throws { switch self { case let .json(body): @@ -14208,15 +15703,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body + public var body: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Headers = .init(), - body: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok.Body + headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Headers = .init(), + body: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Body ) { self.headers = headers self.body = body @@ -14224,15 +15719,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok) + case ok(Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.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.orgs_sol_list_hyphen_app_hyphen_installations.Output.Ok { + public var ok: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok { get throws { switch self { case let .ok(response): @@ -14245,6 +15740,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/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. @@ -14276,138 +15794,66 @@ public enum Operations { } } } - /// List pending organization invitations + /// List issue types for an organization /// - /// 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`, or `hiring_manager`. If the invitee is not a GitHub - /// member, the `login` field in the return hash will be `null`. + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. - public enum orgs_sol_list_hyphen_pending_hyphen_invitations { - public static let id: Swift.String = "orgs/list-pending-invitations" + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + public enum orgs_sol_list_hyphen_issue_hyphen_types { + public static let id: Swift.String = "orgs/list-issue-types" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/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.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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}/invitations/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}/invitations/GET/query/page`. - public var page: Components.Parameters.page? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - @frozen public enum rolePayload: String, Codable, Hashable, Sendable { - case all = "all" - case admin = "admin" - case direct_member = "direct_member" - case billing_manager = "billing_manager" - case hiring_manager = "hiring_manager" - } - /// Filter invitations by their member role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - public var role: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.rolePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - @frozen public enum invitation_sourcePayload: String, Codable, Hashable, Sendable { - case all = "all" - case member = "member" - case scim = "scim" - } - /// Filter invitations by their invitation source. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - public var invitation_source: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.invitation_sourcePayload? - /// 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)." - /// - role: Filter invitations by their member role. - /// - invitation_source: Filter invitations by their invitation source. - public init( - per_page: Components.Parameters.per_hyphen_page? = nil, - page: Components.Parameters.page? = nil, - role: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.rolePayload? = nil, - invitation_source: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query.invitation_sourcePayload? = nil - ) { - self.per_page = per_page - self.page = page - self.role = role - self.invitation_source = invitation_source + /// 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 query: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/header`. + public var path: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/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_list_hyphen_pending_hyphen_invitations.Input.Headers + public var headers: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Path, - query: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Query = .init(), - headers: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Input.Headers = .init() + path: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Input.Path, + headers: Operations.orgs_sol_list_hyphen_issue_hyphen_types.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}/invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/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.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.organization_hyphen_invitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content/application\/json`. + case json([Components.Schemas.issue_hyphen_type]) /// 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.organization_hyphen_invitation] { + public var json: [Components.Schemas.issue_hyphen_type] { get throws { switch self { case let .json(body): @@ -14417,31 +15863,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Body + public var body: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Headers = .init(), - body: Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok) + case ok(Operations.orgs_sol_list_hyphen_issue_hyphen_types.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.orgs_sol_list_hyphen_pending_hyphen_invitations.Output.Ok { + public var ok: Operations.orgs_sol_list_hyphen_issue_hyphen_types.Output.Ok { get throws { switch self { case let .ok(response): @@ -14456,7 +15897,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -14508,23 +15949,25 @@ public enum Operations { } } } - /// Create an organization invitation + /// Create issue type for an organization /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + /// Create a new issue type for an organization. /// - /// 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)." + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// - Remark: HTTP `POST /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. - public enum orgs_sol_create_hyphen_invitation { - public static let id: Swift.String = "orgs/create-invitation" + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + public enum orgs_sol_create_hyphen_issue_hyphen_type { + public static let id: Swift.String = "orgs/create-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path/org`. public var org: Components.Parameters.org /// Creates a new `Path`. /// @@ -14534,85 +15977,25 @@ public enum Operations { self.org = org } } - public var path: Operations.orgs_sol_create_hyphen_invitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/header`. + public var path: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/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_create_hyphen_invitation.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + public var headers: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. - public var invitee_id: Swift.Int? - /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. - public var email: Swift.String? - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - @frozen public enum rolePayload: String, Codable, Hashable, Sendable { - case admin = "admin" - case direct_member = "direct_member" - case billing_manager = "billing_manager" - case reinstate = "reinstate" - } - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - public var role: Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload.rolePayload? - /// Specify IDs for the teams you want to invite new members to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. - public var team_ids: [Swift.Int]? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - invitee_id: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - role: The role for the new member. - /// - team_ids: Specify IDs for the teams you want to invite new members to. - public init( - invitee_id: Swift.Int? = nil, - email: Swift.String? = nil, - role: Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload.rolePayload? = nil, - team_ids: [Swift.Int]? = nil - ) { - self.invitee_id = invitee_id - self.email = email - self.role = role - self.team_ids = team_ids - } - public enum CodingKeys: String, CodingKey { - case invitee_id - case email - case role - case team_ids - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. - case json(Operations.orgs_sol_create_hyphen_invitation.Input.Body.jsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody/content/application\/json`. + case json(Components.Schemas.organization_hyphen_create_hyphen_issue_hyphen_type) } - public var body: Operations.orgs_sol_create_hyphen_invitation.Input.Body? + public var body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -14620,9 +16003,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.orgs_sol_create_hyphen_invitation.Input.Path, - headers: Operations.orgs_sol_create_hyphen_invitation.Input.Headers = .init(), - body: Operations.orgs_sol_create_hyphen_invitation.Input.Body? = nil + path: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Headers = .init(), + body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Input.Body ) { self.path = path self.headers = headers @@ -14630,16 +16013,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. - case json(Components.Schemas.organization_hyphen_invitation) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content/application\/json`. + case json(Components.Schemas.issue_hyphen_type) /// 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.organization_hyphen_invitation { + public var json: Components.Schemas.issue_hyphen_type { get throws { switch self { case let .json(body): @@ -14649,79 +16032,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.orgs_sol_create_hyphen_invitation.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.orgs_sol_create_hyphen_invitation.Output.Created.Body) { + public init(body: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.orgs_sol_create_hyphen_invitation.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.orgs_sol_create_hyphen_invitation.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.orgs_sol_create_hyphen_issue_hyphen_type.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/404`. /// - /// 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: `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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.validation_failed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/422`. /// - /// 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: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed_simple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.not_found { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed_simple { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -14758,112 +16141,125 @@ public enum Operations { } } } - /// Cancel an organization invitation + /// Update issue type for an organization /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Updates an issue type for an organization. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. - public enum orgs_sol_cancel_hyphen_invitation { - public static let id: Swift.String = "orgs/cancel-invitation" + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + public enum orgs_sol_update_hyphen_issue_hyphen_type { + public static let id: Swift.String = "orgs/update-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/org`. public var org: Components.Parameters.org - /// The unique identifier of the invitation. + /// The unique identifier of the issue type. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. - public var invitation_id: Components.Parameters.invitation_hyphen_id + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/issue_type_id`. + public var issue_type_id: Components.Parameters.issue_hyphen_type_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitation_id: The unique identifier of the invitation. + /// - issue_type_id: The unique identifier of the issue type. public init( org: Components.Parameters.org, - invitation_id: Components.Parameters.invitation_hyphen_id + issue_type_id: Components.Parameters.issue_hyphen_type_hyphen_id ) { self.org = org - self.invitation_id = invitation_id + self.issue_type_id = issue_type_id } } - public var path: Operations.orgs_sol_cancel_hyphen_invitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/header`. + public var path: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/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_cancel_hyphen_invitation.Input.Headers + public var headers: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.organization_hyphen_update_hyphen_issue_hyphen_type) + } + public var body: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.orgs_sol_cancel_hyphen_invitation.Input.Path, - headers: Operations.orgs_sol_cancel_hyphen_invitation.Input.Headers = .init() + path: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Headers = .init(), + body: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Input.Body ) { self.path = path self.headers = headers + 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}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.orgs_sol_cancel_hyphen_invitation.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_cancel_hyphen_invitation.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}/issue-types/{issue_type_id}/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.issue_hyphen_type) + /// 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.issue_hyphen_type { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.orgs_sol_update_hyphen_issue_hyphen_type.Output.Ok.Body) { + self.body = body + } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/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.orgs_sol_update_hyphen_issue_hyphen_type.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.orgs_sol_update_hyphen_issue_hyphen_type.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 ) } @@ -14871,7 +16267,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -14892,6 +16288,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed_simple) + /// 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_simple { + 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. @@ -14923,157 +16342,115 @@ public enum Operations { } } } - /// List organization invitation teams + /// Delete issue type for an organization /// - /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + /// Deletes an issue type for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. - public enum orgs_sol_list_hyphen_invitation_hyphen_teams { - public static let id: Swift.String = "orgs/list-invitation-teams" + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + public enum orgs_sol_delete_hyphen_issue_hyphen_type { + public static let id: Swift.String = "orgs/delete-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/org`. public var org: Components.Parameters.org - /// The unique identifier of the invitation. + /// The unique identifier of the issue type. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. - public var invitation_id: Components.Parameters.invitation_hyphen_id + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/issue_type_id`. + public var issue_type_id: Components.Parameters.issue_hyphen_type_hyphen_id /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitation_id: The unique identifier of the invitation. + /// - issue_type_id: The unique identifier of the issue type. public init( org: Components.Parameters.org, - invitation_id: Components.Parameters.invitation_hyphen_id + issue_type_id: Components.Parameters.issue_hyphen_type_hyphen_id ) { self.org = org - self.invitation_id = invitation_id - } - } - public var path: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/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}/invitations/{invitation_id}/teams/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}/invitations/{invitation_id}/teams/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 + self.issue_type_id = issue_type_id } } - public var query: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/header`. + public var path: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/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_list_hyphen_invitation_hyphen_teams.Input.Headers + public var headers: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Path, - query: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Query = .init(), - headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Input.Headers = .init() + path: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.Input.Path, + headers: Operations.orgs_sol_delete_hyphen_issue_hyphen_type.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}/invitations/{invitation_id}/teams/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/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.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. - case json([Components.Schemas.team]) - /// 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.team] { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.orgs_sol_delete_hyphen_issue_hyphen_type.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_delete_hyphen_issue_hyphen_type.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Headers = .init(), - body: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed_simple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.orgs_sol_list_hyphen_invitation_hyphen_teams.Output.Ok { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed_simple { get throws { switch self { - case let .ok(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "unprocessableContent", response: self ) } @@ -15081,7 +16458,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -18443,6 +19820,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/last_used_after`. public var last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? + /// The ID of the token + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/token_id`. + public var token_id: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_token_hyphen_id? /// Creates a new `Query`. /// /// - Parameters: @@ -18455,6 +19836,7 @@ public enum Operations { /// - permission: The permission to use to filter the results. /// - last_used_before: Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - last_used_after: Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - token_id: The ID of the token public init( per_page: Components.Parameters.per_hyphen_page? = nil, page: Components.Parameters.page? = nil, @@ -18464,7 +19846,8 @@ public enum Operations { repository: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_repository? = nil, permission: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_permission? = nil, last_used_before: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_before? = nil, - last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? = nil + last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? = nil, + token_id: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_token_hyphen_id? = nil ) { self.per_page = per_page self.page = page @@ -18475,6 +19858,7 @@ public enum Operations { self.permission = permission self.last_used_before = last_used_before self.last_used_after = last_used_after + self.token_id = token_id } } public var query: Operations.orgs_sol_list_hyphen_pat_hyphen_grant_hyphen_requests.Input.Query @@ -19530,6 +20914,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/last_used_after`. public var last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? + /// The ID of the token + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/token_id`. + public var token_id: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_token_hyphen_id? /// Creates a new `Query`. /// /// - Parameters: @@ -19542,6 +20930,7 @@ public enum Operations { /// - permission: The permission to use to filter the results. /// - last_used_before: Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - last_used_after: Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - token_id: The ID of the token public init( per_page: Components.Parameters.per_hyphen_page? = nil, page: Components.Parameters.page? = nil, @@ -19551,7 +20940,8 @@ public enum Operations { repository: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_repository? = nil, permission: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_permission? = nil, last_used_before: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_before? = nil, - last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? = nil + last_used_after: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_after? = nil, + token_id: Components.Parameters.personal_hyphen_access_hyphen_token_hyphen_token_hyphen_id? = nil ) { self.per_page = per_page self.page = page @@ -19562,6 +20952,7 @@ public enum Operations { self.permission = permission self.last_used_before = last_used_before self.last_used_after = last_used_after + self.token_id = token_id } } public var query: Operations.orgs_sol_list_hyphen_pat_hyphen_grants.Input.Query @@ -20707,6 +22098,10 @@ public enum Operations { /// /// Creates new or updates existing custom properties defined for an organization in a batch. /// + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. @@ -21114,142 +22509,44 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/org`. - public var org: Components.Parameters.org - /// 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 - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not 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 - ) { - self.org = org - self.custom_property_name = custom_property_name - } - } - public var path: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/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_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// The type of the value for the property - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/value_type`. - @frozen public enum value_typePayload: String, Codable, Hashable, Sendable { - case string = "string" - case single_select = "single_select" - case multi_select = "multi_select" - case true_false = "true_false" - } - /// The type of the value for the property - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/value_type`. - public var value_type: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body.jsonPayload.value_typePayload - /// Whether the property is required. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/required`. - public var required: Swift.Bool? - /// Default value of the property - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/default_value`. - @frozen public enum default_valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/default_value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/default_value/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - 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 func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// Default value of the property - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/default_value`. - public var default_value: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body.jsonPayload.default_valuePayload? - /// Short description of the property - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/description`. - public var description: Swift.String? - /// An ordered list of the allowed values of the property. - /// The property can have up to 200 allowed values. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/json/allowed_values`. - public var allowed_values: [Swift.String]? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - value_type: The type of the value for the property - /// - required: Whether the property is required. - /// - default_value: Default value of the property - /// - description: Short description of the property - /// - allowed_values: An ordered list of the allowed values of the property. - public init( - value_type: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body.jsonPayload.value_typePayload, - required: Swift.Bool? = nil, - default_value: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body.jsonPayload.default_valuePayload? = nil, - description: Swift.String? = nil, - allowed_values: [Swift.String]? = nil - ) { - self.value_type = value_type - self.required = required - self.default_value = default_value - self.description = description - self.allowed_values = allowed_values - } - public enum CodingKeys: String, CodingKey { - case value_type - case required - case default_value - case description - case allowed_values - } + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/org`. + public var org: Components.Parameters.org + /// 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 + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not 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 + ) { + self.org = org + self.custom_property_name = custom_property_name + } + } + public var path: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/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_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/content/application\/json`. - case json(Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body.jsonPayload) + case json(Components.Schemas.custom_hyphen_property_hyphen_set_hyphen_payload) } public var body: Operations.orgs_sol_create_hyphen_or_hyphen_update_hyphen_custom_hyphen_property.Input.Body /// Creates a new `Input`. @@ -22313,93 +23610,382 @@ public enum Operations { public var org: Components.Parameters.org /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/username`. - public var username: Components.Parameters.username - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/username`. + public var username: Components.Parameters.username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.org, + username: Components.Parameters.username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/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_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path, + headers: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.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}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.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_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/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 + ) + } + } + } + /// 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 + ] + } + } + } + /// Remove public organization membership for the authenticated user + /// + /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. + public enum orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user { + public static let id: Swift.String = "orgs/remove-public-membership-for-authenticated-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/org`. + public var org: Components.Parameters.org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/username`. + public var username: Components.Parameters.username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.org, + username: Components.Parameters.username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.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}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.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_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.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) + } + } + /// Get organization ruleset history + /// + /// Get the history of an organization ruleset. + /// + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + public enum orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history { + public static let id: Swift.String = "orgs/get-org-ruleset-history" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the ruleset. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/ruleset_id`. + public var ruleset_id: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - ruleset_id: The ID of the ruleset. + public init( + org: Components.Parameters.org, + ruleset_id: Swift.Int + ) { + self.org = org + self.ruleset_id = ruleset_id + } + } + public var path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/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}/rulesets/{ruleset_id}/history/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}/rulesets/{ruleset_id}/history/GET/query/page`. + public var page: Components.Parameters.page? + /// Creates a new `Query`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - 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( - org: Components.Parameters.org, - username: Components.Parameters.username + per_page: Components.Parameters.per_hyphen_page? = nil, + page: Components.Parameters.page? = nil ) { - self.org = org - self.username = username + self.per_page = per_page + self.page = page } } - public var path: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/header`. + public var query: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/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_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Headers + public var headers: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path, - headers: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Headers = .init() + path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Path, + query: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Input.Query = .init(), + headers: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.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() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ruleset_hyphen_version]) + /// 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.ruleset_hyphen_version] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output.NoContent) - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.orgs_sol_set_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_history.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } - /// Forbidden + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// 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 `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.forbidden { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { get throws { switch self { - case let .forbidden(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/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 ) } @@ -22436,70 +24022,164 @@ public enum Operations { } } } - /// Remove public organization membership for the authenticated user + /// Get organization ruleset version /// - /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. + /// Get a version of an organization ruleset. /// - /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. - public enum orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user { - public static let id: Swift.String = "orgs/remove-public-membership-for-authenticated-user" + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + public enum orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version { + public static let id: Swift.String = "orgs/get-org-ruleset-version" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/org`. public var org: Components.Parameters.org - /// The handle for the GitHub user account. + /// The ID of the ruleset. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/username`. - public var username: Components.Parameters.username + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/ruleset_id`. + public var ruleset_id: Swift.Int + /// The ID of the version + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/version_id`. + public var version_id: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - ruleset_id: The ID of the ruleset. + /// - version_id: The ID of the version public init( org: Components.Parameters.org, - username: Components.Parameters.username + ruleset_id: Swift.Int, + version_id: Swift.Int ) { self.org = org - self.username = username + self.ruleset_id = ruleset_id + self.version_id = version_id } } - public var path: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path + public var path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_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.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Input.Path) { + /// - headers: + public init( + path: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Input.Path, + headers: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.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() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state) + /// 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.ruleset_hyphen_version_hyphen_with_hyphen_state { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output.NoContent) - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.orgs_sol_remove_hyphen_public_hyphen_membership_hyphen_for_hyphen_authenticated_hyphen_user.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.orgs_sol_get_hyphen_org_hyphen_ruleset_hyphen_version.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/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 + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/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 ) } @@ -22510,14 +24190,36 @@ public enum Operations { /// 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 + ] + } + } } /// List security manager teams /// - /// Lists teams that are security managers for 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 administrator or security manager for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `GET /orgs/{org}/security-managers`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. @@ -22649,11 +24351,8 @@ public enum Operations { } /// Add a security manager team /// - /// Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. @@ -22728,11 +24427,8 @@ public enum Operations { } /// Remove a security manager team /// - /// Removes the security manager role from a team for 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) team from an organization." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. From 1cb0acbd5ee6b76d40b9d07c76679a661259a412 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:47:27 +0000 Subject: [PATCH 16/37] Commit via running ake Sources/packages --- Sources/packages/Types.swift | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index d3603767eed..fa6c479a873 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -1219,6 +1219,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -1341,6 +1363,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -1348,6 +1371,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -1355,6 +1379,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -1363,6 +1388,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection From 52c77ac1c12fde69ce594e83784c8aa29b323b0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:47:50 +0000 Subject: [PATCH 17/37] Commit via running ake Sources/projects --- Sources/projects/Client.swift | 125 +++++-- Sources/projects/Types.swift | 600 ++++++++++++++++++++++------------ 2 files changed, 500 insertions(+), 225 deletions(-) diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index d166b46d7b1..4ddea48be79 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -40,10 +40,13 @@ public struct Client: APIProtocol { } /// List organization projects /// - /// Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_org(_ input: Operations.projects_sol_list_hyphen_for_hyphen_org.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_org.Output { try await client.send( input: input, @@ -155,10 +158,13 @@ public struct Client: APIProtocol { } /// Create an organization project /// - /// Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_org(_ input: Operations.projects_sol_create_hyphen_for_hyphen_org.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_org.Output { try await client.send( input: input, @@ -338,10 +344,13 @@ public struct Client: APIProtocol { } /// Get a project card /// - /// Gets information about a project card. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. + @available(*, deprecated) public func projects_sol_get_hyphen_card(_ input: Operations.projects_sol_get_hyphen_card.Input) async throws -> Operations.projects_sol_get_hyphen_card.Output { try await client.send( input: input, @@ -470,10 +479,13 @@ public struct Client: APIProtocol { } /// Update an existing project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. + @available(*, deprecated) public func projects_sol_update_hyphen_card(_ input: Operations.projects_sol_update_hyphen_card.Input) async throws -> Operations.projects_sol_update_hyphen_card.Output { try await client.send( input: input, @@ -635,10 +647,13 @@ public struct Client: APIProtocol { } /// Delete a project card /// - /// Deletes a project card + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. + @available(*, deprecated) public func projects_sol_delete_hyphen_card(_ input: Operations.projects_sol_delete_hyphen_card.Input) async throws -> Operations.projects_sol_delete_hyphen_card.Output { try await client.send( input: input, @@ -747,10 +762,13 @@ public struct Client: APIProtocol { } /// Move a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. + @available(*, deprecated) public func projects_sol_move_hyphen_card(_ input: Operations.projects_sol_move_hyphen_card.Input) async throws -> Operations.projects_sol_move_hyphen_card.Output { try await client.send( input: input, @@ -910,10 +928,13 @@ public struct Client: APIProtocol { } /// Get a project column /// - /// Gets information about a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. + @available(*, deprecated) public func projects_sol_get_hyphen_column(_ input: Operations.projects_sol_get_hyphen_column.Input) async throws -> Operations.projects_sol_get_hyphen_column.Output { try await client.send( input: input, @@ -1042,10 +1063,13 @@ public struct Client: APIProtocol { } /// Update an existing project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. + @available(*, deprecated) public func projects_sol_update_hyphen_column(_ input: Operations.projects_sol_update_hyphen_column.Input) async throws -> Operations.projects_sol_update_hyphen_column.Output { try await client.send( input: input, @@ -1161,10 +1185,13 @@ public struct Client: APIProtocol { } /// Delete a project column /// - /// Deletes a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. + @available(*, deprecated) public func projects_sol_delete_hyphen_column(_ input: Operations.projects_sol_delete_hyphen_column.Input) async throws -> Operations.projects_sol_delete_hyphen_column.Output { try await client.send( input: input, @@ -1251,10 +1278,13 @@ public struct Client: APIProtocol { } /// List project cards /// - /// Lists the project cards in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. + @available(*, deprecated) public func projects_sol_list_hyphen_cards(_ input: Operations.projects_sol_list_hyphen_cards.Input) async throws -> Operations.projects_sol_list_hyphen_cards.Output { try await client.send( input: input, @@ -1390,10 +1420,13 @@ public struct Client: APIProtocol { } /// Create a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. + @available(*, deprecated) public func projects_sol_create_hyphen_card(_ input: Operations.projects_sol_create_hyphen_card.Input) async throws -> Operations.projects_sol_create_hyphen_card.Output { try await client.send( input: input, @@ -1553,10 +1586,13 @@ public struct Client: APIProtocol { } /// Move a project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. + @available(*, deprecated) public func projects_sol_move_hyphen_column(_ input: Operations.projects_sol_move_hyphen_column.Input) async throws -> Operations.projects_sol_move_hyphen_column.Output { try await client.send( input: input, @@ -1694,10 +1730,13 @@ public struct Client: APIProtocol { } /// Get a project /// - /// Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. + @available(*, deprecated) public func projects_sol_get(_ input: Operations.projects_sol_get.Input) async throws -> Operations.projects_sol_get.Output { try await client.send( input: input, @@ -1804,10 +1843,13 @@ public struct Client: APIProtocol { } /// Update a project /// - /// Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. + @available(*, deprecated) public func projects_sol_update(_ input: Operations.projects_sol_update.Input) async throws -> Operations.projects_sol_update.Output { try await client.send( input: input, @@ -1971,10 +2013,13 @@ public struct Client: APIProtocol { } /// Delete a project /// - /// Deletes a project board. Returns a `404 Not Found` status if projects are disabled. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. + @available(*, deprecated) public func projects_sol_delete(_ input: Operations.projects_sol_delete.Input) async throws -> Operations.projects_sol_delete.Output { try await client.send( input: input, @@ -2105,10 +2150,13 @@ public struct Client: APIProtocol { } /// List project collaborators /// - /// Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. + @available(*, deprecated) public func projects_sol_list_hyphen_collaborators(_ input: Operations.projects_sol_list_hyphen_collaborators.Input) async throws -> Operations.projects_sol_list_hyphen_collaborators.Output { try await client.send( input: input, @@ -2288,10 +2336,13 @@ public struct Client: APIProtocol { } /// Add project collaborator /// - /// Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. + @available(*, deprecated) public func projects_sol_add_hyphen_collaborator(_ input: Operations.projects_sol_add_hyphen_collaborator.Input) async throws -> Operations.projects_sol_add_hyphen_collaborator.Output { try await client.send( input: input, @@ -2434,10 +2485,13 @@ public struct Client: APIProtocol { } /// Remove user as a collaborator /// - /// Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. + @available(*, deprecated) public func projects_sol_remove_hyphen_collaborator(_ input: Operations.projects_sol_remove_hyphen_collaborator.Input) async throws -> Operations.projects_sol_remove_hyphen_collaborator.Output { try await client.send( input: input, @@ -2569,10 +2623,13 @@ public struct Client: APIProtocol { } /// Get project permission for a user /// - /// Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. + @available(*, deprecated) public func projects_sol_get_hyphen_permission_hyphen_for_hyphen_user(_ input: Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Input) async throws -> Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Output { try await client.send( input: input, @@ -2724,10 +2781,13 @@ public struct Client: APIProtocol { } /// List project columns /// - /// Lists the project columns in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. + @available(*, deprecated) public func projects_sol_list_hyphen_columns(_ input: Operations.projects_sol_list_hyphen_columns.Input) async throws -> Operations.projects_sol_list_hyphen_columns.Output { try await client.send( input: input, @@ -2856,10 +2916,13 @@ public struct Client: APIProtocol { } /// Create a project column /// - /// Creates a new project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. + @available(*, deprecated) public func projects_sol_create_hyphen_column(_ input: Operations.projects_sol_create_hyphen_column.Input) async throws -> Operations.projects_sol_create_hyphen_column.Output { try await client.send( input: input, @@ -2997,10 +3060,13 @@ public struct Client: APIProtocol { } /// List repository projects /// - /// Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_repo(_ input: Operations.projects_sol_list_hyphen_for_hyphen_repo.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_repo.Output { try await client.send( input: input, @@ -3201,10 +3267,13 @@ public struct Client: APIProtocol { } /// Create a repository project /// - /// Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_repo(_ input: Operations.projects_sol_create_hyphen_for_hyphen_repo.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_repo.Output { try await client.send( input: input, @@ -3385,10 +3454,13 @@ public struct Client: APIProtocol { } /// Create a user project /// - /// Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /user/projects`. /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Output { try await client.send( input: input, @@ -3524,10 +3596,13 @@ public struct Client: APIProtocol { } /// List user projects /// - /// Lists projects for a user. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /users/{username}/projects`. /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_user(_ input: Operations.projects_sol_list_hyphen_for_hyphen_user.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_user.Output { try await client.send( input: input, diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index aa7bc1787d7..fd72276c2f5 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -13,178 +13,253 @@ import struct Foundation.Date public protocol APIProtocol: Sendable { /// List organization projects /// - /// Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. + @available(*, deprecated) func projects_sol_list_hyphen_for_hyphen_org(_ input: Operations.projects_sol_list_hyphen_for_hyphen_org.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_org.Output /// Create an organization project /// - /// Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. + @available(*, deprecated) func projects_sol_create_hyphen_for_hyphen_org(_ input: Operations.projects_sol_create_hyphen_for_hyphen_org.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_org.Output /// Get a project card /// - /// Gets information about a project card. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. + @available(*, deprecated) func projects_sol_get_hyphen_card(_ input: Operations.projects_sol_get_hyphen_card.Input) async throws -> Operations.projects_sol_get_hyphen_card.Output /// Update an existing project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. + @available(*, deprecated) func projects_sol_update_hyphen_card(_ input: Operations.projects_sol_update_hyphen_card.Input) async throws -> Operations.projects_sol_update_hyphen_card.Output /// Delete a project card /// - /// Deletes a project card + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. + @available(*, deprecated) func projects_sol_delete_hyphen_card(_ input: Operations.projects_sol_delete_hyphen_card.Input) async throws -> Operations.projects_sol_delete_hyphen_card.Output /// Move a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. + @available(*, deprecated) func projects_sol_move_hyphen_card(_ input: Operations.projects_sol_move_hyphen_card.Input) async throws -> Operations.projects_sol_move_hyphen_card.Output /// Get a project column /// - /// Gets information about a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. + @available(*, deprecated) func projects_sol_get_hyphen_column(_ input: Operations.projects_sol_get_hyphen_column.Input) async throws -> Operations.projects_sol_get_hyphen_column.Output /// Update an existing project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. + @available(*, deprecated) func projects_sol_update_hyphen_column(_ input: Operations.projects_sol_update_hyphen_column.Input) async throws -> Operations.projects_sol_update_hyphen_column.Output /// Delete a project column /// - /// Deletes a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. + @available(*, deprecated) func projects_sol_delete_hyphen_column(_ input: Operations.projects_sol_delete_hyphen_column.Input) async throws -> Operations.projects_sol_delete_hyphen_column.Output /// List project cards /// - /// Lists the project cards in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. + @available(*, deprecated) func projects_sol_list_hyphen_cards(_ input: Operations.projects_sol_list_hyphen_cards.Input) async throws -> Operations.projects_sol_list_hyphen_cards.Output /// Create a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. + @available(*, deprecated) func projects_sol_create_hyphen_card(_ input: Operations.projects_sol_create_hyphen_card.Input) async throws -> Operations.projects_sol_create_hyphen_card.Output /// Move a project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. + @available(*, deprecated) func projects_sol_move_hyphen_column(_ input: Operations.projects_sol_move_hyphen_column.Input) async throws -> Operations.projects_sol_move_hyphen_column.Output /// Get a project /// - /// Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. + @available(*, deprecated) func projects_sol_get(_ input: Operations.projects_sol_get.Input) async throws -> Operations.projects_sol_get.Output /// Update a project /// - /// Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. + @available(*, deprecated) func projects_sol_update(_ input: Operations.projects_sol_update.Input) async throws -> Operations.projects_sol_update.Output /// Delete a project /// - /// Deletes a project board. Returns a `404 Not Found` status if projects are disabled. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. + @available(*, deprecated) func projects_sol_delete(_ input: Operations.projects_sol_delete.Input) async throws -> Operations.projects_sol_delete.Output /// List project collaborators /// - /// Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. + @available(*, deprecated) func projects_sol_list_hyphen_collaborators(_ input: Operations.projects_sol_list_hyphen_collaborators.Input) async throws -> Operations.projects_sol_list_hyphen_collaborators.Output /// Add project collaborator /// - /// Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. + @available(*, deprecated) func projects_sol_add_hyphen_collaborator(_ input: Operations.projects_sol_add_hyphen_collaborator.Input) async throws -> Operations.projects_sol_add_hyphen_collaborator.Output /// Remove user as a collaborator /// - /// Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. + @available(*, deprecated) func projects_sol_remove_hyphen_collaborator(_ input: Operations.projects_sol_remove_hyphen_collaborator.Input) async throws -> Operations.projects_sol_remove_hyphen_collaborator.Output /// Get project permission for a user /// - /// Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. + @available(*, deprecated) func projects_sol_get_hyphen_permission_hyphen_for_hyphen_user(_ input: Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Input) async throws -> Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Output /// List project columns /// - /// Lists the project columns in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. + @available(*, deprecated) func projects_sol_list_hyphen_columns(_ input: Operations.projects_sol_list_hyphen_columns.Input) async throws -> Operations.projects_sol_list_hyphen_columns.Output /// Create a project column /// - /// Creates a new project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. + @available(*, deprecated) func projects_sol_create_hyphen_column(_ input: Operations.projects_sol_create_hyphen_column.Input) async throws -> Operations.projects_sol_create_hyphen_column.Output /// List repository projects /// - /// Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. + @available(*, deprecated) func projects_sol_list_hyphen_for_hyphen_repo(_ input: Operations.projects_sol_list_hyphen_for_hyphen_repo.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_repo.Output /// Create a repository project /// - /// Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. + @available(*, deprecated) func projects_sol_create_hyphen_for_hyphen_repo(_ input: Operations.projects_sol_create_hyphen_for_hyphen_repo.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_repo.Output /// Create a user project /// - /// Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /user/projects`. /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. + @available(*, deprecated) func projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user(_ input: Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input) async throws -> Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Output /// List user projects /// - /// Lists projects for a user. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /users/{username}/projects`. /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. + @available(*, deprecated) func projects_sol_list_hyphen_for_hyphen_user(_ input: Operations.projects_sol_list_hyphen_for_hyphen_user.Input) async throws -> Operations.projects_sol_list_hyphen_for_hyphen_user.Output } @@ -192,10 +267,13 @@ public protocol APIProtocol: Sendable { extension APIProtocol { /// List organization projects /// - /// Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_org( path: Operations.projects_sol_list_hyphen_for_hyphen_org.Input.Path, query: Operations.projects_sol_list_hyphen_for_hyphen_org.Input.Query = .init(), @@ -209,10 +287,13 @@ extension APIProtocol { } /// Create an organization project /// - /// Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_org( path: Operations.projects_sol_create_hyphen_for_hyphen_org.Input.Path, headers: Operations.projects_sol_create_hyphen_for_hyphen_org.Input.Headers = .init(), @@ -226,10 +307,13 @@ extension APIProtocol { } /// Get a project card /// - /// Gets information about a project card. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. + @available(*, deprecated) public func projects_sol_get_hyphen_card( path: Operations.projects_sol_get_hyphen_card.Input.Path, headers: Operations.projects_sol_get_hyphen_card.Input.Headers = .init() @@ -241,10 +325,13 @@ extension APIProtocol { } /// Update an existing project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. + @available(*, deprecated) public func projects_sol_update_hyphen_card( path: Operations.projects_sol_update_hyphen_card.Input.Path, headers: Operations.projects_sol_update_hyphen_card.Input.Headers = .init(), @@ -258,10 +345,13 @@ extension APIProtocol { } /// Delete a project card /// - /// Deletes a project card + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. + @available(*, deprecated) public func projects_sol_delete_hyphen_card( path: Operations.projects_sol_delete_hyphen_card.Input.Path, headers: Operations.projects_sol_delete_hyphen_card.Input.Headers = .init() @@ -273,10 +363,13 @@ extension APIProtocol { } /// Move a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. + @available(*, deprecated) public func projects_sol_move_hyphen_card( path: Operations.projects_sol_move_hyphen_card.Input.Path, headers: Operations.projects_sol_move_hyphen_card.Input.Headers = .init(), @@ -290,10 +383,13 @@ extension APIProtocol { } /// Get a project column /// - /// Gets information about a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. + @available(*, deprecated) public func projects_sol_get_hyphen_column( path: Operations.projects_sol_get_hyphen_column.Input.Path, headers: Operations.projects_sol_get_hyphen_column.Input.Headers = .init() @@ -305,10 +401,13 @@ extension APIProtocol { } /// Update an existing project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. + @available(*, deprecated) public func projects_sol_update_hyphen_column( path: Operations.projects_sol_update_hyphen_column.Input.Path, headers: Operations.projects_sol_update_hyphen_column.Input.Headers = .init(), @@ -322,10 +421,13 @@ extension APIProtocol { } /// Delete a project column /// - /// Deletes a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. + @available(*, deprecated) public func projects_sol_delete_hyphen_column( path: Operations.projects_sol_delete_hyphen_column.Input.Path, headers: Operations.projects_sol_delete_hyphen_column.Input.Headers = .init() @@ -337,10 +439,13 @@ extension APIProtocol { } /// List project cards /// - /// Lists the project cards in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. + @available(*, deprecated) public func projects_sol_list_hyphen_cards( path: Operations.projects_sol_list_hyphen_cards.Input.Path, query: Operations.projects_sol_list_hyphen_cards.Input.Query = .init(), @@ -354,10 +459,13 @@ extension APIProtocol { } /// Create a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. + @available(*, deprecated) public func projects_sol_create_hyphen_card( path: Operations.projects_sol_create_hyphen_card.Input.Path, headers: Operations.projects_sol_create_hyphen_card.Input.Headers = .init(), @@ -371,10 +479,13 @@ extension APIProtocol { } /// Move a project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. + @available(*, deprecated) public func projects_sol_move_hyphen_column( path: Operations.projects_sol_move_hyphen_column.Input.Path, headers: Operations.projects_sol_move_hyphen_column.Input.Headers = .init(), @@ -388,10 +499,13 @@ extension APIProtocol { } /// Get a project /// - /// Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. + @available(*, deprecated) public func projects_sol_get( path: Operations.projects_sol_get.Input.Path, headers: Operations.projects_sol_get.Input.Headers = .init() @@ -403,10 +517,13 @@ extension APIProtocol { } /// Update a project /// - /// Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. + @available(*, deprecated) public func projects_sol_update( path: Operations.projects_sol_update.Input.Path, headers: Operations.projects_sol_update.Input.Headers = .init(), @@ -420,10 +537,13 @@ extension APIProtocol { } /// Delete a project /// - /// Deletes a project board. Returns a `404 Not Found` status if projects are disabled. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. + @available(*, deprecated) public func projects_sol_delete( path: Operations.projects_sol_delete.Input.Path, headers: Operations.projects_sol_delete.Input.Headers = .init() @@ -435,10 +555,13 @@ extension APIProtocol { } /// List project collaborators /// - /// Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. + @available(*, deprecated) public func projects_sol_list_hyphen_collaborators( path: Operations.projects_sol_list_hyphen_collaborators.Input.Path, query: Operations.projects_sol_list_hyphen_collaborators.Input.Query = .init(), @@ -452,10 +575,13 @@ extension APIProtocol { } /// Add project collaborator /// - /// Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. + @available(*, deprecated) public func projects_sol_add_hyphen_collaborator( path: Operations.projects_sol_add_hyphen_collaborator.Input.Path, headers: Operations.projects_sol_add_hyphen_collaborator.Input.Headers = .init(), @@ -469,10 +595,13 @@ extension APIProtocol { } /// Remove user as a collaborator /// - /// Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. + @available(*, deprecated) public func projects_sol_remove_hyphen_collaborator( path: Operations.projects_sol_remove_hyphen_collaborator.Input.Path, headers: Operations.projects_sol_remove_hyphen_collaborator.Input.Headers = .init() @@ -484,10 +613,13 @@ extension APIProtocol { } /// Get project permission for a user /// - /// Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. + @available(*, deprecated) public func projects_sol_get_hyphen_permission_hyphen_for_hyphen_user( path: Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Input.Path, headers: Operations.projects_sol_get_hyphen_permission_hyphen_for_hyphen_user.Input.Headers = .init() @@ -499,10 +631,13 @@ extension APIProtocol { } /// List project columns /// - /// Lists the project columns in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. + @available(*, deprecated) public func projects_sol_list_hyphen_columns( path: Operations.projects_sol_list_hyphen_columns.Input.Path, query: Operations.projects_sol_list_hyphen_columns.Input.Query = .init(), @@ -516,10 +651,13 @@ extension APIProtocol { } /// Create a project column /// - /// Creates a new project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. + @available(*, deprecated) public func projects_sol_create_hyphen_column( path: Operations.projects_sol_create_hyphen_column.Input.Path, headers: Operations.projects_sol_create_hyphen_column.Input.Headers = .init(), @@ -533,10 +671,13 @@ extension APIProtocol { } /// List repository projects /// - /// Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_repo( path: Operations.projects_sol_list_hyphen_for_hyphen_repo.Input.Path, query: Operations.projects_sol_list_hyphen_for_hyphen_repo.Input.Query = .init(), @@ -550,10 +691,13 @@ extension APIProtocol { } /// Create a repository project /// - /// Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_repo( path: Operations.projects_sol_create_hyphen_for_hyphen_repo.Input.Path, headers: Operations.projects_sol_create_hyphen_for_hyphen_repo.Input.Headers = .init(), @@ -567,10 +711,13 @@ extension APIProtocol { } /// Create a user project /// - /// Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /user/projects`. /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. + @available(*, deprecated) public func projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user( headers: Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input.Headers = .init(), body: Operations.projects_sol_create_hyphen_for_hyphen_authenticated_hyphen_user.Input.Body @@ -582,10 +729,13 @@ extension APIProtocol { } /// List user projects /// - /// Lists projects for a user. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /users/{username}/projects`. /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. + @available(*, deprecated) public func projects_sol_list_hyphen_for_hyphen_user( path: Operations.projects_sol_list_hyphen_for_hyphen_user.Input.Path, query: Operations.projects_sol_list_hyphen_for_hyphen_user.Input.Query = .init(), @@ -826,6 +976,131 @@ public enum Components { case errors } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -971,131 +1246,6 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } /// Projects are a way to organize columns and cards of work. /// /// - Remark: Generated from `#/components/schemas/project`. @@ -1631,7 +1781,9 @@ public enum Components { public enum Operations { /// List organization projects /// - /// Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. @@ -1845,7 +1997,9 @@ public enum Operations { } /// Create an organization project /// - /// Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /orgs/{org}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. @@ -2128,7 +2282,9 @@ public enum Operations { } /// Get a project card /// - /// Gets information about a project card. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. @@ -2352,7 +2508,9 @@ public enum Operations { } /// Update an existing project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. @@ -2635,7 +2793,9 @@ public enum Operations { } /// Delete a project card /// - /// Deletes a project card + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. @@ -2892,7 +3052,9 @@ public enum Operations { } /// Move a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. @@ -3365,7 +3527,9 @@ public enum Operations { } /// Get a project column /// - /// Gets information about a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. @@ -3589,7 +3753,9 @@ public enum Operations { } /// Update an existing project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. @@ -3816,7 +3982,9 @@ public enum Operations { } /// Delete a project column /// - /// Deletes a project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. @@ -3993,7 +4161,9 @@ public enum Operations { } /// List project cards /// - /// Lists the project cards in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. @@ -4253,7 +4423,9 @@ public enum Operations { } /// Create a project card /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. @@ -4739,7 +4911,9 @@ public enum Operations { } /// Move a project column /// - /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. @@ -4997,7 +5171,9 @@ public enum Operations { } /// Get a project /// - /// Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. @@ -5198,7 +5374,9 @@ public enum Operations { } /// Update a project /// - /// Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PATCH /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. @@ -5598,7 +5776,9 @@ public enum Operations { } /// Delete a project /// - /// Deletes a project board. Returns a `404 Not Found` status if projects are disabled. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}`. /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. @@ -5878,7 +6058,9 @@ public enum Operations { } /// List project collaborators /// - /// Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. @@ -6184,7 +6366,9 @@ public enum Operations { } /// Add project collaborator /// - /// Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. @@ -6450,7 +6634,9 @@ public enum Operations { } /// Remove user as a collaborator /// - /// Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. @@ -6682,7 +6868,9 @@ public enum Operations { } /// Get project permission for a user /// - /// Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. @@ -6938,7 +7126,9 @@ public enum Operations { } /// List project columns /// - /// Lists the project columns in a project. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. @@ -7185,7 +7375,9 @@ public enum Operations { } /// Create a project column /// - /// Creates a new project column. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /projects/{project_id}/columns`. /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. @@ -7435,7 +7627,9 @@ public enum Operations { } /// List repository projects /// - /// Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. @@ -7750,7 +7944,9 @@ public enum Operations { } /// Create a repository project /// - /// Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. @@ -8042,7 +8238,9 @@ public enum Operations { } /// Create a user project /// - /// Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `POST /user/projects`. /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. @@ -8284,7 +8482,9 @@ public enum Operations { } /// List user projects /// - /// Lists projects for a user. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /users/{username}/projects`. /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. From 208e1f4c78c950ca7a31f710cfe06898e9deb790 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:48:13 +0000 Subject: [PATCH 18/37] Commit via running ake Sources/pulls --- Sources/pulls/Types.swift | 858 +++++++++++++++++++------------------- 1 file changed, 429 insertions(+), 429 deletions(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 76cf8e000c0..25009b84852 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -1270,6 +1270,131 @@ public enum Components { case errors } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -1415,131 +1540,6 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -2329,12 +2329,228 @@ public enum Components { case anonymous_access_enabled } } - /// Groups of organization members that gives permissions on specified repositories. + /// A collection of related issues and pull requests. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labels_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var node_id: Swift.String + /// The number of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum statePayload: String, Codable, Hashable, Sendable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.nullable_hyphen_milestone.statePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. + public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var open_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closed_issues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. + public var updated_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var due_on: Foundation.Date? + /// Creates a new `nullable_hyphen_milestone`. + /// + /// - Parameters: + /// - url: + /// - html_url: + /// - labels_url: + /// - id: + /// - node_id: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - open_issues: + /// - closed_issues: + /// - created_at: + /// - updated_at: + /// - closed_at: + /// - due_on: + public init( + url: Swift.String, + html_url: Swift.String, + labels_url: Swift.String, + id: Swift.Int, + node_id: Swift.String, + number: Swift.Int, + state: Components.Schemas.nullable_hyphen_milestone.statePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + open_issues: Swift.Int, + closed_issues: Swift.Int, + created_at: Foundation.Date, + updated_at: Foundation.Date, + closed_at: Foundation.Date? = nil, + due_on: Foundation.Date? = nil + ) { + self.url = url + self.html_url = html_url + self.labels_url = labels_url + self.id = id + self.node_id = node_id + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.open_issues = open_issues + self.closed_issues = closed_issues + self.created_at = created_at + self.updated_at = updated_at + self.closed_at = closed_at + self.due_on = due_on + } + public enum CodingKeys: String, CodingKey { + case url + case html_url + case labels_url + case id + case node_id + case number + case state + case title + case description + case creator + case open_issues + case closed_issues + case created_at + case updated_at + case closed_at + case due_on + } + } + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { + case COLLABORATOR = "COLLABORATOR" + case CONTRIBUTOR = "CONTRIBUTOR" + case FIRST_TIMER = "FIRST_TIMER" + case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" + case MANNEQUIN = "MANNEQUIN" + case MEMBER = "MEMBER" + case NONE = "NONE" + case OWNER = "OWNER" + } + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `reaction_hyphen_rollup`. + /// + /// - Parameters: + /// - url: + /// - total_count: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: + public init( + url: Swift.String, + total_count: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int + ) { + self.url = url + self.total_count = total_count + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket + } + public enum CodingKeys: String, CodingKey { + case url + case total_count + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket + } + } + /// An object without any properties. + /// + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct empty_hyphen_object: Codable, Hashable, Sendable { + /// Creates a new `empty_hyphen_object`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. public var id: Swift.Int /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. @@ -2498,296 +2714,80 @@ public enum Components { } } /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// A collection of related issues and pull requests. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone`. - public struct nullable_hyphen_milestone: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. - public var labels_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. - public var node_id: Swift.String - /// The number of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. - public var number: Swift.Int - /// The state of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - @frozen public enum statePayload: String, Codable, Hashable, Sendable { - case open = "open" - case closed = "closed" - } - /// The state of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. - public var state: Components.Schemas.nullable_hyphen_milestone.statePayload - /// The title of the milestone. - /// - /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. - public var creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. - public var open_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. - public var closed_issues: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. - public var updated_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. - public var closed_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. - public var due_on: Foundation.Date? - /// Creates a new `nullable_hyphen_milestone`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. /// /// - Parameters: - /// - url: - /// - html_url: - /// - labels_url: /// - id: /// - node_id: - /// - number: The number of the milestone. - /// - state: The state of the milestone. - /// - title: The title of the milestone. + /// - name: + /// - slug: /// - description: - /// - creator: - /// - open_issues: - /// - closed_issues: - /// - created_at: - /// - updated_at: - /// - closed_at: - /// - due_on: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: public init( - url: Swift.String, - html_url: Swift.String, - labels_url: Swift.String, id: Swift.Int, node_id: Swift.String, - number: Swift.Int, - state: Components.Schemas.nullable_hyphen_milestone.statePayload, - title: Swift.String, + name: Swift.String, + slug: Swift.String, description: Swift.String? = nil, - creator: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, - open_issues: Swift.Int, - closed_issues: Swift.Int, - created_at: Foundation.Date, - updated_at: Foundation.Date, - closed_at: Foundation.Date? = nil, - due_on: Foundation.Date? = nil + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil ) { - self.url = url - self.html_url = html_url - self.labels_url = labels_url self.id = id self.node_id = node_id - self.number = number - self.state = state - self.title = title + self.name = name + self.slug = slug self.description = description - self.creator = creator - self.open_issues = open_issues - self.closed_issues = closed_issues - self.created_at = created_at - self.updated_at = updated_at - self.closed_at = closed_at - self.due_on = due_on + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent } public enum CodingKeys: String, CodingKey { - case url - case html_url - case labels_url case id case node_id - case number - case state - case title + case name + case slug case description - case creator - case open_issues - case closed_issues - case created_at - case updated_at - case closed_at - case due_on - } - } - /// How the author is associated with the repository. - /// - /// - Remark: Generated from `#/components/schemas/author-association`. - @frozen public enum author_hyphen_association: String, Codable, Hashable, Sendable { - case COLLABORATOR = "COLLABORATOR" - case CONTRIBUTOR = "CONTRIBUTOR" - case FIRST_TIMER = "FIRST_TIMER" - case FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR" - case MANNEQUIN = "MANNEQUIN" - case MEMBER = "MEMBER" - case NONE = "NONE" - case OWNER = "OWNER" - } - /// - Remark: Generated from `#/components/schemas/reaction-rollup`. - public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. - public var _plus_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. - public var _hyphen_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. - public var laugh: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. - public var confused: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. - public var heart: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. - public var hooray: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. - public var eyes: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. - public var rocket: Swift.Int - /// Creates a new `reaction_hyphen_rollup`. - /// - /// - Parameters: - /// - url: - /// - total_count: - /// - _plus_1: - /// - _hyphen_1: - /// - laugh: - /// - confused: - /// - heart: - /// - hooray: - /// - eyes: - /// - rocket: - public init( - url: Swift.String, - total_count: Swift.Int, - _plus_1: Swift.Int, - _hyphen_1: Swift.Int, - laugh: Swift.Int, - confused: Swift.Int, - heart: Swift.Int, - hooray: Swift.Int, - eyes: Swift.Int, - rocket: Swift.Int - ) { - self.url = url - self.total_count = total_count - self._plus_1 = _plus_1 - self._hyphen_1 = _hyphen_1 - self.laugh = laugh - self.confused = confused - self.heart = heart - self.hooray = hooray - self.eyes = eyes - self.rocket = rocket - } - public enum CodingKeys: String, CodingKey { + case privacy + case notification_setting + case permission + case permissions case url - case total_count - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh - case confused - case heart - case hooray - case eyes - case rocket - } - } - /// An object without any properties. - /// - /// - Remark: Generated from `#/components/schemas/empty-object`. - public struct empty_hyphen_object: Codable, Hashable, Sendable { - /// Creates a new `empty_hyphen_object`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) + case html_url + case members_url + case repositories_url + case parent } } /// Groups of organization members that gives permissions on specified repositories. @@ -5281,34 +5281,6 @@ public enum Components { 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 { @@ -5366,6 +5338,34 @@ public enum Components { 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 unacceptable: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/unacceptable/content`. @frozen public enum Body: Sendable, Hashable { From b50e40b5d99a15364303b88211b8050b422f0e40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:48:36 +0000 Subject: [PATCH 19/37] Commit via running ake Sources/rate-limit --- Sources/rate-limit/Types.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/rate-limit/Types.swift b/Sources/rate-limit/Types.swift index 1d24c69e143..42bb0a4bbac 100644 --- a/Sources/rate-limit/Types.swift +++ b/Sources/rate-limit/Types.swift @@ -175,6 +175,8 @@ public enum Components { public var scim: Components.Schemas.rate_hyphen_limit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/dependency_snapshots`. public var dependency_snapshots: Components.Schemas.rate_hyphen_limit? + /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/code_scanning_autofix`. + public var code_scanning_autofix: Components.Schemas.rate_hyphen_limit? /// Creates a new `resourcesPayload`. /// /// - Parameters: @@ -188,6 +190,7 @@ public enum Components { /// - actions_runner_registration: /// - scim: /// - dependency_snapshots: + /// - code_scanning_autofix: public init( core: Components.Schemas.rate_hyphen_limit, graphql: Components.Schemas.rate_hyphen_limit? = nil, @@ -198,7 +201,8 @@ public enum Components { code_scanning_upload: Components.Schemas.rate_hyphen_limit? = nil, actions_runner_registration: Components.Schemas.rate_hyphen_limit? = nil, scim: Components.Schemas.rate_hyphen_limit? = nil, - dependency_snapshots: Components.Schemas.rate_hyphen_limit? = nil + dependency_snapshots: Components.Schemas.rate_hyphen_limit? = nil, + code_scanning_autofix: Components.Schemas.rate_hyphen_limit? = nil ) { self.core = core self.graphql = graphql @@ -210,6 +214,7 @@ public enum Components { self.actions_runner_registration = actions_runner_registration self.scim = scim self.dependency_snapshots = dependency_snapshots + self.code_scanning_autofix = code_scanning_autofix } public enum CodingKeys: String, CodingKey { case core @@ -222,6 +227,7 @@ public enum Components { case actions_runner_registration case scim case dependency_snapshots + case code_scanning_autofix } } /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources`. From a2de07110cebd8de99966acbe056c6136ccb5ee5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:48:59 +0000 Subject: [PATCH 20/37] Commit via running ake Sources/reactions --- Sources/reactions/Types.swift | 258 +++++++++++++++++----------------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index 358b85e7ee5..7d6e6d904be 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -766,6 +766,131 @@ public enum Components { case status } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -911,131 +1036,6 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } /// Reactions to conversations provide a way to help people express their feelings more simply and effectively. /// /// - Remark: Generated from `#/components/schemas/reaction`. @@ -1105,10 +1105,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias page = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias team_hyphen_slug = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -1125,6 +1121,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias org = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias team_hyphen_slug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. From 98b0017b13290b50a4bf7ccb06d345f16920b442 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:49:23 +0000 Subject: [PATCH 21/37] Commit via running ake Sources/repos --- Sources/repos/Client.swift | 272 +++- Sources/repos/Types.swift | 2532 +++++++++++++++++++++++++----------- 2 files changed, 2021 insertions(+), 783 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 77534a44a02..25e9f5513c6 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -1849,6 +1849,13 @@ public struct Client: APIProtocol { name: "after", value: input.query.after ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "predicate_type", + value: input.query.predicate_type + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2222,9 +2229,9 @@ public struct Client: APIProtocol { } ) } - /// Check if automated security fixes are enabled for a repository + /// Check if Dependabot security updates are enabled for a repository /// - /// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/get(repos/check-automated-security-fixes)`. @@ -2289,9 +2296,9 @@ public struct Client: APIProtocol { } ) } - /// Enable automated security fixes + /// Enable Dependabot security updates /// - /// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/put(repos/enable-automated-security-fixes)`. @@ -2330,9 +2337,9 @@ public struct Client: APIProtocol { } ) } - /// Disable automated security fixes + /// Disable Dependabot security updates /// - /// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/delete(repos/disable-automated-security-fixes)`. @@ -6195,8 +6202,8 @@ public struct Client: APIProtocol { /// To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal. /// /// This endpoint also: - /// - Cancels any outstanding invitations - /// - Unasigns the user from any issues + /// - Cancels any outstanding invitations sent by the collaborator + /// - Unassigns the user from any issues /// - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. /// - Unstars the repository /// - Updates access permissions to packages @@ -7353,7 +7360,7 @@ public struct Client: APIProtocol { } /// List pull requests associated with a commit /// - /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit. + /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit. /// /// To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. /// @@ -10428,7 +10435,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin or owner permissions to the repository to use this endpoint. /// - /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app). + /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules). /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// @@ -16957,6 +16964,241 @@ public struct Client: APIProtocol { } ) } + /// Get repository ruleset history + /// + /// Get the history of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)`. + public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output { + try await client.send( + input: input, + forOperation: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/rulesets/{}/history", + parameters: [ + input.path.owner, + input.path.repo, + input.path.ruleset_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 contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.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.ruleset_hyphen_version].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get repository ruleset version + /// + /// Get a version of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)`. + public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output { + try await client.send( + input: input, + forOperation: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/rulesets/{}/history/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.ruleset_id, + input.path.version_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.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.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.ruleset_hyphen_version_hyphen_with_hyphen_state.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get the weekly commit activity /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. @@ -19189,6 +19431,11 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.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.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Body let chosenContentType = try converter.bestContentType( @@ -19209,7 +19456,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 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.validation_failed.Body diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index b47cd7033f0..847c0fcb7af 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -179,23 +179,23 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/autolinks/{autolink_id}/delete(repos/delete-autolink)`. func repos_sol_delete_hyphen_autolink(_ input: Operations.repos_sol_delete_hyphen_autolink.Input) async throws -> Operations.repos_sol_delete_hyphen_autolink.Output - /// Check if automated security fixes are enabled for a repository + /// Check if Dependabot security updates are enabled for a repository /// - /// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/get(repos/check-automated-security-fixes)`. func repos_sol_check_hyphen_automated_hyphen_security_hyphen_fixes(_ input: Operations.repos_sol_check_hyphen_automated_hyphen_security_hyphen_fixes.Input) async throws -> Operations.repos_sol_check_hyphen_automated_hyphen_security_hyphen_fixes.Output - /// Enable automated security fixes + /// Enable Dependabot security updates /// - /// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/put(repos/enable-automated-security-fixes)`. func repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes(_ input: Operations.repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes.Input) async throws -> Operations.repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes.Output - /// Disable automated security fixes + /// Disable Dependabot security updates /// - /// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/delete(repos/disable-automated-security-fixes)`. @@ -602,8 +602,8 @@ public protocol APIProtocol: Sendable { /// To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal. /// /// This endpoint also: - /// - Cancels any outstanding invitations - /// - Unasigns the user from any issues + /// - Cancels any outstanding invitations sent by the collaborator + /// - Unassigns the user from any issues /// - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. /// - Unstars the repository /// - Updates access permissions to packages @@ -761,7 +761,7 @@ public protocol APIProtocol: Sendable { func repos_sol_create_hyphen_commit_hyphen_comment(_ input: Operations.repos_sol_create_hyphen_commit_hyphen_comment.Input) async throws -> Operations.repos_sol_create_hyphen_commit_hyphen_comment.Output /// List pull requests associated with a commit /// - /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit. + /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit. /// /// To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. /// @@ -1210,7 +1210,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin or owner permissions to the repository to use this endpoint. /// - /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app). + /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules). /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// @@ -1807,6 +1807,20 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)`. func repos_sol_delete_hyphen_repo_hyphen_ruleset(_ input: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input) async throws -> Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Output + /// Get repository ruleset history + /// + /// Get the history of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)`. + func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output + /// Get repository ruleset version + /// + /// Get a version of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)`. + func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version(_ input: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output /// Get the weekly commit activity /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. @@ -2436,9 +2450,9 @@ extension APIProtocol { headers: headers )) } - /// Check if automated security fixes are enabled for a repository + /// Check if Dependabot security updates are enabled for a repository /// - /// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/get(repos/check-automated-security-fixes)`. @@ -2451,18 +2465,18 @@ extension APIProtocol { headers: headers )) } - /// Enable automated security fixes + /// Enable Dependabot security updates /// - /// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/put(repos/enable-automated-security-fixes)`. public func repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes(path: Operations.repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes.Input.Path) async throws -> Operations.repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes.Output { try await repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes(Operations.repos_sol_enable_hyphen_automated_hyphen_security_hyphen_fixes.Input(path: path)) } - /// Disable automated security fixes + /// Disable Dependabot security updates /// - /// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/delete(repos/disable-automated-security-fixes)`. @@ -3213,8 +3227,8 @@ extension APIProtocol { /// To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal. /// /// This endpoint also: - /// - Cancels any outstanding invitations - /// - Unasigns the user from any issues + /// - Cancels any outstanding invitations sent by the collaborator + /// - Unassigns the user from any issues /// - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. /// - Unstars the repository /// - Updates access permissions to packages @@ -3462,7 +3476,7 @@ extension APIProtocol { } /// List pull requests associated with a commit /// - /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit. + /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit. /// /// To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. /// @@ -4161,7 +4175,7 @@ extension APIProtocol { /// /// The authenticated user must have admin or owner permissions to the repository to use this endpoint. /// - /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app). + /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules). /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// @@ -5344,6 +5358,38 @@ extension APIProtocol { headers: headers )) } + /// Get repository ruleset history + /// + /// Get the history of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)`. + public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history( + path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Path, + query: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Query = .init(), + headers: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Headers = .init() + ) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output { + try await repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history(Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get repository ruleset version + /// + /// Get a version of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)`. + public func repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version( + path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Path, + headers: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Headers = .init() + ) async throws -> Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output { + try await repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version(Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input( + path: path, + headers: headers + )) + } /// Get the weekly commit activity /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. @@ -6096,149 +6142,87 @@ public enum Components { case errors } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - 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. @@ -6258,7 +6242,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/integration/owner`. + public var owner: Components.Schemas.integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/integration/name`. @@ -6418,7 +6437,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -6563,7 +6582,7 @@ public enum Components { /// Unique identifier of the webhook delivery. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/id`. - public var id: Swift.Int + public var id: Swift.Int64 /// Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/guid`. @@ -6599,11 +6618,11 @@ public enum Components { /// The id of the GitHub App installation associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/installation_id`. - public var installation_id: Swift.Int? + public var installation_id: Swift.Int64? /// The id of the repository associated with this event. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/repository_id`. - public var repository_id: Swift.Int? + public var repository_id: Swift.Int64? /// Time when the webhook delivery was throttled. /// /// - Remark: Generated from `#/components/schemas/hook-delivery-item/throttled_at`. @@ -6624,7 +6643,7 @@ public enum Components { /// - repository_id: The id of the repository associated with this event. /// - throttled_at: Time when the webhook delivery was throttled. public init( - id: Swift.Int, + id: Swift.Int64, guid: Swift.String, delivered_at: Foundation.Date, redelivery: Swift.Bool, @@ -6633,8 +6652,8 @@ public enum Components { status_code: Swift.Int, event: Swift.String, action: Swift.String? = nil, - installation_id: Swift.Int? = nil, - repository_id: Swift.Int? = nil, + installation_id: Swift.Int64? = nil, + repository_id: Swift.Int64? = nil, throttled_at: Foundation.Date? = nil ) { self.id = id @@ -7082,6 +7101,151 @@ public enum Components { case response } } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -7914,251 +8078,6 @@ public enum Components { case html_url } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } /// A collection of related issues and pull requests. /// /// - Remark: Generated from `#/components/schemas/nullable-milestone`. @@ -8298,7 +8217,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. @@ -8458,7 +8412,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -8618,6 +8572,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -8740,6 +8716,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -8747,6 +8724,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -8754,6 +8732,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -8762,6 +8741,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -9398,6 +9378,251 @@ public enum Components { try decoder.ensureNoAdditionalProperties(knownKeys: []) } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// Custom property name and associated value /// /// - Remark: Generated from `#/components/schemas/custom-property-value`. @@ -11292,6 +11517,7 @@ public enum Components { /// 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. + /// For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. /// /// - Remark: Generated from `#/components/schemas/org-ruleset-conditions`. @frozen public enum org_hyphen_ruleset_hyphen_conditions: Codable, Hashable, Sendable { @@ -11730,6 +11956,24 @@ public enum Components { public var _type: Components.Schemas.repository_hyphen_rule_hyphen_pull_hyphen_request._typePayload /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters`. public struct parametersPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methodsPayload`. + @frozen public enum allowed_merge_methodsPayloadPayload: String, Codable, Hashable, Sendable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" + } + /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. + public typealias allowed_merge_methodsPayload = [Components.Schemas.repository_hyphen_rule_hyphen_pull_hyphen_request.parametersPayload.allowed_merge_methodsPayloadPayload] + /// Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. + public var allowed_merge_methods: Components.Schemas.repository_hyphen_rule_hyphen_pull_hyphen_request.parametersPayload.allowed_merge_methodsPayload? + /// Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. + public var automatic_copilot_code_review_enabled: Swift.Bool? /// New, reviewable commits pushed will dismiss previous pull request review approvals. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismiss_stale_reviews_on_push`. @@ -11753,18 +11997,24 @@ public enum Components { /// Creates a new `parametersPayload`. /// /// - Parameters: + /// - allowed_merge_methods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. + /// - automatic_copilot_code_review_enabled: Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. /// - dismiss_stale_reviews_on_push: New, reviewable commits pushed will dismiss previous pull request review approvals. /// - require_code_owner_review: Require an approving review in pull requests that modify files that have a designated code owner. /// - require_last_push_approval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. /// - required_approving_review_count: The number of approving reviews that are required before a pull request can be merged. /// - required_review_thread_resolution: All conversations on code must be resolved before a pull request can be merged. public init( + allowed_merge_methods: Components.Schemas.repository_hyphen_rule_hyphen_pull_hyphen_request.parametersPayload.allowed_merge_methodsPayload? = nil, + automatic_copilot_code_review_enabled: Swift.Bool? = nil, dismiss_stale_reviews_on_push: Swift.Bool, require_code_owner_review: Swift.Bool, require_last_push_approval: Swift.Bool, required_approving_review_count: Swift.Int, required_review_thread_resolution: Swift.Bool ) { + self.allowed_merge_methods = allowed_merge_methods + self.automatic_copilot_code_review_enabled = automatic_copilot_code_review_enabled self.dismiss_stale_reviews_on_push = dismiss_stale_reviews_on_push self.require_code_owner_review = require_code_owner_review self.require_last_push_approval = require_last_push_approval @@ -11772,6 +12022,8 @@ public enum Components { self.required_review_thread_resolution = required_review_thread_resolution } public enum CodingKeys: String, CodingKey { + case allowed_merge_methods + case automatic_copilot_code_review_enabled case dismiss_stale_reviews_on_push case require_code_owner_review case require_last_push_approval @@ -12317,6 +12569,190 @@ public enum Components { case parameters } } + /// Prevent commits that include changes in specified file and folder paths from being pushed to the commit graph. This includes absolute paths that contain file names. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction`. + public struct repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case file_path_restriction = "file_path_restriction" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/type`. + public var _type: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction._typePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. + public struct parametersPayload: Codable, Hashable, Sendable { + /// The file paths that are restricted from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters/restricted_file_paths`. + public var restricted_file_paths: [Swift.String] + /// Creates a new `parametersPayload`. + /// + /// - Parameters: + /// - restricted_file_paths: The file paths that are restricted from being pushed to the commit graph. + public init(restricted_file_paths: [Swift.String]) { + self.restricted_file_paths = restricted_file_paths + } + public enum CodingKeys: String, CodingKey { + case restricted_file_paths + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction/parameters`. + public var parameters: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction.parametersPayload? + /// Creates a new `repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction._typePayload, + parameters: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction.parametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits that include file paths that exceed the specified character limit from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length`. + public struct repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case max_file_path_length = "max_file_path_length" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/type`. + public var _type: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length._typePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. + public struct parametersPayload: Codable, Hashable, Sendable { + /// The maximum amount of characters allowed in file paths. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters/max_file_path_length`. + public var max_file_path_length: Swift.Int + /// Creates a new `parametersPayload`. + /// + /// - Parameters: + /// - max_file_path_length: The maximum amount of characters allowed in file paths. + public init(max_file_path_length: Swift.Int) { + self.max_file_path_length = max_file_path_length + } + public enum CodingKeys: String, CodingKey { + case max_file_path_length + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-path-length/parameters`. + public var parameters: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length.parametersPayload? + /// Creates a new `repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length._typePayload, + parameters: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length.parametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction`. + public struct repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case file_extension_restriction = "file_extension_restriction" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/type`. + public var _type: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction._typePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. + public struct parametersPayload: Codable, Hashable, Sendable { + /// The file extensions that are restricted from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters/restricted_file_extensions`. + public var restricted_file_extensions: [Swift.String] + /// Creates a new `parametersPayload`. + /// + /// - Parameters: + /// - restricted_file_extensions: The file extensions that are restricted from being pushed to the commit graph. + public init(restricted_file_extensions: [Swift.String]) { + self.restricted_file_extensions = restricted_file_extensions + } + public enum CodingKeys: String, CodingKey { + case restricted_file_extensions + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-file-extension-restriction/parameters`. + public var parameters: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction.parametersPayload? + /// Creates a new `repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction._typePayload, + parameters: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction.parametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } + /// Prevent commits with individual files that exceed the specified limit from being pushed to the commit graph. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size`. + public struct repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case max_file_size = "max_file_size" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/type`. + public var _type: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size._typePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. + public struct parametersPayload: Codable, Hashable, Sendable { + /// The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters/max_file_size`. + public var max_file_size: Swift.Int + /// Creates a new `parametersPayload`. + /// + /// - Parameters: + /// - max_file_size: The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + public init(max_file_size: Swift.Int) { + self.max_file_size = max_file_size + } + public enum CodingKeys: String, CodingKey { + case max_file_size + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-max-file-size/parameters`. + public var parameters: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size.parametersPayload? + /// Creates a new `repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size._typePayload, + parameters: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size.parametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } /// A workflow that must run for this rule to pass /// /// - Remark: Generated from `#/components/schemas/repository-rule-params-workflow-file-reference`. @@ -12554,206 +12990,14 @@ 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) - /// Prevent commits that include changes in specified file paths from being pushed to the commit graph. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case16`. - public struct Case16Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule/case16/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable { - case file_path_restriction = "file_path_restriction" - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case16/type`. - public var _type: Components.Schemas.repository_hyphen_rule.Case16Payload._typePayload - /// - Remark: Generated from `#/components/schemas/repository-rule/case16/parameters`. - public struct parametersPayload: Codable, Hashable, Sendable { - /// The file paths that are restricted from being pushed to the commit graph. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case16/parameters/restricted_file_paths`. - public var restricted_file_paths: [Swift.String] - /// Creates a new `parametersPayload`. - /// - /// - Parameters: - /// - restricted_file_paths: The file paths that are restricted from being pushed to the commit graph. - public init(restricted_file_paths: [Swift.String]) { - self.restricted_file_paths = restricted_file_paths - } - public enum CodingKeys: String, CodingKey { - case restricted_file_paths - } - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case16/parameters`. - public var parameters: Components.Schemas.repository_hyphen_rule.Case16Payload.parametersPayload? - /// Creates a new `Case16Payload`. - /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.repository_hyphen_rule.Case16Payload._typePayload, - parameters: Components.Schemas.repository_hyphen_rule.Case16Payload.parametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// 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) - /// Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. - /// + case repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction(Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction) /// - Remark: Generated from `#/components/schemas/repository-rule/case17`. - public struct Case17Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule/case17/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable { - case max_file_path_length = "max_file_path_length" - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case17/type`. - public var _type: Components.Schemas.repository_hyphen_rule.Case17Payload._typePayload - /// - Remark: Generated from `#/components/schemas/repository-rule/case17/parameters`. - public struct parametersPayload: Codable, Hashable, Sendable { - /// The maximum amount of characters allowed in file paths - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case17/parameters/max_file_path_length`. - public var max_file_path_length: Swift.Int - /// Creates a new `parametersPayload`. - /// - /// - Parameters: - /// - max_file_path_length: The maximum amount of characters allowed in file paths - public init(max_file_path_length: Swift.Int) { - self.max_file_path_length = max_file_path_length - } - public enum CodingKeys: String, CodingKey { - case max_file_path_length - } - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case17/parameters`. - public var parameters: Components.Schemas.repository_hyphen_rule.Case17Payload.parametersPayload? - /// Creates a new `Case17Payload`. - /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.repository_hyphen_rule.Case17Payload._typePayload, - parameters: Components.Schemas.repository_hyphen_rule.Case17Payload.parametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// 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) - /// Prevent commits that include files with specified file extensions from being pushed to the commit graph. - /// + case repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length(Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length) /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. - public struct Case18Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule/case18/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable { - case file_extension_restriction = "file_extension_restriction" - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case18/type`. - public var _type: Components.Schemas.repository_hyphen_rule.Case18Payload._typePayload - /// - Remark: Generated from `#/components/schemas/repository-rule/case18/parameters`. - public struct parametersPayload: Codable, Hashable, Sendable { - /// The file extensions that are restricted from being pushed to the commit graph. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case18/parameters/restricted_file_extensions`. - public var restricted_file_extensions: [Swift.String] - /// Creates a new `parametersPayload`. - /// - /// - Parameters: - /// - restricted_file_extensions: The file extensions that are restricted from being pushed to the commit graph. - public init(restricted_file_extensions: [Swift.String]) { - self.restricted_file_extensions = restricted_file_extensions - } - public enum CodingKeys: String, CodingKey { - case restricted_file_extensions - } - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case18/parameters`. - public var parameters: Components.Schemas.repository_hyphen_rule.Case18Payload.parametersPayload? - /// Creates a new `Case18Payload`. - /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.repository_hyphen_rule.Case18Payload._typePayload, - parameters: Components.Schemas.repository_hyphen_rule.Case18Payload.parametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// 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) - /// Prevent commits that exceed a specified file size limit from being pushed to the commit. - /// + case repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction(Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction) /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. - public struct Case19Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-rule/case19/type`. - @frozen public enum _typePayload: String, Codable, Hashable, Sendable { - case max_file_size = "max_file_size" - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case19/type`. - public var _type: Components.Schemas.repository_hyphen_rule.Case19Payload._typePayload - /// - Remark: Generated from `#/components/schemas/repository-rule/case19/parameters`. - public struct parametersPayload: Codable, Hashable, Sendable { - /// The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case19/parameters/max_file_size`. - public var max_file_size: Swift.Int - /// Creates a new `parametersPayload`. - /// - /// - Parameters: - /// - max_file_size: The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). - public init(max_file_size: Swift.Int) { - self.max_file_size = max_file_size - } - public enum CodingKeys: String, CodingKey { - case max_file_size - } - } - /// - Remark: Generated from `#/components/schemas/repository-rule/case19/parameters`. - public var parameters: Components.Schemas.repository_hyphen_rule.Case19Payload.parametersPayload? - /// Creates a new `Case19Payload`. - /// - /// - Parameters: - /// - _type: - /// - parameters: - public init( - _type: Components.Schemas.repository_hyphen_rule.Case19Payload._typePayload, - parameters: Components.Schemas.repository_hyphen_rule.Case19Payload.parametersPayload? = nil - ) { - self._type = _type - self.parameters = parameters - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case parameters - } - } - /// Prevent commits that exceed a specified file size limit from being pushed to the commit. - /// - /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. - case case19(Components.Schemas.repository_hyphen_rule.Case19Payload) + case repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size(Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size) /// - Remark: Generated from `#/components/schemas/repository-rule/case20`. case repository_hyphen_rule_hyphen_workflows(Components.Schemas.repository_hyphen_rule_hyphen_workflows) /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. @@ -12851,25 +13095,25 @@ public enum Components { errors.append(error) } do { - self = .case16(try .init(from: decoder)) + self = .repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction(try .init(from: decoder)) return } catch { errors.append(error) } do { - self = .case17(try .init(from: decoder)) + self = .repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length(try .init(from: decoder)) return } catch { errors.append(error) } do { - self = .case18(try .init(from: decoder)) + self = .repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction(try .init(from: decoder)) return } catch { errors.append(error) } do { - self = .case19(try .init(from: decoder)) + self = .repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size(try .init(from: decoder)) return } catch { errors.append(error) @@ -12924,13 +13168,13 @@ public enum Components { try value.encode(to: encoder) case let .repository_hyphen_rule_hyphen_tag_hyphen_name_hyphen_pattern(value): try value.encode(to: encoder) - case let .case16(value): + case let .repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction(value): try value.encode(to: encoder) - case let .case17(value): + case let .repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length(value): try value.encode(to: encoder) - case let .case18(value): + case let .repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction(value): try value.encode(to: encoder) - case let .case19(value): + case let .repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size(value): try value.encode(to: encoder) case let .repository_hyphen_rule_hyphen_workflows(value): try value.encode(to: encoder) @@ -12958,6 +13202,7 @@ public enum Components { case branch = "branch" case tag = "tag" case push = "push" + case repository = "repository" } /// The target of the ruleset /// @@ -12969,6 +13214,7 @@ public enum Components { @frozen public enum source_typePayload: String, Codable, Hashable, Sendable { case Repository = "Repository" case Organization = "Organization" + case Enterprise = "Enterprise" } /// The type of the source of the ruleset /// @@ -13520,6 +13766,110 @@ public enum Components { case rule_evaluations } } + /// The historical version of a ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version`. + public struct ruleset_hyphen_version: Codable, Hashable, Sendable { + /// The ID of the previous version of the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/version_id`. + public var version_id: Swift.Int + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public struct actorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor/type`. + public var _type: Swift.String? + /// Creates a new `actorPayload`. + /// + /// - Parameters: + /// - id: + /// - _type: + public init( + id: Swift.Int? = nil, + _type: Swift.String? = nil + ) { + self.id = id + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + } + } + /// The actor who updated the ruleset + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version/actor`. + public var actor: Components.Schemas.ruleset_hyphen_version.actorPayload + /// - Remark: Generated from `#/components/schemas/ruleset-version/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `ruleset_hyphen_version`. + /// + /// - Parameters: + /// - version_id: The ID of the previous version of the ruleset + /// - actor: The actor who updated the ruleset + /// - updated_at: + public init( + version_id: Swift.Int, + actor: Components.Schemas.ruleset_hyphen_version.actorPayload, + updated_at: Foundation.Date + ) { + self.version_id = version_id + self.actor = actor + self.updated_at = updated_at + } + public enum CodingKeys: String, CodingKey { + case version_id + case actor + case updated_at + } + } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state`. + public struct ruleset_hyphen_version_hyphen_with_hyphen_state: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value1`. + public var value1: Components.Schemas.ruleset_hyphen_version + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// The state of the ruleset version + /// + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2/state`. + public var state: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - state: The state of the ruleset version + public init(state: OpenAPIRuntime.OpenAPIObjectContainer) { + self.state = state + } + public enum CodingKeys: String, CodingKey { + case state + } + } + /// - Remark: Generated from `#/components/schemas/ruleset-version-with-state/value2`. + public var value2: Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state.Value2Payload + /// Creates a new `ruleset_hyphen_version_hyphen_with_hyphen_state`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.ruleset_hyphen_version, + value2: Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } /// The type of reviewer. /// /// - Remark: Generated from `#/components/schemas/deployment-reviewer-type`. @@ -13838,23 +14188,23 @@ public enum Components { case is_alphanumeric } } - /// Check Automated Security Fixes + /// Check Dependabot security updates /// /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes`. public struct check_hyphen_automated_hyphen_security_hyphen_fixes: Codable, Hashable, Sendable { - /// Whether automated security fixes are enabled for the repository. + /// Whether Dependabot security updates are enabled for the repository. /// /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/enabled`. public var enabled: Swift.Bool - /// Whether automated security fixes are paused for the repository. + /// Whether Dependabot security updates are paused for the repository. /// /// - Remark: Generated from `#/components/schemas/check-automated-security-fixes/paused`. public var paused: Swift.Bool /// Creates a new `check_hyphen_automated_hyphen_security_hyphen_fixes`. /// /// - Parameters: - /// - enabled: Whether automated security fixes are enabled for the repository. - /// - paused: Whether automated security fixes are paused for the repository. + /// - enabled: Whether Dependabot security updates are enabled for the repository. + /// - paused: Whether Dependabot security updates are paused for the repository. public init( enabled: Swift.Bool, paused: Swift.Bool @@ -17881,6 +18231,8 @@ public enum Components { public typealias entriesPayload = [Components.Schemas.content_hyphen_tree.entriesPayloadPayload] /// - Remark: Generated from `#/components/schemas/content-tree/entries`. public var entries: Components.Schemas.content_hyphen_tree.entriesPayload? + /// - Remark: Generated from `#/components/schemas/content-tree/encoding`. + public var encoding: Swift.String? /// - Remark: Generated from `#/components/schemas/content-tree/_links`. public struct _linksPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/content-tree/_links/git`. @@ -17926,6 +18278,7 @@ public enum Components { /// - html_url: /// - download_url: /// - entries: + /// - encoding: /// - _links: public init( _type: Swift.String, @@ -17939,6 +18292,7 @@ public enum Components { html_url: Swift.String? = nil, download_url: Swift.String? = nil, entries: Components.Schemas.content_hyphen_tree.entriesPayload? = nil, + encoding: Swift.String? = nil, _links: Components.Schemas.content_hyphen_tree._linksPayload ) { self._type = _type @@ -17952,6 +18306,7 @@ public enum Components { self.html_url = html_url self.download_url = download_url self.entries = entries + self.encoding = encoding self._links = _links } public enum CodingKeys: String, CodingKey { @@ -17966,6 +18321,7 @@ public enum Components { case html_url case download_url case entries + case encoding case _links } } @@ -21546,7 +21902,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16`. public struct Case16Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16/value1`. - public var value1: Components.Schemas.repository_hyphen_rule_hyphen_workflows + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16/value2`. public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info /// Creates a new `Case16Payload`. @@ -21555,7 +21911,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.repository_hyphen_rule_hyphen_workflows, + value1: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_path_hyphen_restriction, value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info ) { self.value1 = value1 @@ -21575,7 +21931,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case17`. public struct Case17Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case17/value1`. - public var value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case17/value2`. public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info /// Creates a new `Case17Payload`. @@ -21584,7 +21940,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning, + value1: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_path_hyphen_length, value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info ) { self.value1 = value1 @@ -21601,6 +21957,122 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case17`. case case17(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case17Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case18`. + public struct Case18Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case18/value1`. + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case18/value2`. + public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + /// Creates a new `Case18Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_rule_hyphen_file_hyphen_extension_hyphen_restriction, + value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case18`. + case case18(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case18Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19`. + public struct Case19Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19/value1`. + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19/value2`. + public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + /// Creates a new `Case19Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_rule_hyphen_max_hyphen_file_hyphen_size, + value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19`. + case case19(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case19Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20`. + public struct Case20Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20/value1`. + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_workflows + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20/value2`. + public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + /// Creates a new `Case20Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_rule_hyphen_workflows, + value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20`. + case case20(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case20Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. + public struct Case21Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21/value1`. + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21/value2`. + public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + /// Creates a new `Case21Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning, + value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. + case case21(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case21Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -21705,6 +22177,30 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case18(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case19(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case20(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case21(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -21747,6 +22243,14 @@ public enum Components { try value.encode(to: encoder) case let .case17(value): try value.encode(to: encoder) + case let .case18(value): + try value.encode(to: encoder) + case let .case19(value): + try value.encode(to: encoder) + case let .case20(value): + try value.encode(to: encoder) + case let .case21(value): + try value.encode(to: encoder) } } } @@ -22600,119 +23104,6 @@ public enum Components { 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 moved_permanently: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/moved_permanently/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/moved_permanently/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.moved_permanently.Body - /// Creates a new `moved_permanently`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.moved_permanently.Body) { - self.body = body - } - } public struct conflict: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/conflict/content`. @frozen public enum Body: Sendable, Hashable { @@ -22745,6 +23136,119 @@ public enum Components { /// Creates a new `no_content`. public init() {} } + 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 moved_permanently: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/moved_permanently/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/moved_permanently/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.moved_permanently.Body + /// Creates a new `moved_permanently`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.moved_permanently.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 temporary_redirect: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/temporary_redirect/content`. @frozen public enum Body: Sendable, Hashable { @@ -23789,6 +24293,7 @@ public enum Operations { case branch = "branch" case tag = "tag" case push = "push" + case repository = "repository" } /// The target of the ruleset /// @@ -24686,6 +25191,7 @@ public enum Operations { case branch = "branch" case tag = "tag" case push = "push" + case repository = "repository" } /// The target of the ruleset /// @@ -25372,6 +25878,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/advanced_security`. public var advanced_security: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.advanced_securityPayload? + /// Use the `status` property to enable or disable GitHub Code Security for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// Can be `enabled` or `disabled`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/code_security/status`. + public var status: Swift.String? + /// Creates a new `code_securityPayload`. + /// + /// - 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 GitHub Code Security for this repository. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/code_security`. + public var code_security: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.code_securityPayload? /// 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)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/secret_scanning`. @@ -25468,18 +25997,21 @@ public enum Operations { /// /// - Parameters: /// - 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)." + /// - code_security: Use the `status` property to enable or disable GitHub Code Security for this repository. /// - 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, + code_security: Operations.repos_sol_update.Input.Body.jsonPayload.security_and_analysisPayload.code_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.code_security = code_security self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection self.secret_scanning_ai_detection = secret_scanning_ai_detection @@ -25487,6 +26019,7 @@ public enum Operations { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case secret_scanning case secret_scanning_push_protection case secret_scanning_ai_detection @@ -26837,20 +27370,28 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.pagination_hyphen_after? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/predicate_type`. + public var predicate_type: Swift.String? /// 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)." /// - 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)." + /// - predicate_type: Optional filter for fetching attestations with a given predicate type. public init( per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.pagination_hyphen_before? = nil, - after: Components.Parameters.pagination_hyphen_after? = nil + after: Components.Parameters.pagination_hyphen_after? = nil, + predicate_type: Swift.String? = nil ) { self.per_page = per_page self.before = before self.after = after + self.predicate_type = predicate_type } } public var query: Operations.repos_sol_list_hyphen_attestations.Input.Query @@ -26965,21 +27506,27 @@ public enum Operations { public var bundle: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. public var repository_id: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle_url`. + public var bundle_url: Swift.String? /// Creates a new `attestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repository_id: + /// - bundle_url: public init( bundle: Operations.repos_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? = nil, - repository_id: Swift.Int? = nil + repository_id: Swift.Int? = nil, + bundle_url: Swift.String? = nil ) { self.bundle = bundle self.repository_id = repository_id + self.bundle_url = bundle_url } public enum CodingKeys: String, CodingKey { case bundle case repository_id + case bundle_url } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. @@ -27768,9 +28315,9 @@ public enum Operations { } } } - /// Check if automated security fixes are enabled for a repository + /// Check if Dependabot security updates are enabled for a repository /// - /// Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/get(repos/check-automated-security-fixes)`. @@ -27936,9 +28483,9 @@ public enum Operations { } } } - /// Enable automated security fixes + /// Enable Dependabot security updates /// - /// Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/put(repos/enable-automated-security-fixes)`. @@ -28011,9 +28558,9 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Disable automated security fixes + /// Disable Dependabot security updates /// - /// Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". + /// Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)". /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/automated-security-fixes`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/automated-security-fixes/delete(repos/disable-automated-security-fixes)`. @@ -36207,8 +36754,8 @@ public enum Operations { /// To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal. /// /// This endpoint also: - /// - Cancels any outstanding invitations - /// - Unasigns the user from any issues + /// - Cancels any outstanding invitations sent by the collaborator + /// - Unassigns the user from any issues /// - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. /// - Unstars the repository /// - Updates access permissions to packages @@ -38319,7 +38866,7 @@ public enum Operations { } /// List pull requests associated with a commit /// - /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit. + /// Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit. /// /// To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. /// @@ -44802,7 +45349,7 @@ public enum Operations { /// /// The authenticated user must have admin or owner permissions to the repository to use this endpoint. /// - /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app). + /// For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules). /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// @@ -58092,28 +58639,198 @@ public enum Operations { } } } - /// Delete a repository ruleset + /// Delete a repository ruleset + /// + /// Delete a ruleset for a repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)`. + public enum repos_sol_delete_hyphen_repo_hyphen_ruleset { + public static let id: Swift.String = "repos/delete-repo-ruleset" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/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}/rulesets/{ruleset_id}/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}/rulesets/{ruleset_id}/DELETE/path/repo`. + public var repo: Components.Parameters.repo + /// The ID of the ruleset. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/DELETE/path/ruleset_id`. + public var ruleset_id: Swift.Int + /// 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. + /// - ruleset_id: The ID of the ruleset. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + ruleset_id: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.ruleset_id = ruleset_id + } + } + public var path: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/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.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Path, + headers: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.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}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.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.repos_sol_delete_hyphen_repo_hyphen_ruleset.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//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/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 + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/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 + ) + } + } + } + /// 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 repository ruleset history /// - /// Delete a ruleset for a repository. + /// Get the history of a repository ruleset. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)`. - public enum repos_sol_delete_hyphen_repo_hyphen_ruleset { - public static let id: Swift.String = "repos/delete-repo-ruleset" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)`. + public enum repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history { + public static let id: Swift.String = "repos/get-repo-ruleset-history" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/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}/rulesets/{ruleset_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/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}/rulesets/{ruleset_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/path/repo`. public var repo: Components.Parameters.repo /// The ID of the ruleset. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/DELETE/path/ruleset_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/path/ruleset_id`. public var ruleset_id: Swift.Int /// Creates a new `Path`. /// @@ -58131,55 +58848,106 @@ public enum Operations { self.ruleset_id = ruleset_id } } - public var path: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/DELETE/header`. + public var path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/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/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/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/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/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.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/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.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Headers + public var headers: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Path, - headers: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Input.Headers = .init() + path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Path, + query: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Input.Query = .init(), + headers: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.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() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ruleset_hyphen_version]) + /// 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.ruleset_hyphen_version] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Output.NoContent) - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.repos_sol_delete_hyphen_repo_hyphen_ruleset.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_history.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -58187,7 +58955,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -58210,7 +58978,208 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/delete(repos/delete-repo-ruleset)/responses/500`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/get(repos/get-repo-ruleset-history)/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 + ) + } + } + } + /// 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 repository ruleset version + /// + /// Get a version of a repository ruleset. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)`. + public enum repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version { + public static let id: Swift.String = "repos/get-repo-ruleset-version" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/GET/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}/rulesets/{ruleset_id}/history/{version_id}/GET/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}/rulesets/{ruleset_id}/history/{version_id}/GET/path/repo`. + public var repo: Components.Parameters.repo + /// The ID of the ruleset. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/GET/path/ruleset_id`. + public var ruleset_id: Swift.Int + /// The ID of the version + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/GET/path/version_id`. + public var version_id: Swift.Int + /// 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. + /// - ruleset_id: The ID of the ruleset. + /// - version_id: The ID of the version + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + ruleset_id: Swift.Int, + version_id: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.ruleset_id = ruleset_id + self.version_id = version_id + } + } + public var path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_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.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Path, + headers: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ruleset_hyphen_version_hyphen_with_hyphen_state) + /// 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.ruleset_hyphen_version_hyphen_with_hyphen_state { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.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.repos_sol_get_hyphen_repo_hyphen_ruleset_hyphen_version.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)/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 + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}/get(repos/get-repo-ruleset-version)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.internal_error) @@ -60758,14 +61727,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/topics/PUT/requestBody/json`. public struct jsonPayload: Codable, Hashable, Sendable { - /// An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. + /// An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` will be saved as lowercase. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/topics/PUT/requestBody/json/names`. public var names: [Swift.String] /// Creates a new `jsonPayload`. /// /// - Parameters: - /// - names: An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. + /// - names: An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` will be saved as lowercase. public init(names: [Swift.String]) { self.names = names } @@ -62730,6 +63699,20 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/repos/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/repos/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.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Headers /// - Remark: Generated from `#/paths/user/repos/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/user/repos/GET/responses/200/content/application\/json`. @@ -62752,8 +63735,13 @@ public enum Operations { /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Body) { + public init( + headers: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Headers = .init(), + body: Operations.repos_sol_list_hyphen_for_hyphen_authenticated_hyphen_user.Output.Ok.Body + ) { + self.headers = headers self.body = body } } From 1e19af2daced52f29935ed040085bec05a450380 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:49:46 +0000 Subject: [PATCH 22/37] Commit via running ake Sources/search --- Sources/search/Client.swift | 24 +- Sources/search/Types.swift | 559 +++++++++++++++++++++++++----------- 2 files changed, 403 insertions(+), 180 deletions(-) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index bf94bccf9ef..dba668db009 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -330,22 +330,13 @@ public struct Client: APIProtocol { } /// Search issues and pull requests /// - /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). - /// - /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted - /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). - /// - /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. - /// - /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` - /// - /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. - /// - /// > [!NOTE] - /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + /// > [!WARNING] + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. + @available(*, deprecated) public func search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests(_ input: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input) async throws -> Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Output { try await client.send( input: input, @@ -395,6 +386,13 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "advanced_search", + value: input.query.advanced_search + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index e1ec4a43051..525b2a89082 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -53,22 +53,13 @@ public protocol APIProtocol: Sendable { func search_sol_commits(_ input: Operations.search_sol_commits.Input) async throws -> Operations.search_sol_commits.Output /// Search issues and pull requests /// - /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). - /// - /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted - /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). - /// - /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. - /// - /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` - /// - /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. - /// - /// > [!NOTE] - /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + /// > [!WARNING] + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. + @available(*, deprecated) func search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests(_ input: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input) async throws -> Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Output /// Search labels /// @@ -194,22 +185,13 @@ extension APIProtocol { } /// Search issues and pull requests /// - /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). - /// - /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted - /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). - /// - /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. - /// - /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` - /// - /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. - /// - /// > [!NOTE] - /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + /// > [!WARNING] + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. + @available(*, deprecated) public func search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests( query: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input.Query, headers: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input.Headers = .init() @@ -511,149 +493,87 @@ public enum Components { case status } } - /// A GitHub user. + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var html_url: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var website_url: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updated_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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`. + /// Creates a new `enterprise`. /// /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: + /// - description: A short description of the enterprise. + /// - html_url: + /// - website_url: The enterprise's website URL. + /// - id: Unique identifier of the enterprise /// - node_id: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - created_at: + /// - updated_at: /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, + description: Swift.String? = nil, html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil + website_url: Swift.String? = nil, + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + avatar_url: Swift.String ) { - self.name = name - self.email = email - self.login = login + self.description = description + self.html_url = html_url + self.website_url = website_url self.id = id self.node_id = node_id + self.name = name + self.slug = slug + self.created_at = created_at + self.updated_at = updated_at self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login + case description + case html_url + case website_url case id case node_id + case name + case slug + case created_at + case updated_at case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type } } /// Validation Error @@ -781,6 +701,151 @@ public enum Components { case errors } } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -1735,6 +1800,96 @@ public enum Components { case due_on } } + /// The type of issue. + /// + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct issue_hyphen_type: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var node_id: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum colorPayload: String, Codable, Hashable, Sendable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.issue_hyphen_type.colorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var created_at: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updated_at: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var is_enabled: Swift.Bool? + /// Creates a new `issue_hyphen_type`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - node_id: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - created_at: The time the issue type created. + /// - updated_at: The time the issue type last updated. + /// - is_enabled: The enabled state of the issue type. + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.issue_hyphen_type.colorPayload? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil, + is_enabled: Swift.Bool? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.description = description + self.color = color + self.created_at = created_at + self.updated_at = updated_at + self.is_enabled = is_enabled + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case description + case color + case created_at + case updated_at + case is_enabled + } + } /// 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. /// /// - Remark: Generated from `#/components/schemas/nullable-integration`. @@ -1752,7 +1907,42 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. public var client_id: Swift.String? /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. - public var owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? + @frozen public enum ownerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case simple_hyphen_user(Components.Schemas.simple_hyphen_user) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case enterprise(Components.Schemas.enterprise) + 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) + } + do { + self = .enterprise(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) + case let .enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.nullable_hyphen_integration.ownerPayload /// The name of the GitHub app /// /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. @@ -1912,7 +2102,7 @@ public enum Components { slug: Swift.String? = nil, node_id: Swift.String, client_id: Swift.String? = nil, - owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil, + owner: Components.Schemas.nullable_hyphen_integration.ownerPayload, name: Swift.String, description: Swift.String? = nil, external_url: Swift.String, @@ -2072,6 +2262,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -2194,6 +2406,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -2201,6 +2414,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -2208,6 +2422,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -2216,6 +2431,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -3491,6 +3707,8 @@ public enum Components { public var body_text: Swift.String? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/timeline_url`. public var timeline_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/type`. + public var _type: Components.Schemas.issue_hyphen_type? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/performed_via_github_app`. public var performed_via_github_app: Components.Schemas.nullable_hyphen_integration? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/reactions`. @@ -3532,6 +3750,7 @@ public enum Components { /// - body_html: /// - body_text: /// - timeline_url: + /// - _type: /// - performed_via_github_app: /// - reactions: public init( @@ -3569,6 +3788,7 @@ public enum Components { body_html: Swift.String? = nil, body_text: Swift.String? = nil, timeline_url: Swift.String? = nil, + _type: Components.Schemas.issue_hyphen_type? = nil, performed_via_github_app: Components.Schemas.nullable_hyphen_integration? = nil, reactions: Components.Schemas.reaction_hyphen_rollup? = nil ) { @@ -3606,6 +3826,7 @@ public enum Components { self.body_html = body_html self.body_text = body_text self.timeline_url = timeline_url + self._type = _type self.performed_via_github_app = performed_via_github_app self.reactions = reactions } @@ -3644,6 +3865,7 @@ public enum Components { case body_html case body_text case timeline_url + case _type = "type" case performed_via_github_app case reactions } @@ -4761,6 +4983,11 @@ public enum Components { case desc = "desc" case asc = "asc" } + /// Set to `true` to use advanced search. + /// Example: `http://api.github.com/search/issues?q={query}&advanced_search=true` + /// + /// - Remark: Generated from `#/components/parameters/issues-advanced-search`. + public typealias issues_hyphen_advanced_hyphen_search = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -5464,19 +5691,9 @@ public enum Operations { } /// Search issues and pull requests /// - /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). - /// - /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted - /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). - /// - /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. - /// - /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` - /// - /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. - /// - /// > [!NOTE] - /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + /// > [!WARNING] + /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. + /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. @@ -5524,6 +5741,11 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/search/issues/GET/query/page`. public var page: Components.Parameters.page? + /// Set to `true` to use advanced search. + /// Example: `http://api.github.com/search/issues?q={query}&advanced_search=true` + /// + /// - Remark: Generated from `#/paths/search/issues/GET/query/advanced_search`. + public var advanced_search: Components.Parameters.issues_hyphen_advanced_hyphen_search? /// Creates a new `Query`. /// /// - Parameters: @@ -5532,18 +5754,21 @@ public enum Operations { /// - order: 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)." + /// - advanced_search: Set to `true` to use advanced search. public init( q: Swift.String, sort: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input.Query.sortPayload? = nil, order: Components.Parameters.order? = nil, per_page: Components.Parameters.per_hyphen_page? = nil, - page: Components.Parameters.page? = nil + page: Components.Parameters.page? = nil, + advanced_search: Components.Parameters.issues_hyphen_advanced_hyphen_search? = nil ) { self.q = q self.sort = sort self.order = order self.per_page = per_page self.page = page + self.advanced_search = advanced_search } } public var query: Operations.search_sol_issues_hyphen_and_hyphen_pull_hyphen_requests.Input.Query From 69718d6879804d4e425f4fed361af86ba79a908d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:50:09 +0000 Subject: [PATCH 23/37] Commit via running ake Sources/secret-scanning --- Sources/secret-scanning/Client.swift | 2 +- Sources/secret-scanning/Types.swift | 96 +++++++++++++++++----------- 2 files changed, 61 insertions(+), 37 deletions(-) diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index ae7642feced..c44ba1fa413 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -1045,7 +1045,7 @@ public struct Client: APIProtocol { } /// Get secret scanning scan history for a repository /// - /// Lists the latest incremental and backfill scans by type for a repository. + /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 1e9ebd83238..da46cfaf3f6 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -92,7 +92,7 @@ public protocol APIProtocol: Sendable { func secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass(_ input: Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Input) async throws -> Operations.secret_hyphen_scanning_sol_create_hyphen_push_hyphen_protection_hyphen_bypass.Output /// Get secret scanning scan history for a repository /// - /// Lists the latest incremental and backfill scans by type for a repository. + /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// @@ -252,7 +252,7 @@ extension APIProtocol { } /// Get secret scanning scan history for a repository /// - /// Lists the latest incremental and backfill scans by type for a repository. + /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// @@ -610,22 +610,6 @@ public enum Components { case user_view_type } } - /// The security alert number. - /// - /// - Remark: Generated from `#/components/schemas/alert-number`. - public typealias alert_hyphen_number = Swift.Int - /// The REST API URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-url`. - public typealias alert_hyphen_url = Swift.String - /// The GitHub URL of the alert resource. - /// - /// - Remark: Generated from `#/components/schemas/alert-html-url`. - public typealias alert_hyphen_html_hyphen_url = Swift.String - /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/alert-created-at`. - public typealias alert_hyphen_created_hyphen_at = Foundation.Date /// A GitHub repository. /// /// - Remark: Generated from `#/components/schemas/simple-repository`. @@ -1005,6 +989,22 @@ public enum Components { case hooks_url } } + /// The security alert number. + /// + /// - Remark: Generated from `#/components/schemas/alert-number`. + public typealias alert_hyphen_number = Swift.Int + /// The REST API URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-url`. + public typealias alert_hyphen_url = Swift.String + /// The GitHub URL of the alert resource. + /// + /// - Remark: Generated from `#/components/schemas/alert-html-url`. + public typealias alert_hyphen_html_hyphen_url = Swift.String + /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/alert-created-at`. + public typealias alert_hyphen_created_hyphen_at = Foundation.Date /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// /// - Remark: Generated from `#/components/schemas/nullable-alert-updated-at`. @@ -1078,6 +1078,10 @@ public enum Components { 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 reviewing a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. + public var push_protection_bypass_request_reviewer_comment: Swift.String? /// An optional comment when requesting a push protection bypass. /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_comment`. @@ -1110,6 +1114,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/multi_repo`. public var multi_repo: Swift.Bool? + /// A boolean value representing whether or not alert is base64 encoded + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/is_base64_encoded`. + public var is_base64_encoded: Swift.Bool? /// Creates a new `organization_hyphen_secret_hyphen_scanning_hyphen_alert`. /// /// - Parameters: @@ -1131,12 +1139,14 @@ public enum Components { /// - 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_reviewer_comment: An optional comment when reviewing a push protection bypass. /// - 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. + /// - is_base64_encoded: A boolean value representing whether or not alert is base64 encoded public init( number: Components.Schemas.alert_hyphen_number? = nil, created_at: Components.Schemas.alert_hyphen_created_hyphen_at? = nil, @@ -1156,12 +1166,14 @@ public enum Components { 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_reviewer_comment: Swift.String? = 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, publicly_leaked: Swift.Bool? = nil, - multi_repo: Swift.Bool? = nil + multi_repo: Swift.Bool? = nil, + is_base64_encoded: Swift.Bool? = nil ) { self.number = number self.created_at = created_at @@ -1181,12 +1193,14 @@ public enum Components { 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_reviewer_comment = push_protection_bypass_request_reviewer_comment 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 + self.is_base64_encoded = is_base64_encoded } public enum CodingKeys: String, CodingKey { case number @@ -1207,12 +1221,14 @@ public enum Components { case push_protection_bypassed_by case push_protection_bypassed_at case push_protection_bypass_request_reviewer + case push_protection_bypass_request_reviewer_comment case push_protection_bypass_request_comment case push_protection_bypass_request_html_url case resolution_comment case validity case publicly_leaked case multi_repo + case is_base64_encoded } } /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. @@ -1274,6 +1290,10 @@ public enum Components { 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 reviewing a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. + public var push_protection_bypass_request_reviewer_comment: Swift.String? /// An optional comment when requesting a push protection bypass. /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_comment`. @@ -1302,6 +1322,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/multi_repo`. public var multi_repo: Swift.Bool? + /// A boolean value representing whether or not alert is base64 encoded + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/is_base64_encoded`. + public var is_base64_encoded: Swift.Bool? /// Creates a new `secret_hyphen_scanning_hyphen_alert`. /// /// - Parameters: @@ -1323,11 +1347,13 @@ public enum Components { /// - 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_reviewer_comment: An optional comment when reviewing a push protection bypass. /// - 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. + /// - is_base64_encoded: A boolean value representing whether or not alert is base64 encoded public init( number: Components.Schemas.alert_hyphen_number? = nil, created_at: Components.Schemas.alert_hyphen_created_hyphen_at? = nil, @@ -1347,11 +1373,13 @@ public enum Components { 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_reviewer_comment: Swift.String? = 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 + multi_repo: Swift.Bool? = nil, + is_base64_encoded: Swift.Bool? = nil ) { self.number = number self.created_at = created_at @@ -1371,11 +1399,13 @@ public enum Components { 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_reviewer_comment = push_protection_bypass_request_reviewer_comment 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 + self.is_base64_encoded = is_base64_encoded } public enum CodingKeys: String, CodingKey { case number @@ -1396,11 +1426,13 @@ public enum Components { case push_protection_bypassed_by case push_protection_bypassed_at case push_protection_bypass_request_reviewer + case push_protection_bypass_request_reviewer_comment case push_protection_bypass_request_comment case push_protection_bypass_request_html_url case validity case publicly_leaked case multi_repo + case is_base64_encoded } } /// An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. @@ -2188,9 +2220,7 @@ public enum Components { case open = "open" case resolved = "resolved" } - /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" - /// for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-secret-type`. public typealias secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type = Swift.String @@ -2386,9 +2416,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? - /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" - /// for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/secret_type`. public var secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? @@ -2442,7 +2470,7 @@ public enum Operations { /// /// - Parameters: /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - secret_type: A comma-separated list of secret types to return. By default all secret types are returned. + /// - secret_type: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. @@ -2694,9 +2722,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? - /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" - /// for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/secret_type`. public var secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? @@ -2754,7 +2780,7 @@ public enum Operations { /// /// - Parameters: /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - secret_type: A comma-separated list of secret types to return. By default all secret types are returned. + /// - secret_type: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. @@ -3018,9 +3044,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_state? - /// A comma-separated list of secret types to return. By default all secret types are returned. - /// See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" - /// for a complete list of secret types. + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/secret_type`. public var secret_type: Components.Parameters.secret_hyphen_scanning_hyphen_alert_hyphen_secret_hyphen_type? @@ -3078,7 +3102,7 @@ public enum Operations { /// /// - Parameters: /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - secret_type: A comma-separated list of secret types to return. By default all secret types are returned. + /// - secret_type: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. @@ -4329,7 +4353,7 @@ public enum Operations { } /// Get secret scanning scan history for a repository /// - /// Lists the latest incremental and backfill scans by type for a repository. + /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// From 0c1c50b3cfe63c40c1f6447d6fef5ef049c5a61f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:50:33 +0000 Subject: [PATCH 24/37] Commit via running ake Sources/teams --- Sources/teams/Client.swift | 52 +- Sources/teams/Types.swift | 1382 ++++++++++++++++++------------------ 2 files changed, 720 insertions(+), 714 deletions(-) diff --git a/Sources/teams/Client.swift b/Sources/teams/Client.swift index 6909dfcfd7b..47d8e1f2051 100644 --- a/Sources/teams/Client.swift +++ b/Sources/teams/Client.swift @@ -1749,13 +1749,13 @@ public struct Client: APIProtocol { } /// List team projects /// - /// Lists the organization projects for a team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. + @available(*, deprecated) public func teams_sol_list_hyphen_projects_hyphen_in_hyphen_org(_ input: Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Output { try await client.send( input: input, @@ -1839,13 +1839,13 @@ public struct Client: APIProtocol { } /// Check team permissions for a project /// - /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. + @available(*, deprecated) public func teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org(_ input: Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Output { try await client.send( input: input, @@ -1910,13 +1910,13 @@ public struct Client: APIProtocol { } /// Add or update team project permissions /// - /// 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. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. + @available(*, deprecated) public func teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org(_ input: Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Output { try await client.send( input: input, @@ -1992,13 +1992,13 @@ public struct Client: APIProtocol { } /// Remove a project from a team /// - /// 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. This endpoint removes the project from the team, but does not delete the project. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. + @available(*, deprecated) public func teams_sol_remove_hyphen_project_hyphen_in_hyphen_org(_ input: Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Output { try await client.send( input: input, @@ -4174,9 +4174,8 @@ public struct Client: APIProtocol { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. @@ -4286,9 +4285,8 @@ public struct Client: APIProtocol { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. @@ -4357,9 +4355,8 @@ public struct Client: APIProtocol { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. @@ -4483,9 +4480,8 @@ public struct Client: APIProtocol { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 3daad2d0994..6dfa42c1bfa 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -255,43 +255,43 @@ public protocol APIProtocol: Sendable { func teams_sol_remove_hyphen_membership_hyphen_for_hyphen_user_hyphen_in_hyphen_org(_ input: Operations.teams_sol_remove_hyphen_membership_hyphen_for_hyphen_user_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_remove_hyphen_membership_hyphen_for_hyphen_user_hyphen_in_hyphen_org.Output /// List team projects /// - /// Lists the organization projects for a team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. + @available(*, deprecated) func teams_sol_list_hyphen_projects_hyphen_in_hyphen_org(_ input: Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Output /// Check team permissions for a project /// - /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. + @available(*, deprecated) func teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org(_ input: Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Output /// Add or update team project permissions /// - /// 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. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. + @available(*, deprecated) func teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org(_ input: Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Output /// Remove a project from a team /// - /// 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. This endpoint removes the project from the team, but does not delete the project. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. + @available(*, deprecated) func teams_sol_remove_hyphen_project_hyphen_in_hyphen_org(_ input: Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Input) async throws -> Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Output /// List team repositories /// @@ -648,9 +648,8 @@ public protocol APIProtocol: Sendable { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. @@ -659,9 +658,8 @@ public protocol APIProtocol: Sendable { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. @@ -670,9 +668,8 @@ public protocol APIProtocol: Sendable { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. @@ -681,9 +678,8 @@ public protocol APIProtocol: Sendable { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. @@ -1165,13 +1161,13 @@ extension APIProtocol { } /// List team projects /// - /// Lists the organization projects for a team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. + @available(*, deprecated) public func teams_sol_list_hyphen_projects_hyphen_in_hyphen_org( path: Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Input.Path, query: Operations.teams_sol_list_hyphen_projects_hyphen_in_hyphen_org.Input.Query = .init(), @@ -1185,13 +1181,13 @@ extension APIProtocol { } /// Check team permissions for a project /// - /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. + @available(*, deprecated) public func teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org( path: Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Input.Path, headers: Operations.teams_sol_check_hyphen_permissions_hyphen_for_hyphen_project_hyphen_in_hyphen_org.Input.Headers = .init() @@ -1203,13 +1199,13 @@ extension APIProtocol { } /// Add or update team project permissions /// - /// 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. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. + @available(*, deprecated) public func teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org( path: Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Input.Path, headers: Operations.teams_sol_add_hyphen_or_hyphen_update_hyphen_project_hyphen_permissions_hyphen_in_hyphen_org.Input.Headers = .init(), @@ -1223,13 +1219,13 @@ extension APIProtocol { } /// Remove a project from a team /// - /// 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. This endpoint removes the project from the team, but does not delete the project. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. + @available(*, deprecated) public func teams_sol_remove_hyphen_project_hyphen_in_hyphen_org(path: Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Input.Path) async throws -> Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Output { try await teams_sol_remove_hyphen_project_hyphen_in_hyphen_org(Operations.teams_sol_remove_hyphen_project_hyphen_in_hyphen_org.Input(path: path)) } @@ -1784,9 +1780,8 @@ extension APIProtocol { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. @@ -1805,9 +1800,8 @@ extension APIProtocol { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. @@ -1824,9 +1818,8 @@ extension APIProtocol { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. @@ -1845,9 +1838,8 @@ extension APIProtocol { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. @@ -2175,6 +2167,131 @@ public enum Components { case status } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -2320,132 +2437,7 @@ public enum Components { case user_view_type } } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct validation_hyphen_error: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. - public var documentation_url: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. - public struct errorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. - public var field: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. - public var code: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. - public var index: Swift.Int? - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - @frozen public enum valuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. - case case1(Swift.String?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. - case case2(Swift.Int?) - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. - case case3([Swift.String]?) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - 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 .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. - public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? - /// Creates a new `errorsPayloadPayload`. - /// - /// - Parameters: - /// - resource: - /// - field: - /// - message: - /// - code: - /// - index: - /// - value: - public init( - resource: Swift.String? = nil, - field: Swift.String? = nil, - message: Swift.String? = nil, - code: Swift.String, - index: Swift.Int? = nil, - value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil - ) { - self.resource = resource - self.field = field - self.message = message - self.code = code - self.index = index - self.value = value - } - public enum CodingKeys: String, CodingKey { - case resource - case field - case message - case code - case index - case value - } - } - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? - /// Creates a new `validation_hyphen_error`. - /// - /// - Parameters: - /// - message: - /// - documentation_url: - /// - errors: - public init( - message: Swift.String, - documentation_url: Swift.String, - errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil - ) { - self.message = message - self.documentation_url = documentation_url - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentation_url - case errors - } - } - /// License Simple + /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. public struct nullable_hyphen_license_hyphen_simple: Codable, Hashable, Sendable { @@ -2537,346 +2529,123 @@ public enum Components { case html_url } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `reaction_hyphen_rollup`. /// /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + /// - url: + /// - total_count: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: public init( - id: Swift.Int, - node_id: Swift.String, url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil + total_count: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int ) { - self.id = id - self.node_id = node_id self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn + self.total_count = total_count + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket } public enum CodingKeys: String, CodingKey { - case id - case node_id case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn + case total_count + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket } } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis`. + public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. + public struct advanced_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? + /// Creates a new `advanced_securityPayload`. /// /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { + self.status = status } public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin + case status } } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// - Remark: Generated from `#/components/schemas/reaction-rollup`. - public struct reaction_hyphen_rollup: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. - public var total_count: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. - public var _plus_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. - public var _hyphen_1: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. - public var laugh: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. - public var confused: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. - public var heart: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. - public var hooray: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. - public var eyes: Swift.Int - /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. - public var rocket: Swift.Int - /// Creates a new `reaction_hyphen_rollup`. - /// - /// - Parameters: - /// - url: - /// - total_count: - /// - _plus_1: - /// - _hyphen_1: - /// - laugh: - /// - confused: - /// - heart: - /// - hooray: - /// - eyes: - /// - rocket: - public init( - url: Swift.String, - total_count: Swift.Int, - _plus_1: Swift.Int, - _hyphen_1: Swift.Int, - laugh: Swift.Int, - confused: Swift.Int, - heart: Swift.Int, - hooray: Swift.Int, - eyes: Swift.Int, - rocket: Swift.Int - ) { - self.url = url - self.total_count = total_count - self._plus_1 = _plus_1 - self._hyphen_1 = _hyphen_1 - self.laugh = laugh - self.confused = confused - self.heart = heart - self.hooray = hooray - self.eyes = eyes - self.rocket = rocket - } - public enum CodingKeys: String, CodingKey { - case url - case total_count - case _plus_1 = "+1" - case _hyphen_1 = "-1" - case laugh - case confused - case heart - case hooray - case eyes - case rocket - } - } - /// - Remark: Generated from `#/components/schemas/security-and-analysis`. - public struct security_hyphen_and_hyphen_analysis: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public struct advanced_securityPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. @frozen public enum statusPayload: String, Codable, Hashable, Sendable { case enabled = "enabled" case disabled = "disabled" } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. - public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? - /// Creates a new `advanced_securityPayload`. + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. /// /// - Parameters: /// - status: - public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload.statusPayload? = nil) { + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { self.status = status } public enum CodingKeys: String, CodingKey { case status } } - /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. - public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -2999,6 +2768,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -3006,6 +2776,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -3013,6 +2784,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -3021,6 +2793,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -3472,179 +3245,424 @@ public enum Components { self.id = id self.node_id = node_id self.name = name - self.full_name = full_name - self.owner = owner - self._private = _private - self.html_url = html_url + self.full_name = full_name + self.owner = owner + self._private = _private + self.html_url = html_url + self.description = description + self.fork = fork + self.url = url + 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.downloads_url = downloads_url + self.events_url = events_url + self.forks_url = forks_url + self.git_commits_url = git_commits_url + self.git_refs_url = git_refs_url + self.git_tags_url = git_tags_url + self.git_url = git_url + 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.notifications_url = notifications_url + self.pulls_url = pulls_url + self.releases_url = releases_url + self.ssh_url = ssh_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.clone_url = clone_url + self.mirror_url = mirror_url + self.hooks_url = hooks_url + self.svn_url = svn_url + self.homepage = homepage + self.language = language + self.forks_count = forks_count + self.stargazers_count = stargazers_count + self.watchers_count = watchers_count + self.size = size + self.default_branch = default_branch + self.open_issues_count = open_issues_count + self.is_template = is_template + self.topics = topics + self.has_issues = has_issues + self.has_projects = has_projects + self.has_wiki = has_wiki + self.has_pages = has_pages + self.has_downloads = has_downloads + self.has_discussions = has_discussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushed_at = pushed_at + self.created_at = created_at + self.updated_at = updated_at + self.permissions = permissions + self.role_name = role_name + self.temp_clone_token = temp_clone_token + self.delete_branch_on_merge = delete_branch_on_merge + self.subscribers_count = subscribers_count + self.network_count = network_count + self.code_of_conduct = code_of_conduct + self.license = license + self.forks = forks + self.open_issues = open_issues + self.watchers = watchers + self.allow_forking = allow_forking + self.web_commit_signoff_required = web_commit_signoff_required + self.security_and_analysis = security_and_analysis + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case full_name + case owner + case _private = "private" + case html_url + case description + case fork + case url + 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 downloads_url + case events_url + case forks_url + case git_commits_url + case git_refs_url + case git_tags_url + case git_url + 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 notifications_url + case pulls_url + case releases_url + case ssh_url + case stargazers_url + case statuses_url + case subscribers_url + case subscription_url + case tags_url + case teams_url + case trees_url + case clone_url + case mirror_url + case hooks_url + case svn_url + case homepage + case language + case forks_count + case stargazers_count + case watchers_count + case size + case default_branch + case open_issues_count + case is_template + case topics + case has_issues + case has_projects + case has_wiki + case has_pages + case has_downloads + case has_discussions + case archived + case disabled + case visibility + case pushed_at + case created_at + case updated_at + case permissions + case role_name + case temp_clone_token + case delete_branch_on_merge + case subscribers_count + case network_count + case code_of_conduct + case license + case forks + case open_issues + case watchers + case allow_forking + case web_commit_signoff_required + case security_and_analysis + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug self.description = description - self.fork = fork - self.url = url - 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.downloads_url = downloads_url - self.events_url = events_url - self.forks_url = forks_url - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - self.git_url = git_url - 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.notifications_url = notifications_url - self.pulls_url = pulls_url - self.releases_url = releases_url - self.ssh_url = ssh_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.clone_url = clone_url - self.mirror_url = mirror_url - self.hooks_url = hooks_url - self.svn_url = svn_url - self.homepage = homepage - self.language = language - self.forks_count = forks_count - self.stargazers_count = stargazers_count - self.watchers_count = watchers_count - self.size = size - self.default_branch = default_branch - self.open_issues_count = open_issues_count - self.is_template = is_template - self.topics = topics - self.has_issues = has_issues - self.has_projects = has_projects - self.has_wiki = has_wiki - self.has_pages = has_pages - self.has_downloads = has_downloads - self.has_discussions = has_discussions - self.archived = archived - self.disabled = disabled - self.visibility = visibility - self.pushed_at = pushed_at - self.created_at = created_at - self.updated_at = updated_at + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission self.permissions = permissions - self.role_name = role_name - self.temp_clone_token = temp_clone_token - self.delete_branch_on_merge = delete_branch_on_merge - self.subscribers_count = subscribers_count - self.network_count = network_count - self.code_of_conduct = code_of_conduct - self.license = license - self.forks = forks - self.open_issues = open_issues - self.watchers = watchers - self.allow_forking = allow_forking - self.web_commit_signoff_required = web_commit_signoff_required - self.security_and_analysis = security_and_analysis + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent } public enum CodingKeys: String, CodingKey { case id case node_id case name - case full_name - case owner - case _private = "private" - case html_url + case slug case description - case fork - case url - 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 downloads_url - case events_url - case forks_url - case git_commits_url - case git_refs_url - case git_tags_url - case git_url - 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 notifications_url - case pulls_url - case releases_url - case ssh_url - case stargazers_url - case statuses_url - case subscribers_url - case subscription_url - case tags_url - case teams_url - case trees_url - case clone_url - case mirror_url - case hooks_url - case svn_url - case homepage - case language - case forks_count - case stargazers_count - case watchers_count - case size - case default_branch - case open_issues_count - case is_template - case topics - case has_issues - case has_projects - case has_wiki - case has_pages - case has_downloads - case has_discussions - case archived - case disabled - case visibility - case pushed_at - case created_at - case updated_at + case privacy + case notification_setting + case permission case permissions - case role_name - case temp_clone_token - case delete_branch_on_merge - case subscribers_count - case network_count - case code_of_conduct - case license - case forks - case open_issues - case watchers - case allow_forking - case web_commit_signoff_required - case security_and_analysis + case url + case html_url + case members_url + case repositories_url + case parent } } /// Organization Invitation @@ -5300,10 +5318,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias page = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias team_hyphen_slug = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -5320,6 +5334,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/username`. public typealias username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias team_hyphen_slug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. @@ -9167,10 +9185,9 @@ public enum Operations { } /// List team projects /// - /// Lists the organization projects for a team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/get(teams/list-projects-in-org)`. @@ -9357,10 +9374,9 @@ public enum Operations { } /// Check team permissions for a project /// - /// Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/get(teams/check-permissions-for-project-in-org)`. @@ -9535,10 +9551,9 @@ public enum Operations { } /// Add or update team project permissions /// - /// 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. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/put(teams/add-or-update-project-permissions-in-org)`. @@ -9770,10 +9785,9 @@ public enum Operations { } /// Remove a project from a team /// - /// 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. This endpoint removes the project from the team, but does not delete the project. - /// - /// > [!NOTE] - /// > You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/teams/{team_slug}/projects/{project_id}/delete(teams/remove-project-in-org)`. @@ -14295,9 +14309,8 @@ public enum Operations { /// List team projects (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/get(teams/list-projects-legacy)`. @@ -14499,9 +14512,8 @@ public enum Operations { /// Check team permissions for a project (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `GET /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/get(teams/check-permissions-for-project-legacy)`. @@ -14670,9 +14682,8 @@ public enum Operations { /// Add or update team project permissions (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `PUT /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/put(teams/add-or-update-project-permissions-legacy)`. @@ -14944,9 +14955,8 @@ public enum Operations { /// Remove a project from a team (Legacy) /// /// > [!WARNING] - /// > **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. + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. /// /// - Remark: HTTP `DELETE /teams/{team_id}/projects/{project_id}`. /// - Remark: Generated from `#/paths//teams/{team_id}/projects/{project_id}/delete(teams/remove-project-legacy)`. From 9122376798b227278e294e7f787bdbb14fd57bba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:50:56 +0000 Subject: [PATCH 25/37] Commit via running ake Sources/users --- Sources/users/Client.swift | 19 +- Sources/users/Types.swift | 385 +++++++++++-------------------------- 2 files changed, 129 insertions(+), 275 deletions(-) diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index 03227230960..922e00727f0 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -4388,9 +4388,11 @@ public struct Client: APIProtocol { /// /// Provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /user/{account_id}`. /// - Remark: Generated from `#/paths//user/{account_id}/get(users/get-by-id)`. @@ -4566,9 +4568,11 @@ public struct Client: APIProtocol { /// /// Provides publicly available information about someone with a GitHub account. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. + /// + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. @@ -4700,6 +4704,13 @@ public struct Client: APIProtocol { name: "after", value: input.query.after ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "predicate_type", + value: input.query.predicate_type + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 2b2c7e469d7..0e488ea2f03 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -269,9 +269,11 @@ public protocol APIProtocol: Sendable { /// /// Provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /user/{account_id}`. /// - Remark: Generated from `#/paths//user/{account_id}/get(users/get-by-id)`. @@ -289,9 +291,11 @@ public protocol APIProtocol: Sendable { /// /// Provides publicly available information about someone with a GitHub account. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. + /// + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. @@ -871,9 +875,11 @@ extension APIProtocol { /// /// Provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. + /// + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /user/{account_id}`. /// - Remark: Generated from `#/paths//user/{account_id}/get(users/get-by-id)`. @@ -907,9 +913,11 @@ extension APIProtocol { /// /// Provides publicly available information about someone with a GitHub account. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. @@ -2611,260 +2619,6 @@ public enum Components { case created_at } } - /// Sigstore Bundle v0.1 - /// - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0`. - public struct sigstore_hyphen_bundle_hyphen_0: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/mediaType`. - public var mediaType: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial`. - public struct verificationMaterialPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain`. - public struct x509CertificateChainPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificatesPayload`. - public struct certificatesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificatesPayload/rawBytes`. - public var rawBytes: Swift.String? - /// Creates a new `certificatesPayloadPayload`. - /// - /// - Parameters: - /// - rawBytes: - public init(rawBytes: Swift.String? = nil) { - self.rawBytes = rawBytes - } - public enum CodingKeys: String, CodingKey { - case rawBytes - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificates`. - public typealias certificatesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayloadPayload] - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain/certificates`. - public var certificates: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayload? - /// Creates a new `x509CertificateChainPayload`. - /// - /// - Parameters: - /// - certificates: - public init(certificates: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload.certificatesPayload? = nil) { - self.certificates = certificates - } - public enum CodingKeys: String, CodingKey { - case certificates - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/x509CertificateChain`. - public var x509CertificateChain: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload`. - public struct tlogEntriesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logIndex`. - public var logIndex: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId`. - public struct logIdPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId/keyId`. - public var keyId: Swift.String? - /// Creates a new `logIdPayload`. - /// - /// - Parameters: - /// - keyId: - public init(keyId: Swift.String? = nil) { - self.keyId = keyId - } - public enum CodingKeys: String, CodingKey { - case keyId - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/logId`. - public var logId: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.logIdPayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion`. - public struct kindVersionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion/kind`. - public var kind: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion/version`. - public var version: Swift.String? - /// Creates a new `kindVersionPayload`. - /// - /// - Parameters: - /// - kind: - /// - version: - public init( - kind: Swift.String? = nil, - version: Swift.String? = nil - ) { - self.kind = kind - self.version = version - } - public enum CodingKeys: String, CodingKey { - case kind - case version - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/kindVersion`. - public var kindVersion: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.kindVersionPayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/integratedTime`. - public var integratedTime: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise`. - public struct inclusionPromisePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise/signedEntryTimestamp`. - public var signedEntryTimestamp: Swift.String? - /// Creates a new `inclusionPromisePayload`. - /// - /// - Parameters: - /// - signedEntryTimestamp: - public init(signedEntryTimestamp: Swift.String? = nil) { - self.signedEntryTimestamp = signedEntryTimestamp - } - public enum CodingKeys: String, CodingKey { - case signedEntryTimestamp - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionPromise`. - public var inclusionPromise: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.inclusionPromisePayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/inclusionProof`. - public var inclusionProof: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntriesPayload/canonicalizedBody`. - public var canonicalizedBody: Swift.String? - /// Creates a new `tlogEntriesPayloadPayload`. - /// - /// - Parameters: - /// - logIndex: - /// - logId: - /// - kindVersion: - /// - integratedTime: - /// - inclusionPromise: - /// - inclusionProof: - /// - canonicalizedBody: - public init( - logIndex: Swift.String? = nil, - logId: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.logIdPayload? = nil, - kindVersion: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.kindVersionPayload? = nil, - integratedTime: Swift.String? = nil, - inclusionPromise: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload.inclusionPromisePayload? = nil, - inclusionProof: Swift.String? = nil, - canonicalizedBody: Swift.String? = nil - ) { - self.logIndex = logIndex - self.logId = logId - self.kindVersion = kindVersion - self.integratedTime = integratedTime - self.inclusionPromise = inclusionPromise - self.inclusionProof = inclusionProof - self.canonicalizedBody = canonicalizedBody - } - public enum CodingKeys: String, CodingKey { - case logIndex - case logId - case kindVersion - case integratedTime - case inclusionPromise - case inclusionProof - case canonicalizedBody - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntries`. - public typealias tlogEntriesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayloadPayload] - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/tlogEntries`. - public var tlogEntries: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial/timestampVerificationData`. - public var timestampVerificationData: Swift.String? - /// Creates a new `verificationMaterialPayload`. - /// - /// - Parameters: - /// - x509CertificateChain: - /// - tlogEntries: - /// - timestampVerificationData: - public init( - x509CertificateChain: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.x509CertificateChainPayload? = nil, - tlogEntries: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload.tlogEntriesPayload? = nil, - timestampVerificationData: Swift.String? = nil - ) { - self.x509CertificateChain = x509CertificateChain - self.tlogEntries = tlogEntries - self.timestampVerificationData = timestampVerificationData - } - public enum CodingKeys: String, CodingKey { - case x509CertificateChain - case tlogEntries - case timestampVerificationData - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/verificationMaterial`. - public var verificationMaterial: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope`. - public struct dsseEnvelopePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/payload`. - public var payload: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/payloadType`. - public var payloadType: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload`. - public struct signaturesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload/sig`. - public var sig: Swift.String? - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signaturesPayload/keyid`. - public var keyid: Swift.String? - /// Creates a new `signaturesPayloadPayload`. - /// - /// - Parameters: - /// - sig: - /// - keyid: - public init( - sig: Swift.String? = nil, - keyid: Swift.String? = nil - ) { - self.sig = sig - self.keyid = keyid - } - public enum CodingKeys: String, CodingKey { - case sig - case keyid - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signatures`. - public typealias signaturesPayload = [Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayloadPayload] - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope/signatures`. - public var signatures: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayload? - /// Creates a new `dsseEnvelopePayload`. - /// - /// - Parameters: - /// - payload: - /// - payloadType: - /// - signatures: - public init( - payload: Swift.String? = nil, - payloadType: Swift.String? = nil, - signatures: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload.signaturesPayload? = nil - ) { - self.payload = payload - self.payloadType = payloadType - self.signatures = signatures - } - public enum CodingKeys: String, CodingKey { - case payload - case payloadType - case signatures - } - } - /// - Remark: Generated from `#/components/schemas/sigstore-bundle-0/dsseEnvelope`. - public var dsseEnvelope: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload? - /// Creates a new `sigstore_hyphen_bundle_hyphen_0`. - /// - /// - Parameters: - /// - mediaType: - /// - verificationMaterial: - /// - dsseEnvelope: - public init( - mediaType: Swift.String? = nil, - verificationMaterial: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.verificationMaterialPayload? = nil, - dsseEnvelope: Components.Schemas.sigstore_hyphen_bundle_hyphen_0.dsseEnvelopePayload? = nil - ) { - self.mediaType = mediaType - self.verificationMaterial = verificationMaterial - self.dsseEnvelope = dsseEnvelope - } - public enum CodingKeys: String, CodingKey { - case mediaType - case verificationMaterial - case dsseEnvelope - } - } /// Hovercard /// /// - Remark: Generated from `#/components/schemas/hovercard`. @@ -10601,9 +10355,11 @@ public enum Operations { /// /// Provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. + /// + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /user/{account_id}`. /// - Remark: Generated from `#/paths//user/{account_id}/get(users/get-by-id)`. @@ -10982,9 +10738,11 @@ public enum Operations { /// /// Provides publicly available information about someone with a GitHub account. /// - /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status. /// - /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". + /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication). + /// + /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails). /// /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. @@ -11225,20 +10983,28 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.pagination_hyphen_after? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query/predicate_type`. + public var predicate_type: Swift.String? /// 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)." /// - 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)." + /// - predicate_type: Optional filter for fetching attestations with a given predicate type. public init( per_page: Components.Parameters.per_hyphen_page? = nil, before: Components.Parameters.pagination_hyphen_before? = nil, - after: Components.Parameters.pagination_hyphen_after? = nil + after: Components.Parameters.pagination_hyphen_after? = nil, + predicate_type: Swift.String? = nil ) { self.per_page = per_page self.before = before self.after = after + self.predicate_type = predicate_type } } public var query: Operations.users_sol_list_hyphen_attestations.Input.Query @@ -11278,25 +11044,102 @@ public enum Operations { public struct jsonPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload`. public struct attestationsPayloadPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. + public struct bundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public struct verificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `verificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public struct dsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `dsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? + /// Creates a new `bundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.verificationMaterialPayload? = nil, + dsseEnvelope: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload.dsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle`. - public var bundle: Components.Schemas.sigstore_hyphen_bundle_hyphen_0? + public var bundle: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/repository_id`. public var repository_id: Swift.Int? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestationsPayload/bundle_url`. + public var bundle_url: Swift.String? /// Creates a new `attestationsPayloadPayload`. /// /// - Parameters: - /// - bundle: + /// - bundle: The attestation's Sigstore Bundle. /// - repository_id: + /// - bundle_url: public init( - bundle: Components.Schemas.sigstore_hyphen_bundle_hyphen_0? = nil, - repository_id: Swift.Int? = nil + bundle: Operations.users_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.attestationsPayloadPayload.bundlePayload? = nil, + repository_id: Swift.Int? = nil, + bundle_url: Swift.String? = nil ) { self.bundle = bundle self.repository_id = repository_id + self.bundle_url = bundle_url } public enum CodingKeys: String, CodingKey { case bundle case repository_id + case bundle_url } } /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. From 09ae874301b4f02fc4c3b0cf36d26bdd4ed6873f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:51:19 +0000 Subject: [PATCH 26/37] Commit via running ake Sources/codespaces --- Sources/codespaces/Client.swift | 4 +- Sources/codespaces/Types.swift | 352 +++++++++++++++++--------------- 2 files changed, 191 insertions(+), 165 deletions(-) diff --git a/Sources/codespaces/Client.swift b/Sources/codespaces/Client.swift index 3857cc6486d..62f5de31a9e 100644 --- a/Sources/codespaces/Client.swift +++ b/Sources/codespaces/Client.swift @@ -3208,7 +3208,7 @@ public struct Client: APIProtocol { /// Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/put(codespaces/create-or-update-repo-secret)`. @@ -3287,7 +3287,7 @@ public struct Client: APIProtocol { /// /// Deletes a development environment secret in a repository using the secret name. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/delete(codespaces/delete-repo-secret)`. diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 8c76b52204a..022008e0e36 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -257,7 +257,7 @@ public protocol APIProtocol: Sendable { /// Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/put(codespaces/create-or-update-repo-secret)`. @@ -266,7 +266,7 @@ public protocol APIProtocol: Sendable { /// /// Deletes a development environment secret in a repository using the secret name. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/delete(codespaces/delete-repo-secret)`. @@ -972,7 +972,7 @@ extension APIProtocol { /// Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/put(codespaces/create-or-update-repo-secret)`. @@ -991,7 +991,7 @@ extension APIProtocol { /// /// Deletes a development environment secret in a repository using the secret name. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/delete(codespaces/delete-repo-secret)`. @@ -1581,151 +1581,6 @@ public enum Components { case status } } - /// A GitHub user. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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: - /// - name: - /// - email: - /// - login: - /// - id: - /// - node_id: - /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, - html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil - ) { - self.name = name - self.email = email - self.login = login - self.id = id - self.node_id = node_id - self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login - case id - case node_id - case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type - } - } /// Scim Error /// /// - Remark: Generated from `#/components/schemas/scim-error`. @@ -1900,6 +1755,151 @@ public enum Components { case errors } } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } /// License Simple /// /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. @@ -2756,6 +2756,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -2878,6 +2900,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -2885,6 +2908,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -2892,6 +2916,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -2900,6 +2925,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -6504,10 +6530,10 @@ public enum Components { self.body = body } } - public struct internal_error: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. + public struct conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. case json(Components.Schemas.basic_hyphen_error) /// The associated value of the enum case if `self` is `.json`. /// @@ -6523,12 +6549,12 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. + public var body: Components.Responses.conflict.Body + /// Creates a new `conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { + public init(body: Components.Responses.conflict.Body) { self.body = body } } @@ -6589,10 +6615,10 @@ public enum Components { self.body = body } } - public struct conflict: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content`. + 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/conflict/content/application\/json`. + /// - 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`. /// @@ -6608,12 +6634,12 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.conflict.Body - /// Creates a new `conflict`. + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.conflict.Body) { + public init(body: Components.Responses.internal_error.Body) { self.body = body } } @@ -12712,7 +12738,7 @@ public enum Operations { /// Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/put(codespaces/create-or-update-repo-secret)`. @@ -12925,7 +12951,7 @@ public enum Operations { /// /// Deletes a development environment secret in a repository using the secret name. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin. /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/codespaces/secrets/{secret_name}/delete(codespaces/delete-repo-secret)`. From 5588b1b4267a1142fd9e7c1440e9ade7a4ec26e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:51:42 +0000 Subject: [PATCH 27/37] Commit via running ake Sources/copilot --- Sources/copilot/Client.swift | 1455 +-------- Sources/copilot/Types.swift | 5732 +++++++++------------------------- 2 files changed, 1578 insertions(+), 5609 deletions(-) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index b073e9c7ae0..4123eb63c88 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -38,971 +38,6 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// 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 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 { - try await client.send( - input: input, - forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/enterprises/{}/copilot/billing/seats", - parameters: [ - input.path.enterprise - ] - ) - 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 headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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_hyphen_for_hyphen_enterprise.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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 - )) - 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 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(_ 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_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/enterprises/{}/copilot/metrics", - parameters: [ - input.path.enterprise - ] - ) - 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_enterprise.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 enterprise 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 - /// 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. - /// - /// 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. - /// - /// - 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.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/enterprises/{}/copilot/usage", - parameters: [ - input.path.enterprise - ] - ) - 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_enterprise.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 metrics for an enterprise team - /// - /// > [!NOTE] - /// > This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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(_ 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_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/enterprises/{}/team/{}/copilot/metrics", - parameters: [ - input.path.enterprise, - 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_enterprise_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 an enterprise team - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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. - /// - /// 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. - /// - /// 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_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/enterprises/{}/team/{}/copilot/usage", - parameters: [ - input.path.enterprise, - 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_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_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].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 information and settings for an organization /// /// > [!NOTE] @@ -1901,225 +936,31 @@ public struct Client: APIProtocol { input.path.org ] ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - 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.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - 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, - 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 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 + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + 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_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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: [ @@ -2129,7 +970,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].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) @@ -2161,9 +1002,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 403: + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.forbidden.Body + let body: Components.Responses.requires_authentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2182,10 +1023,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Components.Responses.forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2204,10 +1045,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.usage_metrics_api_disabled.Body + let body: Components.Responses.not_found.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2226,7 +1067,9 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -2239,32 +1082,31 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for organization members + /// Get Copilot metrics for an organization /// - /// > [!NOTE] - /// > This endpoint is in public preview 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. /// - /// 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. + /// > [!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. 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. /// - /// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics. + /// 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/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 { + /// - 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_usage_hyphen_metrics_hyphen_for_hyphen_org.id, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/usage", + template: "/orgs/{}/copilot/metrics", parameters: [ input.path.org ] @@ -2312,7 +1154,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_org.Output.Ok.Body + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2322,7 +1164,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) @@ -2354,9 +1196,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: [ @@ -2375,10 +1217,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: [ @@ -2397,10 +1239,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: [ @@ -2419,7 +1261,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, @@ -2790,201 +1632,4 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for a team - /// - /// > [!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 - /// for users within a 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. - /// - /// 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 team had five or more members with active Copilot licenses, as evaluated at the end of that day. - /// - /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage 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/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output { - try await client.send( - input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/team/{}/copilot/usage", - 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_usage_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].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 - ) - ) - } - } - ) - } } diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 80d78fc5a62..9ff6ca65a1d 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -11,110 +11,6 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// 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)`. - 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 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, - /// 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. - /// - /// 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. - /// - /// - 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 - /// - /// > [!NOTE] - /// > This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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 public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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. - /// - /// 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. - /// - /// 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)`. - 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 /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] @@ -240,26 +136,6 @@ public protocol APIProtocol: Sendable { /// - 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 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)`. - 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 /// Get Copilot seat assignment details for a user /// /// > [!NOTE] @@ -296,187 +172,10 @@ public protocol APIProtocol: Sendable { /// - 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 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. - /// 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 team had five or more members with active Copilot licenses, as evaluated at the end of that day. - /// - /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage 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/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. - func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output } /// Convenience overloads for operation inputs. extension APIProtocol { - /// 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 func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise( - 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() - ) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output { - try await copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input( - path: path, - query: query, - 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 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, - /// 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. - /// - /// 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. - /// - /// - 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( - 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() - ) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { - try await copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input( - path: path, - query: query, - headers: headers - )) - } - /// Get Copilot metrics for an enterprise team - /// - /// > [!NOTE] - /// > This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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 public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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. - /// - /// 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. - /// - /// 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( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() - ) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { - try await copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input( - path: path, - query: query, - headers: headers - )) - } /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] @@ -670,36 +369,6 @@ extension APIProtocol { headers: headers )) } - /// 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( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Headers = .init() - ) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output { - try await copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input( - path: path, - query: query, - headers: headers - )) - } /// Get Copilot seat assignment details for a user /// /// > [!NOTE] @@ -754,39 +423,6 @@ extension APIProtocol { headers: headers )) } - /// Get a summary of Copilot usage for a team - /// - /// > [!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 - /// for users within a 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. - /// - /// 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 team had five or more members with active Copilot licenses, as evaluated at the end of that day. - /// - /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage 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/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers = .init() - ) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Output { - try await copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input( - path: path, - query: query, - headers: headers - )) - } } /// Server URLs defined in the OpenAPI document. @@ -803,55 +439,92 @@ 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 + } + } /// A GitHub user. /// - /// - Remark: Generated from `#/components/schemas/simple-user`. - public struct simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/simple-user/name`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/simple-user/email`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/simple-user/login`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/id`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/simple-user/url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/type`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. public var site_admin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. public var starred_at: Swift.String? - /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. public var user_view_type: Swift.String? - /// Creates a new `simple_hyphen_user`. + /// Creates a new `nullable_hyphen_simple_hyphen_user`. /// /// - Parameters: /// - name: @@ -948,133 +621,11 @@ public enum Components { case user_view_type } } - /// Basic Error + /// Groups of organization members that gives permissions on specified repositories. /// - /// - 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 - } - } - /// A GitHub organization. - /// - /// - 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/nullable-organization-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/hooks_url`. - public var hooks_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/issues_url`. - public var issues_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/public_members_url`. - public var public_members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/description`. - public var description: Swift.String? - /// Creates a new `nullable_hyphen_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`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. public var id: Swift.Int @@ -1315,3320 +866,1661 @@ public enum Components { case parent } } - /// Group of enterprise owners and/or members + /// The breakdown of Copilot Business seats for the organization. /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct enterprise_hyphen_team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. - public var url: Swift.String - /// - 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.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`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var created_at: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updated_at: Foundation.Date - /// Creates a new `enterprise_hyphen_team`. + /// - Remark: Generated from `#/components/schemas/copilot-organization-seat-breakdown`. + public struct copilot_hyphen_organization_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-organization-seat-breakdown/total`. + public var total: Swift.Int? + /// Seats added during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-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-organization-seat-breakdown/pending_cancellation`. + public var pending_cancellation: Swift.Int? + /// The number of users who have been invited to receive a Copilot seat through this organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-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-organization-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-organization-seat-breakdown/inactive_this_cycle`. + public var inactive_this_cycle: Swift.Int? + /// Creates a new `copilot_hyphen_organization_hyphen_seat_hyphen_breakdown`. /// /// - Parameters: - /// - id: - /// - name: - /// - slug: - /// - url: - /// - sync_to_organizations: - /// - group_id: - /// - html_url: - /// - members_url: - /// - created_at: - /// - updated_at: + /// - 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 users who have been invited to receive a Copilot seat through 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( - id: Swift.Int64, - name: Swift.String, - slug: Swift.String, - url: Swift.String, - sync_to_organizations: Swift.String, - group_id: Swift.String? = nil, - html_url: Swift.String, - members_url: Swift.String, - created_at: Foundation.Date, - updated_at: Foundation.Date + 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.id = id - self.name = name - self.slug = slug - self.url = url - self.sync_to_organizations = sync_to_organizations - self.group_id = group_id - self.html_url = html_url - self.members_url = members_url - self.created_at = created_at - self.updated_at = updated_at + 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 id - case name - case slug - case url - case sync_to_organizations - case group_id - case html_url - case members_url - case created_at - case updated_at + case total + case added_this_cycle + case pending_cancellation + case pending_invitation + case active_this_cycle + case inactive_this_cycle } } - /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// 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-seat-details`. - public struct copilot_hyphen_seat_hyphen_details: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. - public var assignee: Components.Schemas.simple_hyphen_user - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. - 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-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_organization_hyphen_seat_hyphen_breakdown + /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - @frozen public enum assigning_teamPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. - case team(Components.Schemas.team) - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. - case enterprise_hyphen_team(Components.Schemas.enterprise_hyphen_team) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .team(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .enterprise_hyphen_team(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 .team(value): - try value.encode(to: encoder) - case let .enterprise_hyphen_team(value): - try value.encode(to: encoder) - } - } + /// - 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" } - /// The team through which the assignee is granted access to GitHub Copilot, if applicable. + /// The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. - public var assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? - /// 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. + /// - 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 Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. - public var pending_cancellation_date: Swift.String? - /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + /// - 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 Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_at`. - public var last_activity_at: Foundation.Date? - /// Last editor that was used by the user for a GitHub Copilot completion. + /// - 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 Copilot features on GitHub.com. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. - public var last_activity_editor: Swift.String? - /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + /// - 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 Copilot features on GitHub.com. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. - public var created_at: Foundation.Date - /// **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - 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 Copilot in the CLI. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. - @available(*, deprecated) - public var updated_at: Foundation.Date? + /// - 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 Copilot in the 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-seat-details/plan_type`. + /// - 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-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`. + /// - 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: - /// - 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: **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + /// - seat_breakdown: + /// - public_code_suggestions: The organization policy for allowing or blocking suggestions matching public code (duplication detection filter). + /// - ide_chat: The organization policy for allowing or disallowing Copilot Chat in the IDE. + /// - platform_chat: The organization policy for allowing or disallowing Copilot features on GitHub.com. + /// - cli: The organization policy for allowing or disallowing Copilot in the 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( - 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, - plan_type: Components.Schemas.copilot_hyphen_seat_hyphen_details.plan_typePayload? = nil + seat_breakdown: Components.Schemas.copilot_hyphen_organization_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.assignee = assignee - self.organization = organization - self.assigning_team = assigning_team - self.pending_cancellation_date = pending_cancellation_date - self.last_activity_at = last_activity_at - self.last_activity_editor = last_activity_editor - self.created_at = created_at - self.updated_at = updated_at + 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 assignee - case organization - case assigning_team - case pending_cancellation_date - case last_activity_at - case last_activity_editor - case created_at - case updated_at + 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) - assignee = try container.decode( - Components.Schemas.simple_hyphen_user.self, - forKey: .assignee - ) - organization = try container.decodeIfPresent( - Components.Schemas.nullable_hyphen_organization_hyphen_simple.self, - forKey: .organization - ) - assigning_team = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload.self, - forKey: .assigning_team + seat_breakdown = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_seat_hyphen_breakdown.self, + forKey: .seat_breakdown ) - pending_cancellation_date = try container.decodeIfPresent( - Swift.String.self, - forKey: .pending_cancellation_date + public_code_suggestions = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, + forKey: .public_code_suggestions ) - last_activity_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .last_activity_at + ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, + forKey: .ide_chat ) - last_activity_editor = try container.decodeIfPresent( - Swift.String.self, - forKey: .last_activity_editor + platform_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, + forKey: .platform_chat ) - created_at = try container.decode( - Foundation.Date.self, - forKey: .created_at + cli = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, + forKey: .cli ) - updated_at = try container.decodeIfPresent( - Foundation.Date.self, - forKey: .updated_at + 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_seat_hyphen_details.plan_typePayload.self, + Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload.self, forKey: .plan_type ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "assignee", - "organization", - "assigning_team", - "pending_cancellation_date", - "last_activity_at", - "last_activity_editor", - "created_at", - "updated_at", + 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) + } } - /// Usage metrics for Copilot editor code completions in the IDE. + /// A GitHub organization. /// - /// - 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-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-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-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-ide-code-completions/languagesPayload/total_engaged_users`. - public var total_engaged_users: Swift.Int? - /// Creates a new `languagesPayloadPayload`. - /// - /// - 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-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-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-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-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 `editorsPayloadPayload`. - /// - /// - Parameters: - /// - 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( - 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.name = name - self.total_engaged_users = total_engaged_users - self.models = models - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case name - case total_engaged_users - case models - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - name = try container.decodeIfPresent( - Swift.String.self, - forKey: .name - ) - total_engaged_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_engaged_users - ) - models = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload.self, - forKey: .models - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "name", - "total_engaged_users", - "models" - ]) - } - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - name, - forKey: .name - ) - try container.encodeIfPresent( - total_engaged_users, - forKey: .total_engaged_users - ) - try container.encodeIfPresent( - models, - forKey: .models - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - 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: - /// - 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( - 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.total_engaged_users = total_engaged_users - self.languages = languages - self.editors = editors - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case total_engaged_users - case languages - 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 - ) - languages = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload.self, - forKey: .languages - ) - editors = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload.self, - forKey: .editors - ) - 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 - ) - try container.encodeIfPresent( - languages, - forKey: .languages - ) - try container.encodeIfPresent( - editors, - forKey: .editors - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// Usage metrics for Copilot Chat in the IDE. - /// - /// - 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-ide-chat/total_engaged_users`. - public var total_engaged_users: Swift.Int? - /// Copilot Chat metrics, for active editors. - /// - /// - 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_engaged_users: Total number of users who prompted Copilot Chat in the IDE. - /// - editors: - /// - additionalProperties: A container of undocumented properties. - public init( - total_engaged_users: Swift.Int? = nil, - editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.total_engaged_users = total_engaged_users - self.editors = editors - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - 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) - } - } - /// Usage metrics for Copilot Chat in github.com - /// - /// - 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 - } - } - /// List of model metrics for a custom models and the default model. - /// - /// - 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-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`. - /// - /// - 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 - } - public enum CodingKeys: String, CodingKey { - case total_engaged_users - case models - } - 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-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-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 - } - 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-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_usage_hyphen_metrics_hyphen_day`. - /// - /// - Parameters: - /// - 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( - 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.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 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) - date = try container.decode( - Swift.String.self, - forKey: .date - ) - total_active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_users - ) - total_engaged_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_engaged_users - ) - copilot_ide_code_completions = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.self, - forKey: .copilot_ide_code_completions - ) - copilot_ide_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_ide_hyphen_chat.self, - forKey: .copilot_ide_chat - ) - 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: [ - "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( - date, - forKey: .date - ) - try container.encodeIfPresent( - total_active_users, - forKey: .total_active_users - ) - try container.encodeIfPresent( - total_engaged_users, - forKey: .total_engaged_users - ) - try container.encodeIfPresent( - copilot_ide_code_completions, - forKey: .copilot_ide_code_completions - ) - try container.encodeIfPresent( - copilot_ide_chat, - forKey: .copilot_ide_chat - ) - 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) - } - } - /// 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`. - public typealias page = Swift.Int - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. - /// - /// - 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`. - public typealias team_hyphen_slug = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias org = Swift.String - /// The handle for the GitHub user account. - /// - /// - 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`. - /// - /// - 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`. + /// - 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/nullable-organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/hooks_url`. + public var hooks_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/issues_url`. + public var issues_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/public_members_url`. + public var public_members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-organization-simple/description`. + public var description: Swift.String? + /// Creates a new `nullable_hyphen_organization_hyphen_simple`. /// /// - 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 - } - } - } + /// - 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 } - /// 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 + 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 } } - } - /// 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`. + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct enterprise_hyphen_team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// - 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.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var group_name: 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`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `enterprise_hyphen_team`. /// /// - Parameters: - /// - path: - /// - query: - /// - headers: + /// - id: + /// - name: + /// - slug: + /// - url: + /// - sync_to_organizations: + /// - group_id: + /// - group_name: + /// - html_url: + /// - members_url: + /// - created_at: + /// - updated_at: 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() + id: Swift.Int64, + name: Swift.String, + slug: Swift.String, + url: Swift.String, + sync_to_organizations: Swift.String, + group_id: Swift.String? = nil, + group_name: Swift.String? = nil, + html_url: Swift.String, + members_url: Swift.String, + created_at: Foundation.Date, + updated_at: Foundation.Date ) { - 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 - } + self.id = id + self.name = name + self.slug = slug + self.url = url + self.sync_to_organizations = sync_to_organizations + self.group_id = group_id + self.group_name = group_name + self.html_url = html_url + self.members_url = members_url + self.created_at = created_at + self.updated_at = updated_at } - /// 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 - ) - } - } + public enum CodingKeys: String, CodingKey { + case id + case name + case slug + case url + case sync_to_organizations + case group_id + case group_name + case html_url + case members_url + case created_at + case updated_at } - /// 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`. + } + /// Information about a Copilot Business seat assignment for a user, team, or organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. + public struct copilot_hyphen_seat_hyphen_details: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assignee`. + public var assignee: Components.Schemas.nullable_hyphen_simple_hyphen_user? + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/organization`. + public var organization: Components.Schemas.nullable_hyphen_organization_hyphen_simple? + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. /// - /// - 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 - ) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + @frozen public enum assigning_teamPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case1`. + case team(Components.Schemas.team) + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team/case2`. + case enterprise_hyphen_team(Components.Schemas.enterprise_hyphen_team) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .team(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .enterprise_hyphen_team(try .init(from: decoder)) + return + } catch { + errors.append(error) } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - } - /// 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 { + public func encode(to encoder: any Encoder) throws { switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) + case let .team(value): + try value.encode(to: encoder) + case let .enterprise_hyphen_team(value): + try value.encode(to: encoder) } } } - /// Forbidden + /// The team through which the assignee is granted access to GitHub Copilot, if applicable. /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/assigning_team`. + public var assigning_team: Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload? + /// 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. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/pending_cancellation_date`. + public var pending_cancellation_date: Swift.String? + /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. /// - /// - 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 `#/components/schemas/copilot-seat-details/last_activity_at`. + public var last_activity_at: Foundation.Date? + /// Last editor that was used by the user for a GitHub Copilot completion. /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. + public var last_activity_editor: Swift.String? + /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.not_found) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. + public var created_at: Foundation.Date + /// **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. /// - /// - 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 - ) - } - } + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/updated_at`. + @available(*, deprecated) + 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" } - /// Undocumented response. + /// The Copilot plan of the organization, or the parent enterprise, when applicable. /// - /// 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) - } + /// - 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: + /// - 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: **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. 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.nullable_hyphen_simple_hyphen_user? = nil, + 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, + plan_type: Components.Schemas.copilot_hyphen_seat_hyphen_details.plan_typePayload? = nil + ) { + self.assignee = assignee + self.organization = organization + self.assigning_team = assigning_team + self.pending_cancellation_date = pending_cancellation_date + self.last_activity_at = last_activity_at + self.last_activity_editor = last_activity_editor + self.created_at = created_at + self.updated_at = updated_at + self.plan_type = plan_type } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } + public enum CodingKeys: String, CodingKey { + case assignee + case organization + case assigning_team + case pending_cancellation_date + case last_activity_at + case last_activity_editor + case created_at + case updated_at + case plan_type } - public static var allCases: [Self] { - [ - .json - ] + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + assignee = try container.decodeIfPresent( + Components.Schemas.nullable_hyphen_simple_hyphen_user.self, + forKey: .assignee + ) + organization = try container.decodeIfPresent( + Components.Schemas.nullable_hyphen_organization_hyphen_simple.self, + forKey: .organization + ) + assigning_team = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_seat_hyphen_details.assigning_teamPayload.self, + forKey: .assigning_team + ) + pending_cancellation_date = try container.decodeIfPresent( + Swift.String.self, + forKey: .pending_cancellation_date + ) + last_activity_at = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .last_activity_at + ) + last_activity_editor = try container.decodeIfPresent( + Swift.String.self, + forKey: .last_activity_editor + ) + created_at = try container.decode( + Foundation.Date.self, + forKey: .created_at + ) + updated_at = try container.decodeIfPresent( + 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", + "assigning_team", + "pending_cancellation_date", + "last_activity_at", + "last_activity_editor", + "created_at", + "updated_at", + "plan_type" + ]) } } - } - /// 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`. - /// - /// - 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_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)." + /// Usage metrics for Copilot editor code completions in the IDE. + /// + /// - 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-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-ide-code-completions/languagesPayload`. + public struct languagesPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions. /// - /// - 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 `#/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 `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/per_page`. - public var per_page: Swift.Int? - /// Creates a new `Query`. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languagesPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Creates a new `languagesPayloadPayload`. /// /// - 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)." + /// - 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( - since: Swift.String? = nil, - until: Swift.String? = nil, - page: Components.Parameters.page? = nil, - per_page: Swift.Int? = nil + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil ) { - self.since = since - self.until = until - self.page = page - self.per_page = per_page + self.name = name + self.total_engaged_users = total_engaged_users } - } - 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 enum CodingKeys: String, CodingKey { + case name + case total_engaged_users } } - public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers - /// Creates a new `Input`. + /// Code completion metrics for active languages. /// - /// - Parameters: - /// - 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 - } - } - @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`. + /// - 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-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-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'. /// - /// - 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 - } + /// - 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 + } } - /// Received HTTP response body - public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body - /// Creates a new `Ok`. + /// List of model metrics for custom models and the default model. + /// + /// - 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-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 `editorsPayloadPayload`. /// /// - 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 - } - } - /// Response - /// - /// - 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 - ) - } + /// - 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( + 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.name = name + self.total_engaged_users = total_engaged_users + self.models = models + self.additionalProperties = additionalProperties } - } - /// 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 - ) - } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models } - } - /// Forbidden - /// - /// - 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 init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + models = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload.self, + forKey: .models + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "name", + "total_engaged_users", + "models" + ]) } - } - /// 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 - ) - } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + name, + forKey: .name + ) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + models, + forKey: .models + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// 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`. + /// - 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`. /// - /// - 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 - ) - } - } + /// - Parameters: + /// - 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( + 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.total_engaged_users = total_engaged_users + self.languages = languages + self.editors = editors + self.additionalProperties = additionalProperties } - /// 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 enum CodingKeys: String, CodingKey { + case total_engaged_users + case languages + case editors } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } + 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 + ) + languages = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload.self, + forKey: .languages + ) + editors = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload.self, + forKey: .editors + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "languages", + "editors" + ]) } - public static var allCases: [Self] { - [ - .json - ] + 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( + languages, + forKey: .languages + ) + try container.encodeIfPresent( + editors, + forKey: .editors + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - } - /// Get a summary of Copilot usage for enterprise 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 - /// 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. - /// - /// 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. - /// - /// - 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/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. + /// Usage metrics for Copilot Chat in the IDE. + /// + /// - 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-ide-chat/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Copilot Chat metrics, for active editors. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload`. + public struct editorsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the given editor. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path/enterprise`. - public var enterprise: Components.Parameters.enterprise - /// Creates a new `Path`. + /// - 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. /// - /// - 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 + /// - 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 Chat. 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 Chat. 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 + } } - } - 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)." + /// List of model metrics for custom models and the default model. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/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 `#/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 `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/per_page`. - public var per_page: Swift.Int? - /// Creates a new `Query`. + /// - 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: - /// - 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)." + /// - 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( - since: Swift.String? = nil, - until: Swift.String? = nil, - page: Components.Parameters.page? = nil, - per_page: Swift.Int? = nil + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayload? = nil ) { - self.since = since - self.until = until - self.page = page - self.per_page = per_page + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models } - } - 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] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models } } - public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers - /// Creates a new `Input`. + /// - 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: - /// - path: - /// - query: - /// - headers: + /// - total_engaged_users: Total number of users who prompted Copilot Chat in the IDE. + /// - editors: + /// - additionalProperties: A container of undocumented properties. 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() + total_engaged_users: Swift.Int? = nil, + editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .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/usage/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]) - /// 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] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.copilot_sol_usage_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_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { - self.body = body - } + self.total_engaged_users = total_engaged_users + self.editors = editors + self.additionalProperties = additionalProperties } - /// Response - /// - /// - 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_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_usage_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 enum CodingKeys: String, CodingKey { + case total_engaged_users + case editors } - /// Internal Error - /// - /// - 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) - /// 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 - ) - } - } + 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" + ]) } - /// 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 - ) - } - } + 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) } - /// Forbidden - /// - /// - 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) - /// The associated value of the enum case if `self` is `.forbidden`. + } + /// Usage metrics for Copilot Chat in GitHub.com + /// + /// - 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. /// - /// - 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 - ) - } + /// - 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 Chat. 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 Chat. 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 } } - /// Resource not found + /// List of model metrics for a custom models and the default model. /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/404`. + /// - 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. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.not_found) - /// The associated value of the enum case if `self` is `.notFound`. + /// - 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`. /// - /// - 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 - ) - } - } + /// - 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 } - /// 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 enum CodingKeys: String, CodingKey { + case total_engaged_users + case models } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } + 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 static var allCases: [Self] { - [ - .json - ] + 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) } } - } - /// Get Copilot metrics for an enterprise team - /// - /// > [!NOTE] - /// > This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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 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}/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}/team/{team_slug}/copilot/metrics/GET/path/enterprise`. - public var enterprise: Components.Parameters.enterprise - /// The slug of the enterprise team name. + /// 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 `#/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`. + /// - 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. /// - /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. - /// - 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 + /// - 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 pull request summaries. 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 pull request summaries. 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 + } } - } - 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}/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}/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)." + /// List of model metrics for custom models and the default model. /// - /// - 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 `#/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 `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/per_page`. - public var per_page: Swift.Int? - /// Creates a new `Query`. + /// - 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: - /// - 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)." + /// - 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( - since: Swift.String? = nil, - until: Swift.String? = nil, - page: Components.Parameters.page? = nil, - per_page: Swift.Int? = nil + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayload? = nil ) { - self.since = since - self.until = until - self.page = page - self.per_page = per_page + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models } - } - 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] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models } } - public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers - /// Creates a new `Input`. + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries + /// + /// - 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-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: - /// - path: - /// - query: - /// - headers: + /// - 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( - 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() + total_engaged_users: Swift.Int? = nil, + repositories: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .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}/team/{team_slug}/copilot/metrics/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - 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_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_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_enterprise_hyphen_team.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - 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_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_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } + self.total_engaged_users = total_engaged_users + self.repositories = repositories + self.additionalProperties = additionalProperties } - /// Internal Error - /// - /// - 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) - /// 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 - ) - } - } + public enum CodingKeys: String, CodingKey { + case total_engaged_users + case repositories } - /// Forbidden - /// - /// - 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) - /// 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 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" + ]) } - /// Resource not found - /// - /// - 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) - /// 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 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 Merics API setting is disabled at the organization or enterprise level. + } + /// 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 `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/422`. + /// - 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. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.usage_metrics_api_disabled) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// - 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. /// - /// - 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. + /// - 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_usage_hyphen_metrics_hyphen_day`. /// - /// 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) - } + /// - Parameters: + /// - 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( + 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.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 var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } + public enum CodingKeys: String, CodingKey { + 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 static var allCases: [Self] { - [ - .json - ] + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + date = try container.decode( + Swift.String.self, + forKey: .date + ) + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users + ) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + copilot_ide_code_completions = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.self, + forKey: .copilot_ide_code_completions + ) + copilot_ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_chat.self, + forKey: .copilot_ide_chat + ) + 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: [ + "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( + date, + forKey: .date + ) + try container.encodeIfPresent( + total_active_users, + forKey: .total_active_users + ) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + copilot_ide_code_completions, + forKey: .copilot_ide_code_completions + ) + try container.encodeIfPresent( + copilot_ide_chat, + forKey: .copilot_ide_chat + ) + 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) } } } - /// Get a summary of Copilot usage for an enterprise team - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)." - /// - /// 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. - /// - /// 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. - /// - /// 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 enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team { - public static let id: Swift.String = "copilot/usage-metrics-for-enterprise-team" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/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}/team/{team_slug}/copilot/usage/GET/path/enterprise`. - public var enterprise: Components.Parameters.enterprise - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/usage/GET/path/team_slug`. - public var team_slug: Components.Parameters.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. - /// - team_slug: The slug of the team name. - public init( - enterprise: Components.Parameters.enterprise, - team_slug: Components.Parameters.team_hyphen_slug - ) { - self.enterprise = enterprise - self.team_slug = team_slug - } - } - public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/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}/team/{team_slug}/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}/team/{team_slug}/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}/team/{team_slug}/copilot/usage/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}/team/{team_slug}/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 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_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/usage/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + /// 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`. + public typealias page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias username = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias team_hyphen_slug = 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`. /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - 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 + } + } } } - public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers - /// Creates a new `Input`. + /// Received HTTP response body + public var body: Components.Responses.not_found.Body + /// Creates a new `not_found`. /// /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers + /// - body: Received HTTP response body + public init(body: Components.Responses.not_found.Body) { + self.body = body } } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/usage/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/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: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { - get throws { - switch self { - case let .json(body): - return 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: Operations.copilot_sol_usage_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_hyphen_team.Output.Ok.Body) { - self.body = body - } } - /// Response - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// Received HTTP response body + public var body: Components.Responses.requires_authentication.Body + /// Creates a new `requires_authentication`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.requires_authentication.Body) { + self.body = body } - /// Internal Error - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-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 - ) + } + 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 + } } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.requires_authentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. /// - /// - 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 - ) - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-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 - ) + } + 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}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-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`. + /// Received HTTP response body + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. /// - /// - 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 - ) - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.internal_error.Body) { + self.body = body } - /// 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 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 + } + } } } - public static var allCases: [Self] { - [ - .json - ] + /// 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 { /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] @@ -6646,294 +4538,16 @@ public enum Operations { 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 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 enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org { - public static let id: Swift.String = "copilot/usage-metrics-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/usage/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/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/orgs/{org}/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/orgs/{org}/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/orgs/{org}/copilot/usage/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/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 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_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_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}/copilot/usage/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/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: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.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_org.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_usage_hyphen_metrics_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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.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/usage/get(copilot/usage-metrics-for-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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)/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//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-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 - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)/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 { + /// - 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 .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -7526,294 +5140,4 @@ public enum Operations { } } } - /// Get a summary of Copilot usage for a team - /// - /// > [!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 - /// for users within a 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. - /// - /// 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 team had five or more members with active Copilot licenses, as evaluated at the end of that day. - /// - /// Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage 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/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)`. - public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team { - public static let id: Swift.String = "copilot/usage-metrics-for-team" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/usage/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/usage/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/usage/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_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/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/orgs/{org}/team/{team_slug}/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/orgs/{org}/team/{team_slug}/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/orgs/{org}/team/{team_slug}/copilot/usage/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/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 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_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), - headers: Operations.copilot_sol_usage_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/usage/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/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: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.copilot_sol_usage_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_usage_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_usage_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_usage_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/usage/get(copilot/usage-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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-team)/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//orgs/{org}/team/{team_slug}/copilot/usage/get(copilot/usage-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/usage/get(copilot/usage-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 - ) - } - } - } - /// 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 - ] - } - } - } } From 240a648ad7f80be36758c37974ef8ce1fb3494ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:52:05 +0000 Subject: [PATCH 28/37] Commit via running ake Sources/security-advisories --- Sources/security-advisories/Types.swift | 1004 ++++++++++++----------- 1 file changed, 516 insertions(+), 488 deletions(-) diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index 55c347a5955..3b705fb9ff0 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -500,6 +500,31 @@ public enum Components { case cvss_v4 } } + /// The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss). + /// + /// - Remark: Generated from `#/components/schemas/security-advisory-epss`. + public struct security_hyphen_advisory_hyphen_epss: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-advisory-epss/percentage`. + public var percentage: Swift.Double? + /// - Remark: Generated from `#/components/schemas/security-advisory-epss/percentile`. + public var percentile: Swift.Double? + /// Creates a new `security_hyphen_advisory_hyphen_epss`. + /// + /// - Parameters: + /// - percentage: + /// - percentile: + public init( + percentage: Swift.Double? = nil, + percentile: Swift.Double? = nil + ) { + self.percentage = percentage + self.percentile = percentile + } + public enum CodingKeys: String, CodingKey { + case percentage + case percentile + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/simple-user`. @@ -818,6 +843,8 @@ public enum Components { 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/epss`. + public var epss: Components.Schemas.security_hyphen_advisory_hyphen_epss? /// - Remark: Generated from `#/components/schemas/global-advisory/cwesPayload`. public struct cwesPayloadPayload: Codable, Hashable, Sendable { /// The Common Weakness Enumeration (CWE) identifier. @@ -849,31 +876,6 @@ public enum Components { public typealias cwesPayload = [Components.Schemas.global_hyphen_advisory.cwesPayloadPayload] /// - Remark: Generated from `#/components/schemas/global-advisory/cwes`. public var cwes: Components.Schemas.global_hyphen_advisory.cwesPayload? - /// - Remark: Generated from `#/components/schemas/global-advisory/epss`. - public struct epssPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/global-advisory/epss/percentage`. - public var percentage: Swift.Double? - /// - Remark: Generated from `#/components/schemas/global-advisory/epss/percentile`. - public var percentile: Swift.Double? - /// Creates a new `epssPayload`. - /// - /// - Parameters: - /// - percentage: - /// - percentile: - public init( - percentage: Swift.Double? = nil, - percentile: Swift.Double? = nil - ) { - self.percentage = percentage - self.percentile = percentile - } - public enum CodingKeys: String, CodingKey { - case percentage - case percentile - } - } - /// - Remark: Generated from `#/components/schemas/global-advisory/epss`. - public var epss: Components.Schemas.global_hyphen_advisory.epssPayload? /// - Remark: Generated from `#/components/schemas/global-advisory/creditsPayload`. public struct creditsPayloadPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/global-advisory/creditsPayload/user`. @@ -928,8 +930,8 @@ public enum Components { /// - vulnerabilities: The products and respective version ranges affected by the advisory. /// - cvss: /// - cvss_severities: - /// - cwes: /// - epss: + /// - cwes: /// - credits: The users who contributed to the advisory. public init( ghsa_id: Swift.String, @@ -952,8 +954,8 @@ public enum Components { vulnerabilities: [Components.Schemas.vulnerability]? = nil, cvss: Components.Schemas.global_hyphen_advisory.cvssPayload? = nil, cvss_severities: Components.Schemas.cvss_hyphen_severities? = nil, + epss: Components.Schemas.security_hyphen_advisory_hyphen_epss? = 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 ) { self.ghsa_id = ghsa_id @@ -976,8 +978,8 @@ public enum Components { self.vulnerabilities = vulnerabilities self.cvss = cvss self.cvss_severities = cvss_severities - self.cwes = cwes self.epss = epss + self.cwes = cwes self.credits = credits } public enum CodingKeys: String, CodingKey { @@ -1001,8 +1003,8 @@ public enum Components { case vulnerabilities case cvss case cvss_severities - case cwes case epss + case cwes case credits } public init(from decoder: any Decoder) throws { @@ -1087,14 +1089,14 @@ public enum Components { Components.Schemas.cvss_hyphen_severities.self, forKey: .cvss_severities ) + epss = try container.decodeIfPresent( + Components.Schemas.security_hyphen_advisory_hyphen_epss.self, + forKey: .epss + ) cwes = try container.decodeIfPresent( Components.Schemas.global_hyphen_advisory.cwesPayload.self, forKey: .cwes ) - epss = try container.decodeIfPresent( - Components.Schemas.global_hyphen_advisory.epssPayload.self, - forKey: .epss - ) credits = try container.decodeIfPresent( Components.Schemas.global_hyphen_advisory.creditsPayload.self, forKey: .credits @@ -1120,8 +1122,8 @@ public enum Components { "vulnerabilities", "cvss", "cvss_severities", - "cwes", "epss", + "cwes", "credits" ]) } @@ -1194,151 +1196,6 @@ public enum Components { case errors } } - /// A GitHub user. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. - public var avatar_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatar_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followers_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var following_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gists_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starred_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptions_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizations_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var repos_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var received_events_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. - public var _type: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. - 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: - /// - name: - /// - email: - /// - login: - /// - id: - /// - node_id: - /// - avatar_url: - /// - gravatar_id: - /// - url: - /// - html_url: - /// - followers_url: - /// - following_url: - /// - gists_url: - /// - starred_url: - /// - subscriptions_url: - /// - organizations_url: - /// - repos_url: - /// - events_url: - /// - received_events_url: - /// - _type: - /// - site_admin: - /// - starred_at: - /// - user_view_type: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - node_id: Swift.String, - avatar_url: Swift.String, - gravatar_id: Swift.String? = nil, - url: Swift.String, - html_url: Swift.String, - followers_url: Swift.String, - following_url: Swift.String, - gists_url: Swift.String, - starred_url: Swift.String, - subscriptions_url: Swift.String, - organizations_url: Swift.String, - repos_url: Swift.String, - events_url: Swift.String, - received_events_url: Swift.String, - _type: Swift.String, - site_admin: Swift.Bool, - starred_at: Swift.String? = nil, - user_view_type: Swift.String? = nil - ) { - self.name = name - self.email = email - self.login = login - self.id = id - self.node_id = node_id - self.avatar_url = avatar_url - self.gravatar_id = gravatar_id - self.url = url - self.html_url = html_url - self.followers_url = followers_url - self.following_url = following_url - self.gists_url = gists_url - self.starred_url = starred_url - self.subscriptions_url = subscriptions_url - self.organizations_url = organizations_url - self.repos_url = repos_url - self.events_url = events_url - self.received_events_url = received_events_url - 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 - case email - case login - case id - case node_id - case avatar_url - case gravatar_id - case url - case html_url - case followers_url - case following_url - case gists_url - case starred_url - case subscriptions_url - case organizations_url - case repos_url - case events_url - case received_events_url - case _type = "type" - case site_admin - case starred_at - case user_view_type - } - } /// Scim Error /// /// - Remark: Generated from `#/components/schemas/scim-error`. @@ -1513,37 +1370,182 @@ public enum Components { case errors } } - /// License Simple + /// A GitHub user. /// - /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. - public struct nullable_hyphen_license_hyphen_simple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. - public var key: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. - public var spdx_id: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct nullable_hyphen_simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. - public var html_url: Swift.String? - /// Creates a new `nullable_hyphen_license_hyphen_simple`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + 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: - /// - key: /// - name: - /// - url: - /// - spdx_id: + /// - email: + /// - login: + /// - id: /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: /// - html_url: - public init( - key: Swift.String, - name: Swift.String, - url: Swift.String? = nil, - spdx_id: Swift.String? = nil, - node_id: Swift.String, + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } + /// License Simple + /// + /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. + public struct nullable_hyphen_license_hyphen_simple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. + public var spdx_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. + public var html_url: Swift.String? + /// Creates a new `nullable_hyphen_license_hyphen_simple`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - spdx_id: + /// - node_id: + /// - html_url: + public init( + key: Swift.String, + name: Swift.String, + url: Swift.String? = nil, + spdx_id: Swift.String? = nil, + node_id: Swift.String, html_url: Swift.String? = nil ) { self.key = key @@ -2302,302 +2304,57 @@ public enum Components { case anonymous_access_enabled } } - /// Groups of organization members that gives permissions on specified repositories. + /// A GitHub repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { - /// Unique identifier of the team + /// - Remark: Generated from `#/components/schemas/simple-repository`. + public struct simple_hyphen_repository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var node_id: Swift.String - /// URL for the team + /// - Remark: Generated from `#/components/schemas/simple-repository/id`. + public var id: Swift.Int64 + /// The GraphQL identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var members_url: Swift.String - /// Name of the team + /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. + public var node_id: Swift.String + /// The name of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + /// - Remark: Generated from `#/components/schemas/simple-repository/name`. public var name: Swift.String - /// Description of the team + /// The full, globally unique, name of the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// Whether the repository is private. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. + public var html_url: Swift.String + /// The repository description. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/description`. public var description: Swift.String? - /// Permission that the team will have for its repositories + /// Whether the repository is a fork. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have + /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. + public var fork: Swift.Bool + /// The URL to get more information about the repository from the GitHub API. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set + /// - Remark: Generated from `#/components/schemas/simple-repository/url`. + public var url: Swift.String + /// A template for the API URL to download the repository as an archive. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment + /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. + public var archive_url: Swift.String + /// A template for the API URL to list the available assignees for issues in the repository. /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldap_dn: Swift.String? - /// Creates a new `nullable_hyphen_team_hyphen_simple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - node_id: - /// - url: URL for the team - /// - members_url: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notification_setting: The notification setting the team has set - /// - html_url: - /// - repositories_url: - /// - slug: - /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - node_id: Swift.String, - url: Swift.String, - members_url: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - html_url: Swift.String, - repositories_url: Swift.String, - slug: Swift.String, - ldap_dn: Swift.String? = nil - ) { - self.id = id - self.node_id = node_id - self.url = url - self.members_url = members_url - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notification_setting = notification_setting - self.html_url = html_url - self.repositories_url = repositories_url - self.slug = slug - self.ldap_dn = ldap_dn - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case url - case members_url - case name - case description - case permission - case privacy - case notification_setting - case html_url - case repositories_url - case slug - case ldap_dn - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var node_id: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notification_setting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct permissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `permissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.team.permissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var html_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var members_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositories_url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? - /// Creates a new `team`. - /// - /// - Parameters: - /// - id: - /// - node_id: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notification_setting: - /// - permission: - /// - permissions: - /// - url: - /// - html_url: - /// - members_url: - /// - repositories_url: - /// - parent: - public init( - id: Swift.Int, - node_id: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notification_setting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.team.permissionsPayload? = nil, - url: Swift.String, - html_url: Swift.String, - members_url: Swift.String, - repositories_url: Swift.String, - parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil - ) { - self.id = id - self.node_id = node_id - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notification_setting = notification_setting - self.permission = permission - self.permissions = permissions - self.url = url - self.html_url = html_url - self.members_url = members_url - self.repositories_url = repositories_url - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case node_id - case name - case slug - case description - case privacy - case notification_setting - case permission - case permissions - case url - case html_url - case members_url - case repositories_url - case parent - } - } - /// A GitHub repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository`. - public struct simple_hyphen_repository: Codable, Hashable, Sendable { - /// A unique identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/id`. - public var id: Swift.Int64 - /// The GraphQL identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. - public var node_id: Swift.String - /// The name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/name`. - public var name: Swift.String - /// The full, globally unique, name of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. - public var owner: Components.Schemas.simple_hyphen_user - /// Whether the repository is private. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/private`. - public var _private: Swift.Bool - /// The URL to view the repository on GitHub.com. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. - public var html_url: Swift.String - /// The repository description. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/description`. - public var description: Swift.String? - /// Whether the repository is a fork. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. - public var fork: Swift.Bool - /// The URL to get more information about the repository from the GitHub API. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/url`. - public var url: Swift.String - /// A template for the API URL to download the repository as an archive. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. - public var archive_url: Swift.String - /// A template for the API URL to list the available assignees for issues in the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. - public var assignees_url: Swift.String - /// A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. + public var assignees_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git blob in the repository. /// /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. public var blobs_url: Swift.String @@ -2950,6 +2707,28 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public struct code_securityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? + /// Creates a new `code_securityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload.statusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_securityPayload? /// Enable or disable Dependabot security updates for the repository. /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. @@ -3072,6 +2851,7 @@ public enum Components { /// /// - Parameters: /// - advanced_security: + /// - code_security: /// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository. /// - secret_scanning: /// - secret_scanning_push_protection: @@ -3079,6 +2859,7 @@ public enum Components { /// - secret_scanning_ai_detection: public init( advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil, + code_security: Components.Schemas.security_hyphen_and_hyphen_analysis.code_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, @@ -3086,6 +2867,7 @@ public enum Components { secret_scanning_ai_detection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_ai_detectionPayload? = nil ) { self.advanced_security = advanced_security + self.code_security = code_security self.dependabot_security_updates = dependabot_security_updates self.secret_scanning = secret_scanning self.secret_scanning_push_protection = secret_scanning_push_protection @@ -3094,6 +2876,7 @@ public enum Components { } public enum CodingKeys: String, CodingKey { case advanced_security + case code_security case dependabot_security_updates case secret_scanning case secret_scanning_push_protection @@ -3101,6 +2884,251 @@ public enum Components { case secret_scanning_ai_detection } } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } /// A repository on GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-repository`. From 57ec12f48aee6cb2ac3d0bb800f697239bc5b03b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:54:00 +0000 Subject: [PATCH 29/37] Commit via running ake Sources/code-security --- Sources/code-security/Client.swift | 1173 +++++++ Sources/code-security/Types.swift | 5242 ++++++++++++++++++++++------ 2 files changed, 5421 insertions(+), 994 deletions(-) diff --git a/Sources/code-security/Client.swift b/Sources/code-security/Client.swift index a6275de7d16..19252b69598 100644 --- a/Sources/code-security/Client.swift +++ b/Sources/code-security/Client.swift @@ -38,6 +38,1179 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get code security configurations for an enterprise + /// + /// Lists all code security configurations available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations", + parameters: [ + input.path.enterprise + ] + ) + 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: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + 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.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.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.code_hyphen_security_hyphen_configuration].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 + ) + ) + } + } + ) + } + /// Create a code security configuration for an enterprise + /// + /// Creates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)`. + public func code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations", + parameters: [ + input.path.enterprise + ] + ) + 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.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.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.code_hyphen_security_hyphen_configuration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.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 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 default code security configurations for an enterprise + /// + /// Lists the default code security configurations for an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/defaults/get(code-security/get-default-configurations-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/defaults", + parameters: [ + input.path.enterprise + ] + ) + 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.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.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.code_hyphen_security_hyphen_default_hyphen_configurations.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 + ) + ) + } + } + ) + } + /// Retrieve a code security configuration of an enterprise + /// + /// Gets a code security configuration available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}", + parameters: [ + input.path.enterprise, + input.path.configuration_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.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.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.code_hyphen_security_hyphen_configuration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + 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 + ) + ) + } + } + ) + } + /// Update a custom code security configuration for an enterprise + /// + /// Updates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)`. + public func code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}", + parameters: [ + input.path.enterprise, + input.path.configuration_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.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.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.code_hyphen_security_hyphen_configuration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + 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 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.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 .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a code security configuration for an enterprise + /// + /// Deletes a code security configuration from an enterprise. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)`. + public func code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}", + parameters: [ + input.path.enterprise, + input.path.configuration_id + ] + ) + 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 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 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 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.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 .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Attach an enterprise configuration to repositories + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)`. + public func code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}/attach", + parameters: [ + input.path.enterprise, + input.path.configuration_id + ] + ) + 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 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 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 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.conflict.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 .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set a code security configuration as a default for an enterprise + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise. + /// + /// This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)`. + public func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}/defaults", + parameters: [ + input.path.enterprise, + input.path.configuration_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + 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.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.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)) + 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 repositories associated with an enterprise code security configuration + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)`. + public func code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/code-security/configurations/{}/repositories", + parameters: [ + input.path.enterprise, + input.path.configuration_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: "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, + explode: true, + name: "status", + value: input.query.status + ) + 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.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.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.code_hyphen_security_hyphen_configuration_hyphen_repositories].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 code security configurations for an organization /// /// Lists all code security configurations available in an organization. diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index f895f094728..f32aebc6b2d 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -11,6 +11,111 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get code security configurations for an enterprise + /// + /// Lists all code security configurations available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-for-enterprise)`. + func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output + /// Create a code security configuration for an enterprise + /// + /// Creates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)`. + func code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output + /// Get default code security configurations for an enterprise + /// + /// Lists the default code security configurations for an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/defaults/get(code-security/get-default-configurations-for-enterprise)`. + func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Output + /// Retrieve a code security configuration of an enterprise + /// + /// Gets a code security configuration available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)`. + func code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output + /// Update a custom code security configuration for an enterprise + /// + /// Updates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)`. + func code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output + /// Delete a code security configuration for an enterprise + /// + /// Deletes a code security configuration from an enterprise. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)`. + func code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Output + /// Attach an enterprise configuration to repositories + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)`. + func code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Output + /// Set a code security configuration as a default for an enterprise + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise. + /// + /// This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)`. + func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise(_ input: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output + /// Get repositories associated with an enterprise code security configuration + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)`. + func code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output /// Get code security configurations for an organization /// /// Lists all code security configurations available in an organization. @@ -143,6 +248,195 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get code security configurations for an enterprise + /// + /// Lists all code security configurations available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a code security configuration for an enterprise + /// + /// Creates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)`. + public func code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get default code security configurations for an enterprise + /// + /// Lists the default code security configurations for an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/defaults/get(code-security/get-default-configurations-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input( + path: path, + headers: headers + )) + } + /// Retrieve a code security configuration of an enterprise + /// + /// Gets a code security configuration available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)`. + public func code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input( + path: path, + headers: headers + )) + } + /// Update a custom code security configuration for an enterprise + /// + /// Updates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)`. + public func code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration( + path: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output { + try await code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration(Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a code security configuration for an enterprise + /// + /// Deletes a code security configuration from an enterprise. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)`. + public func code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input( + path: path, + headers: headers + )) + } + /// Attach an enterprise configuration to repositories + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)`. + public func code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration( + path: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Output { + try await code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration(Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set a code security configuration as a default for an enterprise + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise. + /// + /// This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)`. + public func code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise( + path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body + ) async throws -> Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output { + try await code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get repositories associated with an enterprise code security configuration + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)`. + public func code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration( + path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output { + try await code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration(Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input( + path: path, + query: query, + headers: headers + )) + } /// Get code security configurations for an organization /// /// Lists all code security configurations available in an organization. @@ -620,1166 +914,3996 @@ public enum Components { case schemas } } - /// A GitHub repository. + /// A code security configuration /// - /// - Remark: Generated from `#/components/schemas/simple-repository`. - public struct simple_hyphen_repository: Codable, Hashable, Sendable { - /// A unique identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/id`. - public var id: Swift.Int64 - /// The GraphQL identifier of the repository. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. - public var node_id: Swift.String - /// The name of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration`. + public struct code_hyphen_security_hyphen_configuration: Codable, Hashable, Sendable { + /// The ID of the code security configuration /// - /// - Remark: Generated from `#/components/schemas/simple-repository/name`. - public var name: Swift.String - /// The full, globally unique, name of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/id`. + public var id: Swift.Int? + /// The name of the code security configuration. Must be unique within the organization. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. - public var full_name: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. - public var owner: Components.Schemas.simple_hyphen_user - /// Whether the repository is private. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/name`. + public var name: Swift.String? + /// The type of the code security configuration. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/private`. - public var _private: Swift.Bool - /// The URL to view the repository on GitHub.com. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. + @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. /// - /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. - public var html_url: Swift.String - /// The repository description. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. + public var target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? + /// A description of the code security configuration /// - /// - Remark: Generated from `#/components/schemas/simple-repository/description`. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/description`. public var description: Swift.String? - /// Whether the repository is a fork. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. - public var fork: Swift.Bool - /// The URL to get more information about the repository from the GitHub API. - /// - /// - Remark: Generated from `#/components/schemas/simple-repository/url`. - public var url: Swift.String - /// A template for the API URL to download the repository as an archive. + /// The enablement status of GitHub Advanced Security /// - /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. - public var archive_url: Swift.String - /// A template for the API URL to list the available assignees for issues in the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case code_security = "code_security" + case secret_protection = "secret_protection" + } + /// The enablement status of GitHub Advanced Security /// - /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. - public var assignees_url: Swift.String - /// A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. + public var advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? + /// The enablement status of Dependency Graph /// - /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. - public var blobs_url: Swift.String - /// A template for the API URL to get information about branches in the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph /// - /// - Remark: Generated from `#/components/schemas/simple-repository/branches_url`. - public var branches_url: Swift.String - /// A template for the API URL to get information about collaborators of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. + public var dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? + /// The enablement status of Automatic dependency submission /// - /// - Remark: Generated from `#/components/schemas/simple-repository/collaborators_url`. - public var collaborators_url: Swift.String - /// A template for the API URL to get information about comments on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission /// - /// - Remark: Generated from `#/components/schemas/simple-repository/comments_url`. - public var comments_url: Swift.String - /// A template for the API URL to get information about commits on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission /// - /// - Remark: Generated from `#/components/schemas/simple-repository/commits_url`. - public var commits_url: Swift.String - /// A template for the API URL to compare two commits or refs. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission /// - /// - Remark: Generated from `#/components/schemas/simple-repository/compare_url`. - public var compare_url: Swift.String - /// A template for the API URL to get the contents of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? + /// The enablement status of Dependabot alerts /// - /// - Remark: Generated from `#/components/schemas/simple-repository/contents_url`. - public var contents_url: Swift.String - /// A template for the API URL to list the contributors to the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts /// - /// - Remark: Generated from `#/components/schemas/simple-repository/contributors_url`. - public var contributors_url: Swift.String - /// The API URL to list the deployments of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. + public var dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates /// - /// - Remark: Generated from `#/components/schemas/simple-repository/deployments_url`. - public var deployments_url: Swift.String - /// The API URL to list the downloads on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates /// - /// - Remark: Generated from `#/components/schemas/simple-repository/downloads_url`. - public var downloads_url: Swift.String - /// The API URL to list the events of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. + public var dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup /// - /// - Remark: Generated from `#/components/schemas/simple-repository/events_url`. - public var events_url: Swift.String - /// The API URL to list the forks of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup /// - /// - Remark: Generated from `#/components/schemas/simple-repository/forks_url`. - public var forks_url: Swift.String - /// A template for the API URL to get information about Git commits of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. + public var code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? + /// Feature options for code scanning default setup /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_commits_url`. - public var git_commits_url: Swift.String - /// A template for the API URL to get information about Git refs of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options`. + public struct code_scanning_default_setup_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use labeled runners or standard GitHub runners. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_type`. + @frozen public enum runner_typePayload: String, Codable, Hashable, Sendable { + case standard = "standard" + case labeled = "labeled" + case not_set = "not_set" + } + /// Whether to use labeled runners or standard GitHub runners. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_type`. + public var runner_type: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload.runner_typePayload? + /// The label of the runner to use for code scanning when runner_type is 'labeled'. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_label`. + public var runner_label: Swift.String? + /// Creates a new `code_scanning_default_setup_optionsPayload`. + /// + /// - Parameters: + /// - runner_type: Whether to use labeled runners or standard GitHub runners. + /// - runner_label: The label of the runner to use for code scanning when runner_type is 'labeled'. + public init( + runner_type: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload.runner_typePayload? = nil, + runner_label: Swift.String? = nil + ) { + self.runner_type = runner_type + self.runner_label = runner_label + } + public enum CodingKeys: String, CodingKey { + case runner_type + case runner_label + } + } + /// Feature options for code scanning default setup /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_refs_url`. - public var git_refs_url: Swift.String - /// A template for the API URL to get information about Git tags of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options`. + public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload? + /// The enablement status of code scanning delegated alert dismissal /// - /// - Remark: Generated from `#/components/schemas/simple-repository/git_tags_url`. - public var git_tags_url: Swift.String - /// A template for the API URL to get information about issue comments on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_delegated_alert_dismissal`. + @frozen public enum code_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning delegated alert dismissal /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issue_comment_url`. - public var issue_comment_url: Swift.String - /// A template for the API URL to get information about issue events on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_delegated_alert_dismissal`. + public var code_scanning_delegated_alert_dismissal: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_delegated_alert_dismissalPayload? + /// The enablement status of secret scanning /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issue_events_url`. - public var issue_events_url: Swift.String - /// A template for the API URL to get information about issues on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning /// - /// - Remark: Generated from `#/components/schemas/simple-repository/issues_url`. - public var issues_url: Swift.String - /// A template for the API URL to get information about deploy keys on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. + public var secret_scanning: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanningPayload? + /// The enablement status of secret scanning push protection /// - /// - Remark: Generated from `#/components/schemas/simple-repository/keys_url`. - public var keys_url: Swift.String - /// A template for the API URL to get information about labels of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection /// - /// - Remark: Generated from `#/components/schemas/simple-repository/labels_url`. - public var labels_url: Swift.String - /// The API URL to get information about the languages of the repository. + /// - 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/simple-repository/languages_url`. - public var languages_url: Swift.String - /// The API URL to merge branches in the repository. + /// - 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/simple-repository/merges_url`. - public var merges_url: Swift.String - /// A template for the API URL to get information about milestones of the repository. + /// - 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/simple-repository/milestones_url`. - public var milestones_url: Swift.String - /// A template for the API URL to get information about notifications on the repository. + /// - 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/simple-repository/notifications_url`. - public var notifications_url: Swift.String - /// A template for the API URL to get information about pull requests on the repository. + /// - 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/simple-repository/pulls_url`. - public var pulls_url: Swift.String - /// A template for the API URL to get information about releases on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_validity_checks`. + @frozen public enum secret_scanning_validity_checksPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning validity checks /// - /// - Remark: Generated from `#/components/schemas/simple-repository/releases_url`. - public var releases_url: Swift.String - /// The API URL to list the stargazers on the repository. + /// - 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/simple-repository/stargazers_url`. - public var stargazers_url: Swift.String - /// A template for the API URL to get information about statuses of a commit. + /// - 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/simple-repository/statuses_url`. - public var statuses_url: Swift.String - /// The API URL to list the subscribers on the repository. + /// - 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 Copilot secret scanning /// - /// - Remark: Generated from `#/components/schemas/simple-repository/subscribers_url`. - public var subscribers_url: Swift.String - /// The API URL to subscribe to notifications for this repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_generic_secrets`. + @frozen public enum secret_scanning_generic_secretsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Copilot secret scanning /// - /// - Remark: Generated from `#/components/schemas/simple-repository/subscription_url`. - public var subscription_url: Swift.String - /// The API URL to get information about tags on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_generic_secrets`. + public var secret_scanning_generic_secrets: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_generic_secretsPayload? + /// The enablement status of secret scanning delegated alert dismissal /// - /// - Remark: Generated from `#/components/schemas/simple-repository/tags_url`. - public var tags_url: Swift.String - /// The API URL to list the teams on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_alert_dismissal`. + @frozen public enum secret_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated alert dismissal /// - /// - Remark: Generated from `#/components/schemas/simple-repository/teams_url`. - public var teams_url: Swift.String - /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_delegated_alert_dismissal`. + public var secret_scanning_delegated_alert_dismissal: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_alert_dismissalPayload? + /// The enablement status of private vulnerability reporting /// - /// - Remark: Generated from `#/components/schemas/simple-repository/trees_url`. - public var trees_url: Swift.String - /// The API URL to list the hooks on the repository. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting /// - /// - Remark: Generated from `#/components/schemas/simple-repository/hooks_url`. - public var hooks_url: Swift.String - /// Creates a new `simple_hyphen_repository`. + /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Components.Schemas.code_hyphen_security_hyphen_configuration.private_vulnerability_reportingPayload? + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/enforcement`. + @frozen public enum enforcementPayload: String, Codable, Hashable, Sendable { + case enforced = "enforced" + case unenforced = "unenforced" + } + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/enforcement`. + public var enforcement: Components.Schemas.code_hyphen_security_hyphen_configuration.enforcementPayload? + /// The URL of the configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/url`. + public var url: Swift.String? + /// The URL of the configuration + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/html_url`. + public var html_url: Swift.String? + /// - Remark: Generated from `#/components/schemas/code-security-configuration/created_at`. + public var created_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/code-security-configuration/updated_at`. + public var updated_at: Foundation.Date? + /// Creates a new `code_hyphen_security_hyphen_configuration`. /// /// - Parameters: - /// - id: A unique identifier of the repository. - /// - node_id: The GraphQL identifier of the repository. - /// - name: The name of the repository. - /// - full_name: The full, globally unique, name of the repository. - /// - owner: - /// - _private: Whether the repository is private. - /// - html_url: The URL to view the repository on GitHub.com. - /// - description: The repository description. - /// - fork: Whether the repository is a fork. - /// - url: The URL to get more information about the repository from the GitHub API. - /// - archive_url: A template for the API URL to download the repository as an archive. - /// - assignees_url: A template for the API URL to list the available assignees for issues in the repository. - /// - blobs_url: A template for the API URL to create or retrieve a raw Git blob in the repository. - /// - branches_url: A template for the API URL to get information about branches in the repository. - /// - collaborators_url: A template for the API URL to get information about collaborators of the repository. - /// - comments_url: A template for the API URL to get information about comments on the repository. - /// - commits_url: A template for the API URL to get information about commits on the repository. - /// - compare_url: A template for the API URL to compare two commits or refs. - /// - contents_url: A template for the API URL to get the contents of the repository. - /// - contributors_url: A template for the API URL to list the contributors to the repository. - /// - deployments_url: The API URL to list the deployments of the repository. - /// - downloads_url: The API URL to list the downloads on the repository. - /// - events_url: The API URL to list the events of the repository. - /// - forks_url: The API URL to list the forks of the repository. - /// - git_commits_url: A template for the API URL to get information about Git commits of the repository. - /// - git_refs_url: A template for the API URL to get information about Git refs of the repository. - /// - git_tags_url: A template for the API URL to get information about Git tags of the repository. - /// - issue_comment_url: A template for the API URL to get information about issue comments on the repository. - /// - issue_events_url: A template for the API URL to get information about issue events on the repository. - /// - issues_url: A template for the API URL to get information about issues on the repository. - /// - keys_url: A template for the API URL to get information about deploy keys on the repository. - /// - labels_url: A template for the API URL to get information about labels of the repository. - /// - languages_url: The API URL to get information about the languages of the repository. - /// - merges_url: The API URL to merge branches in the repository. - /// - milestones_url: A template for the API URL to get information about milestones of the repository. - /// - notifications_url: A template for the API URL to get information about notifications on the repository. - /// - pulls_url: A template for the API URL to get information about pull requests on the repository. - /// - releases_url: A template for the API URL to get information about releases on the repository. - /// - stargazers_url: The API URL to list the stargazers on the repository. - /// - statuses_url: A template for the API URL to get information about statuses of a commit. - /// - subscribers_url: The API URL to list the subscribers on the repository. - /// - subscription_url: The API URL to subscribe to notifications for this repository. - /// - tags_url: The API URL to get information about tags on the repository. - /// - teams_url: The API URL to list the teams on the repository. - /// - trees_url: A template for the API URL to create or retrieve a raw Git tree of the repository. - /// - hooks_url: The API URL to list the hooks on the repository. + /// - id: The ID of the code security configuration + /// - name: The name of the code security configuration. Must be unique within the organization. + /// - target_type: The type of the code security configuration. + /// - description: A description of the code security configuration + /// - advanced_security: The enablement status of GitHub Advanced Security + /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission + /// - dependabot_alerts: The enablement status of Dependabot alerts + /// - dependabot_security_updates: The enablement status of Dependabot security updates + /// - code_scanning_default_setup: The enablement status of code scanning default setup + /// - code_scanning_default_setup_options: Feature options for code scanning default setup + /// - code_scanning_delegated_alert_dismissal: The enablement status of code scanning delegated alert dismissal + /// - 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 + /// - secret_scanning_generic_secrets: The enablement status of Copilot secret scanning + /// - secret_scanning_delegated_alert_dismissal: The enablement status of secret scanning delegated alert dismissal + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + /// - enforcement: The enforcement status for a security configuration + /// - url: The URL of the configuration + /// - html_url: The URL of the configuration + /// - created_at: + /// - updated_at: public init( - id: Swift.Int64, - node_id: Swift.String, - name: Swift.String, - full_name: Swift.String, - owner: Components.Schemas.simple_hyphen_user, - _private: Swift.Bool, - html_url: Swift.String, + id: Swift.Int? = nil, + name: Swift.String? = nil, + target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? = nil, description: Swift.String? = nil, - fork: Swift.Bool, - url: Swift.String, - 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, - downloads_url: Swift.String, - events_url: Swift.String, - forks_url: Swift.String, - git_commits_url: Swift.String, - git_refs_url: Swift.String, - git_tags_url: 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, - notifications_url: Swift.String, - 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, - hooks_url: Swift.String + advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? = nil, + dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? = nil, + dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? = nil, + dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? = nil, + code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? = nil, + code_scanning_default_setup_options: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload? = nil, + code_scanning_delegated_alert_dismissal: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_delegated_alert_dismissalPayload? = 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, + secret_scanning_generic_secrets: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_generic_secretsPayload? = nil, + secret_scanning_delegated_alert_dismissal: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanning_delegated_alert_dismissalPayload? = 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, + html_url: Swift.String? = nil, + created_at: Foundation.Date? = nil, + updated_at: Foundation.Date? = nil ) { self.id = id - self.node_id = node_id self.name = name - self.full_name = full_name - self.owner = owner - self._private = _private - self.html_url = html_url + self.target_type = target_type self.description = description - self.fork = fork + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.code_scanning_default_setup_options = code_scanning_default_setup_options + self.code_scanning_delegated_alert_dismissal = code_scanning_delegated_alert_dismissal + 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.secret_scanning_generic_secrets = secret_scanning_generic_secrets + self.secret_scanning_delegated_alert_dismissal = secret_scanning_delegated_alert_dismissal + self.private_vulnerability_reporting = private_vulnerability_reporting + self.enforcement = enforcement self.url = url - 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.downloads_url = downloads_url - self.events_url = events_url - self.forks_url = forks_url - self.git_commits_url = git_commits_url - self.git_refs_url = git_refs_url - self.git_tags_url = git_tags_url - 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.notifications_url = notifications_url - 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.hooks_url = hooks_url + self.html_url = html_url + self.created_at = created_at + self.updated_at = updated_at } public enum CodingKeys: String, CodingKey { case id - case node_id case name - case full_name - case owner - case _private = "private" - case html_url + case target_type case description - case fork + case advanced_security + case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case code_scanning_default_setup_options + case code_scanning_delegated_alert_dismissal + 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 secret_scanning_generic_secrets + case secret_scanning_delegated_alert_dismissal + case private_vulnerability_reporting + case enforcement case url - 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 downloads_url - case events_url - case forks_url - case git_commits_url - case git_refs_url - case git_tags_url - 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 notifications_url - 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 hooks_url + case html_url + case created_at + case updated_at } } - /// A code security configuration + /// Feature options for code scanning default setup /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration`. - public struct code_hyphen_security_hyphen_configuration: Codable, Hashable, Sendable { - /// The ID of the code security configuration - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/id`. - public var id: Swift.Int? - /// The name of the code security configuration. Must be unique within the organization. - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/name`. - public var name: Swift.String? - /// The type of the code security configuration. + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options`. + public struct code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options: Codable, Hashable, Sendable { + /// Whether to use labeled runners or standard GitHub runners. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. - @frozen public enum target_typePayload: String, Codable, Hashable, Sendable { - case global = "global" - case organization = "organization" - case enterprise = "enterprise" + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options/runner_type`. + @frozen public enum runner_typePayload: String, Codable, Hashable, Sendable { + case standard = "standard" + case labeled = "labeled" + case not_set = "not_set" } - /// The type of the code security configuration. + /// Whether to use labeled runners or standard GitHub runners. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/target_type`. - public var target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? - /// A description of the code security configuration + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options/runner_type`. + public var runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.runner_typePayload? + /// The label of the runner to use for code scanning default setup when runner_type is 'labeled'. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/description`. - public var description: Swift.String? - /// The enablement status of GitHub Advanced Security + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options/runner_label`. + public var runner_label: Swift.String? + /// Creates a new `code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options`. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. - @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" + /// - Parameters: + /// - runner_type: Whether to use labeled runners or standard GitHub runners. + /// - runner_label: The label of the runner to use for code scanning default setup when runner_type is 'labeled'. + public init( + runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.runner_typePayload? = nil, + runner_label: Swift.String? = nil + ) { + self.runner_type = runner_type + self.runner_label = runner_label } - /// The enablement status of GitHub Advanced Security + public enum CodingKeys: String, CodingKey { + case runner_type + case runner_label + } + } + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations`. + public struct code_hyphen_security_hyphen_default_hyphen_configurationsPayload: Codable, Hashable, Sendable { + /// The visibility of newly created repositories for which the code security configuration will be applied to by default /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/advanced_security`. - public var advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? - /// The enablement status of Dependency Graph + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/default_for_new_repos`. + public var default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? + /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `code_hyphen_security_hyphen_default_hyphen_configurationsPayload`. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. - @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" + /// - Parameters: + /// - default_for_new_repos: The visibility of newly created repositories for which the code security configuration will be applied to by default + /// - configuration: + public init( + default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.default_for_new_repos = default_for_new_repos + self.configuration = configuration } - /// The enablement status of Dependency Graph + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + case configuration + } + } + /// A list of default code security configurations + /// + /// - Remark: Generated from `#/components/schemas/code-security-default-configurations`. + public typealias code_hyphen_security_hyphen_default_hyphen_configurations = [Components.Schemas.code_hyphen_security_hyphen_default_hyphen_configurationsPayload] + /// A GitHub repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository`. + public struct simple_hyphen_repository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph`. - public var dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? - /// The enablement status of Automatic dependency submission + /// - Remark: Generated from `#/components/schemas/simple-repository/id`. + public var id: Swift.Int64 + /// The GraphQL identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. - @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of Automatic dependency submission + /// - Remark: Generated from `#/components/schemas/simple-repository/node_id`. + public var node_id: Swift.String + /// The name of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action`. - public var dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? - /// Feature options for Automatic dependency submission + /// - Remark: Generated from `#/components/schemas/simple-repository/name`. + public var name: Swift.String + /// The full, globally unique, name of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. - public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { - /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options/labeled_runners`. - public var labeled_runners: Swift.Bool? - /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. - /// - /// - Parameters: - /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. - public init(labeled_runners: Swift.Bool? = nil) { - self.labeled_runners = labeled_runners - } - public enum CodingKeys: String, CodingKey { - case labeled_runners - } - } - /// Feature options for Automatic dependency submission + /// - Remark: Generated from `#/components/schemas/simple-repository/full_name`. + public var full_name: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-repository/owner`. + public var owner: Components.Schemas.simple_hyphen_user + /// Whether the repository is private. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependency_graph_autosubmit_action_options`. - public var dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? - /// The enablement status of Dependabot alerts + /// - Remark: Generated from `#/components/schemas/simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. - @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of Dependabot alerts + /// - Remark: Generated from `#/components/schemas/simple-repository/html_url`. + public var html_url: Swift.String + /// The repository description. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_alerts`. - public var dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? - /// The enablement status of Dependabot security updates + /// - Remark: Generated from `#/components/schemas/simple-repository/description`. + public var description: Swift.String? + /// Whether the repository is a fork. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. - @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of Dependabot security updates + /// - Remark: Generated from `#/components/schemas/simple-repository/fork`. + public var fork: Swift.Bool + /// The URL to get more information about the repository from the GitHub API. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. - public var dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? - /// The enablement status of code scanning default setup + /// - Remark: Generated from `#/components/schemas/simple-repository/url`. + public var url: Swift.String + /// A template for the API URL to download the repository as an archive. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. - @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of code scanning default setup + /// - Remark: Generated from `#/components/schemas/simple-repository/archive_url`. + public var archive_url: Swift.String + /// A template for the API URL to list the available assignees for issues in the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. - public var code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? - /// Feature options for code scanning default setup + /// - Remark: Generated from `#/components/schemas/simple-repository/assignees_url`. + public var assignees_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git blob in the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options`. - public struct code_scanning_default_setup_optionsPayload: Codable, Hashable, Sendable { - /// Whether to use labeled runners or standard GitHub runners. - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_type`. - @frozen public enum runner_typePayload: String, Codable, Hashable, Sendable { - case standard = "standard" - case labeled = "labeled" - case not_set = "not_set" - } - /// Whether to use labeled runners or standard GitHub runners. - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_type`. - public var runner_type: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload.runner_typePayload? - /// The label of the runner to use for code scanning when runner_type is 'labeled'. - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options/runner_label`. - public var runner_label: Swift.String? - /// Creates a new `code_scanning_default_setup_optionsPayload`. - /// - /// - Parameters: - /// - runner_type: Whether to use labeled runners or standard GitHub runners. - /// - runner_label: The label of the runner to use for code scanning when runner_type is 'labeled'. - public init( - runner_type: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload.runner_typePayload? = nil, - runner_label: Swift.String? = nil - ) { - self.runner_type = runner_type - self.runner_label = runner_label - } - public enum CodingKeys: String, CodingKey { - case runner_type - case runner_label - } - } - /// Feature options for code scanning default setup + /// - Remark: Generated from `#/components/schemas/simple-repository/blobs_url`. + public var blobs_url: Swift.String + /// A template for the API URL to get information about branches in the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup_options`. - public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload? - /// The enablement status of secret scanning + /// - Remark: Generated from `#/components/schemas/simple-repository/branches_url`. + public var branches_url: Swift.String + /// A template for the API URL to get information about collaborators of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. - @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of secret scanning + /// - Remark: Generated from `#/components/schemas/simple-repository/collaborators_url`. + public var collaborators_url: Swift.String + /// A template for the API URL to get information about comments on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning`. - public var secret_scanning: Components.Schemas.code_hyphen_security_hyphen_configuration.secret_scanningPayload? - /// The enablement status of secret scanning push protection + /// - Remark: Generated from `#/components/schemas/simple-repository/comments_url`. + public var comments_url: Swift.String + /// A template for the API URL to get information about commits on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_push_protection`. - @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of secret scanning push protection + /// - Remark: Generated from `#/components/schemas/simple-repository/commits_url`. + public var commits_url: Swift.String + /// A template for the API URL to compare two commits or refs. /// - /// - 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/simple-repository/compare_url`. + public var compare_url: Swift.String + /// A template for the API URL to get the contents of the repository. /// - /// - 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/simple-repository/contents_url`. + public var contents_url: Swift.String + /// A template for the API URL to list the contributors to the repository. /// - /// - 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/simple-repository/contributors_url`. + public var contributors_url: Swift.String + /// The API URL to list the deployments of the repository. /// - /// - 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/simple-repository/deployments_url`. + public var deployments_url: Swift.String + /// The API URL to list the downloads on the repository. /// - /// - 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/simple-repository/downloads_url`. + public var downloads_url: Swift.String + /// The API URL to list the events of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/secret_scanning_validity_checks`. - @frozen public enum secret_scanning_validity_checksPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of secret scanning validity checks + /// - Remark: Generated from `#/components/schemas/simple-repository/events_url`. + public var events_url: Swift.String + /// The API URL to list the forks of the repository. /// - /// - 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/simple-repository/forks_url`. + public var forks_url: Swift.String + /// A template for the API URL to get information about Git commits of the repository. /// - /// - 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/simple-repository/git_commits_url`. + public var git_commits_url: Swift.String + /// A template for the API URL to get information about Git refs of the repository. /// - /// - 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/simple-repository/git_refs_url`. + public var git_refs_url: Swift.String + /// A template for the API URL to get information about Git tags of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. - @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case not_set = "not_set" - } - /// The enablement status of private vulnerability reporting + /// - Remark: Generated from `#/components/schemas/simple-repository/git_tags_url`. + public var git_tags_url: Swift.String + /// A template for the API URL to get information about issue comments on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/private_vulnerability_reporting`. - public var private_vulnerability_reporting: Components.Schemas.code_hyphen_security_hyphen_configuration.private_vulnerability_reportingPayload? - /// The enforcement status for a security configuration + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_comment_url`. + public var issue_comment_url: Swift.String + /// A template for the API URL to get information about issue events on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/enforcement`. - @frozen public enum enforcementPayload: String, Codable, Hashable, Sendable { - case enforced = "enforced" - case unenforced = "unenforced" - } - /// The enforcement status for a security configuration + /// - Remark: Generated from `#/components/schemas/simple-repository/issue_events_url`. + public var issue_events_url: Swift.String + /// A template for the API URL to get information about issues on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/enforcement`. - public var enforcement: Components.Schemas.code_hyphen_security_hyphen_configuration.enforcementPayload? - /// The URL of the configuration + /// - Remark: Generated from `#/components/schemas/simple-repository/issues_url`. + public var issues_url: Swift.String + /// A template for the API URL to get information about deploy keys on the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/url`. - public var url: Swift.String? - /// The URL of the configuration + /// - Remark: Generated from `#/components/schemas/simple-repository/keys_url`. + public var keys_url: Swift.String + /// A template for the API URL to get information about labels of the repository. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration/html_url`. - public var html_url: Swift.String? - /// - Remark: Generated from `#/components/schemas/code-security-configuration/created_at`. - public var created_at: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/code-security-configuration/updated_at`. - public var updated_at: Foundation.Date? - /// Creates a new `code_hyphen_security_hyphen_configuration`. + /// - Remark: Generated from `#/components/schemas/simple-repository/labels_url`. + public var labels_url: Swift.String + /// The API URL to get information about the languages of the repository. /// - /// - Parameters: - /// - id: The ID of the code security configuration - /// - name: The name of the code security configuration. Must be unique within the organization. - /// - target_type: The type of the code security configuration. - /// - description: A description of the code security configuration - /// - advanced_security: The enablement status of GitHub Advanced Security - /// - dependency_graph: The enablement status of Dependency Graph - /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission - /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission - /// - dependabot_alerts: The enablement status of Dependabot alerts - /// - dependabot_security_updates: The enablement status of Dependabot security updates - /// - code_scanning_default_setup: The enablement status of code scanning default setup - /// - code_scanning_default_setup_options: Feature options for 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 - /// - html_url: The URL of the configuration - /// - created_at: - /// - updated_at: + /// - Remark: Generated from `#/components/schemas/simple-repository/languages_url`. + public var languages_url: Swift.String + /// The API URL to merge branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/merges_url`. + public var merges_url: Swift.String + /// A template for the API URL to get information about milestones of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/milestones_url`. + public var milestones_url: Swift.String + /// A template for the API URL to get information about notifications on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/notifications_url`. + public var notifications_url: Swift.String + /// A template for the API URL to get information about pull requests on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/pulls_url`. + public var pulls_url: Swift.String + /// A template for the API URL to get information about releases on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/releases_url`. + public var releases_url: Swift.String + /// The API URL to list the stargazers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/stargazers_url`. + public var stargazers_url: Swift.String + /// A template for the API URL to get information about statuses of a commit. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/statuses_url`. + public var statuses_url: Swift.String + /// The API URL to list the subscribers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscribers_url`. + public var subscribers_url: Swift.String + /// The API URL to subscribe to notifications for this repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/subscription_url`. + public var subscription_url: Swift.String + /// The API URL to get information about tags on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/tags_url`. + public var tags_url: Swift.String + /// The API URL to list the teams on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/teams_url`. + public var teams_url: Swift.String + /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/trees_url`. + public var trees_url: Swift.String + /// The API URL to list the hooks on the repository. + /// + /// - Remark: Generated from `#/components/schemas/simple-repository/hooks_url`. + public var hooks_url: Swift.String + /// Creates a new `simple_hyphen_repository`. + /// + /// - Parameters: + /// - id: A unique identifier of the repository. + /// - node_id: The GraphQL identifier of the repository. + /// - name: The name of the repository. + /// - full_name: The full, globally unique, name of the repository. + /// - owner: + /// - _private: Whether the repository is private. + /// - html_url: The URL to view the repository on GitHub.com. + /// - description: The repository description. + /// - fork: Whether the repository is a fork. + /// - url: The URL to get more information about the repository from the GitHub API. + /// - archive_url: A template for the API URL to download the repository as an archive. + /// - assignees_url: A template for the API URL to list the available assignees for issues in the repository. + /// - blobs_url: A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - branches_url: A template for the API URL to get information about branches in the repository. + /// - collaborators_url: A template for the API URL to get information about collaborators of the repository. + /// - comments_url: A template for the API URL to get information about comments on the repository. + /// - commits_url: A template for the API URL to get information about commits on the repository. + /// - compare_url: A template for the API URL to compare two commits or refs. + /// - contents_url: A template for the API URL to get the contents of the repository. + /// - contributors_url: A template for the API URL to list the contributors to the repository. + /// - deployments_url: The API URL to list the deployments of the repository. + /// - downloads_url: The API URL to list the downloads on the repository. + /// - events_url: The API URL to list the events of the repository. + /// - forks_url: The API URL to list the forks of the repository. + /// - git_commits_url: A template for the API URL to get information about Git commits of the repository. + /// - git_refs_url: A template for the API URL to get information about Git refs of the repository. + /// - git_tags_url: A template for the API URL to get information about Git tags of the repository. + /// - issue_comment_url: A template for the API URL to get information about issue comments on the repository. + /// - issue_events_url: A template for the API URL to get information about issue events on the repository. + /// - issues_url: A template for the API URL to get information about issues on the repository. + /// - keys_url: A template for the API URL to get information about deploy keys on the repository. + /// - labels_url: A template for the API URL to get information about labels of the repository. + /// - languages_url: The API URL to get information about the languages of the repository. + /// - merges_url: The API URL to merge branches in the repository. + /// - milestones_url: A template for the API URL to get information about milestones of the repository. + /// - notifications_url: A template for the API URL to get information about notifications on the repository. + /// - pulls_url: A template for the API URL to get information about pull requests on the repository. + /// - releases_url: A template for the API URL to get information about releases on the repository. + /// - stargazers_url: The API URL to list the stargazers on the repository. + /// - statuses_url: A template for the API URL to get information about statuses of a commit. + /// - subscribers_url: The API URL to list the subscribers on the repository. + /// - subscription_url: The API URL to subscribe to notifications for this repository. + /// - tags_url: The API URL to get information about tags on the repository. + /// - teams_url: The API URL to list the teams on the repository. + /// - trees_url: A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - hooks_url: The API URL to list the hooks on the repository. public init( - id: Swift.Int? = nil, - name: Swift.String? = nil, - target_type: Components.Schemas.code_hyphen_security_hyphen_configuration.target_typePayload? = nil, + id: Swift.Int64, + node_id: Swift.String, + name: Swift.String, + full_name: Swift.String, + owner: Components.Schemas.simple_hyphen_user, + _private: Swift.Bool, + html_url: Swift.String, description: Swift.String? = nil, - advanced_security: Components.Schemas.code_hyphen_security_hyphen_configuration.advanced_securityPayload? = nil, - dependency_graph: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graphPayload? = nil, - dependency_graph_autosubmit_action: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_actionPayload? = nil, - dependency_graph_autosubmit_action_options: Components.Schemas.code_hyphen_security_hyphen_configuration.dependency_graph_autosubmit_action_optionsPayload? = nil, - dependabot_alerts: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_alertsPayload? = nil, - dependabot_security_updates: Components.Schemas.code_hyphen_security_hyphen_configuration.dependabot_security_updatesPayload? = nil, - code_scanning_default_setup: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setupPayload? = nil, - code_scanning_default_setup_options: Components.Schemas.code_hyphen_security_hyphen_configuration.code_scanning_default_setup_optionsPayload? = 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, - html_url: Swift.String? = nil, - created_at: Foundation.Date? = nil, - updated_at: Foundation.Date? = nil + fork: Swift.Bool, + url: Swift.String, + 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, + downloads_url: Swift.String, + events_url: Swift.String, + forks_url: Swift.String, + git_commits_url: Swift.String, + git_refs_url: Swift.String, + git_tags_url: 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, + notifications_url: Swift.String, + 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, + hooks_url: Swift.String ) { self.id = id + self.node_id = node_id self.name = name - self.target_type = target_type + self.full_name = full_name + self.owner = owner + self._private = _private + self.html_url = html_url self.description = description - self.advanced_security = advanced_security - self.dependency_graph = dependency_graph - self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action - self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options - self.dependabot_alerts = dependabot_alerts - self.dependabot_security_updates = dependabot_security_updates - self.code_scanning_default_setup = code_scanning_default_setup - self.code_scanning_default_setup_options = code_scanning_default_setup_options - 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.fork = fork self.url = url - self.html_url = html_url - self.created_at = created_at - self.updated_at = updated_at + 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.downloads_url = downloads_url + self.events_url = events_url + self.forks_url = forks_url + self.git_commits_url = git_commits_url + self.git_refs_url = git_refs_url + self.git_tags_url = git_tags_url + 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.notifications_url = notifications_url + 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.hooks_url = hooks_url } public enum CodingKeys: String, CodingKey { case id + case node_id case name - case target_type + case full_name + case owner + case _private = "private" + case html_url case description - case advanced_security - case dependency_graph - case dependency_graph_autosubmit_action - case dependency_graph_autosubmit_action_options - case dependabot_alerts - case dependabot_security_updates - case code_scanning_default_setup - case code_scanning_default_setup_options - 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 fork case url - case html_url - case created_at - case updated_at + 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 downloads_url + case events_url + case forks_url + case git_commits_url + case git_refs_url + case git_tags_url + 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 notifications_url + 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 hooks_url } } - /// Feature options for code scanning default setup + /// Repositories associated with a code security configuration and attachment status /// - /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options`. - public struct code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options: Codable, Hashable, Sendable { - /// Whether to use labeled runners or standard GitHub runners. + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories`. + public struct code_hyphen_security_hyphen_configuration_hyphen_repositories: Codable, Hashable, Sendable { + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case attached = "attached" + case attaching = "attaching" + case detached = "detached" + case removed = "removed" + case enforced = "enforced" + case failed = "failed" + case updating = "updating" + case removed_by_enterprise = "removed_by_enterprise" + } + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. + public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? + /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/repository`. + public var repository: Components.Schemas.simple_hyphen_repository? + /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_repositories`. + /// + /// - Parameters: + /// - status: The attachment status of the code security configuration on the repository. + /// - repository: + public init( + status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? = nil, + repository: Components.Schemas.simple_hyphen_repository? = nil + ) { + self.status = status + self.repository = repository + } + public enum CodingKeys: String, CodingKey { + case status + case repository + } + } + /// Code security configuration associated with a repository and attachment status + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository`. + public struct code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository: Codable, Hashable, Sendable { + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. + @frozen public enum statusPayload: String, Codable, Hashable, Sendable { + case attached = "attached" + case attaching = "attaching" + case detached = "detached" + case removed = "removed" + case enforced = "enforced" + case failed = "failed" + case updating = "updating" + case removed_by_enterprise = "removed_by_enterprise" + } + /// The attachment status of the code security configuration on the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. + public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? + /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository`. + /// + /// - Parameters: + /// - status: The attachment status of the code security configuration on the repository. + /// - configuration: + public init( + status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.status = status + self.configuration = configuration + } + public enum CodingKeys: String, CodingKey { + case status + case configuration + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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 `#/components/parameters/pagination-before`. + public typealias pagination_hyphen_before = Swift.String + /// 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 `#/components/parameters/pagination-after`. + public typealias pagination_hyphen_after = Swift.String + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias enterprise = Swift.String + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/components/parameters/configuration-id`. + public typealias configuration_hyphen_id = Swift.Int + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias repo = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = 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`. + /// + /// - 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 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 accepted: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content/application\/json`. + case json(OpenAPIRuntime.OpenAPIObjectContainer) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: OpenAPIRuntime.OpenAPIObjectContainer { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.accepted.Body + /// Creates a new `accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.accepted.Body) { + self.body = body + } + } + public struct not_modified: Sendable, Hashable { + /// Creates a new `not_modified`. + public init() {} + } + 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 conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/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.conflict.Body + /// Creates a new `conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.conflict.Body) { + self.body = body + } + } + public struct no_content: Sendable, Hashable { + /// Creates a new `no_content`. + public init() {} + } + } + /// 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 code security configurations for an enterprise + /// + /// Lists all code security configurations available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-for-enterprise)`. + public enum code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/get-configurations-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/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}/code-security/configurations/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.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/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/enterprises/{enterprise}/code-security/configurations/GET/query/per_page`. + public var per_page: Swift.Int? + /// 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/enterprises/{enterprise}/code-security/configurations/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/enterprises/{enterprise}/code-security/configurations/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// 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)." + /// - 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)." + public init( + per_page: Swift.Int? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil + ) { + self.per_page = per_page + self.before = before + self.after = after + } + } + public var query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/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.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_configurations_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}/code-security/configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.code_hyphen_security_hyphen_configuration]) + /// 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.code_hyphen_security_hyphen_configuration] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_configurations_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.code_hyphen_security_sol_get_hyphen_configurations_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/get(code-security/get-configurations-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}/code-security/configurations/get(code-security/get-configurations-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 + ] + } + } + } + /// Create a code security configuration for an enterprise + /// + /// Creates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)`. + public enum code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/create-configuration-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/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}/code-security/configurations/POST/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.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/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.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the code security configuration. Must be unique within the enterprise. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/name`. + public var name: Swift.String + /// A description of the code security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/description`. + public var description: Swift.String + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case code_security = "code_security" + case secret_protection = "secret_protection" + } + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. + public var advanced_security: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.advanced_securityPayload? + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph`. + public var dependency_graph: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graphPayload? + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_alerts`. + public var dependabot_alerts: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. + public var dependabot_security_updates: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. + public var code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_default_setupPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup_options`. + public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. + @frozen public enum code_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. + public var code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning`. + public var secret_scanning: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanningPayload? + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_push_protection`. + public var secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of secret scanning validity checks + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_validity_checks`. + @frozen public enum secret_scanning_validity_checksPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning validity checks + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_validity_checks`. + public var secret_scanning_validity_checks: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? + /// The enablement status of secret scanning non provider patterns + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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/enterprises/{enterprise}/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_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_generic_secrets`. + @frozen public enum secret_scanning_generic_secretsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_generic_secrets`. + public var secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. + @frozen public enum secret_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. + public var secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.private_vulnerability_reportingPayload? + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/enforcement`. + @frozen public enum enforcementPayload: String, Codable, Hashable, Sendable { + case enforced = "enforced" + case unenforced = "unenforced" + } + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/enforcement`. + public var enforcement: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.enforcementPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the code security configuration. Must be unique within the enterprise. + /// - description: A description of the code security configuration + /// - advanced_security: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission + /// - dependabot_alerts: The enablement status of Dependabot alerts + /// - dependabot_security_updates: The enablement status of Dependabot security updates + /// - code_scanning_default_setup: The enablement status of code scanning default setup + /// - code_scanning_default_setup_options: + /// - code_scanning_delegated_alert_dismissal: The enablement status of code scanning delegated alert dismissal + /// - secret_scanning: The enablement status of secret scanning + /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - 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 + /// - secret_scanning_generic_secrets: The enablement status of Copilot secret scanning + /// - secret_scanning_delegated_alert_dismissal: The enablement status of secret scanning delegated alert dismissal + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + /// - enforcement: The enforcement status for a security configuration + public init( + name: Swift.String, + description: Swift.String, + advanced_security: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.advanced_securityPayload? = nil, + dependency_graph: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? = nil, + dependabot_alerts: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_alertsPayload? = nil, + dependabot_security_updates: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, + code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, + code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? = nil, + code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? = nil, + secret_scanning: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanningPayload? = nil, + secret_scanning_push_protection: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + secret_scanning_validity_checks: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? = nil, + secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? = nil, + secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? = nil, + private_vulnerability_reporting: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil, + enforcement: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.enforcementPayload? = nil + ) { + self.name = name + self.description = description + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.code_scanning_default_setup_options = code_scanning_default_setup_options + self.code_scanning_delegated_alert_dismissal = code_scanning_delegated_alert_dismissal + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_validity_checks = secret_scanning_validity_checks + self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_generic_secrets = secret_scanning_generic_secrets + self.secret_scanning_delegated_alert_dismissal = secret_scanning_delegated_alert_dismissal + self.private_vulnerability_reporting = private_vulnerability_reporting + self.enforcement = enforcement + } + public enum CodingKeys: String, CodingKey { + case name + case description + case advanced_security + case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case code_scanning_default_setup_options + case code_scanning_delegated_alert_dismissal + case secret_scanning + case secret_scanning_push_protection + case secret_scanning_validity_checks + case secret_scanning_non_provider_patterns + case secret_scanning_generic_secrets + case secret_scanning_delegated_alert_dismissal + case private_vulnerability_reporting + case enforcement + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decode( + Swift.String.self, + forKey: .name + ) + description = try container.decode( + Swift.String.self, + forKey: .description + ) + advanced_security = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.advanced_securityPayload.self, + forKey: .advanced_security + ) + dependency_graph = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graphPayload.self, + forKey: .dependency_graph + ) + dependency_graph_autosubmit_action = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload.self, + forKey: .dependency_graph_autosubmit_action + ) + dependency_graph_autosubmit_action_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload.self, + forKey: .dependency_graph_autosubmit_action_options + ) + dependabot_alerts = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_alertsPayload.self, + forKey: .dependabot_alerts + ) + dependabot_security_updates = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.dependabot_security_updatesPayload.self, + forKey: .dependabot_security_updates + ) + code_scanning_default_setup = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_default_setupPayload.self, + forKey: .code_scanning_default_setup + ) + code_scanning_default_setup_options = try container.decodeIfPresent( + Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.self, + forKey: .code_scanning_default_setup_options + ) + code_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload.self, + forKey: .code_scanning_delegated_alert_dismissal + ) + secret_scanning = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanningPayload.self, + forKey: .secret_scanning + ) + secret_scanning_push_protection = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, + forKey: .secret_scanning_push_protection + ) + secret_scanning_validity_checks = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.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_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, + forKey: .secret_scanning_non_provider_patterns + ) + secret_scanning_generic_secrets = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload.self, + forKey: .secret_scanning_generic_secrets + ) + secret_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload.self, + forKey: .secret_scanning_delegated_alert_dismissal + ) + private_vulnerability_reporting = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, + forKey: .private_vulnerability_reporting + ) + enforcement = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.enforcementPayload.self, + forKey: .enforcement + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "advanced_security", + "dependency_graph", + "dependency_graph_autosubmit_action", + "dependency_graph_autosubmit_action_options", + "dependabot_alerts", + "dependabot_security_updates", + "code_scanning_default_setup", + "code_scanning_default_setup_options", + "code_scanning_delegated_alert_dismissal", + "secret_scanning", + "secret_scanning_push_protection", + "secret_scanning_validity_checks", + "secret_scanning_non_provider_patterns", + "secret_scanning_generic_secrets", + "secret_scanning_delegated_alert_dismissal", + "private_vulnerability_reporting", + "enforcement" + ]) + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.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/enterprises/{enterprise}/code-security/configurations/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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.code_hyphen_security_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Created.Body) { + self.body = body + } + } + /// Successfully created code security configuration + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.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.code_hyphen_security_sol_create_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-for-enterprise)/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//enterprises/{enterprise}/code-security/configurations/post(code-security/create-configuration-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}/code-security/configurations/post(code-security/create-configuration-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 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 default code security configurations for an enterprise + /// + /// Lists the default code security configurations for an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/defaults/get(code-security/get-default-configurations-for-enterprise)`. + public enum code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/get-default-configurations-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/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}/code-security/configurations/defaults/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.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/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.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_default_hyphen_configurations) + /// 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.code_hyphen_security_hyphen_default_hyphen_configurations { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/defaults/get(code-security/get-default-configurations-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_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.code_hyphen_security_sol_get_hyphen_default_hyphen_configurations_hyphen_for_hyphen_enterprise.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 + ] + } + } + } + /// Retrieve a code security configuration of an enterprise + /// + /// Gets a code security configuration available in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)`. + public enum code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/get-single-configuration-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/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}/code-security/configurations/{configuration_id}/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_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.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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.code_hyphen_security_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_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.code_hyphen_security_sol_get_hyphen_single_hyphen_configuration_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-for-enterprise)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.not_modified) + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.not_modified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-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}/code-security/configurations/{configuration_id}/get(code-security/get-single-configuration-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 + ] + } + } + } + /// Update a custom code security configuration for an enterprise + /// + /// Updates a code security configuration in an enterprise. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)`. + public enum code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration { + public static let id: Swift.String = "code-security/update-enterprise-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/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}/code-security/configurations/{configuration_id}/PATCH/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_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.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the code security configuration. Must be unique across the enterprise. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A description of the code security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. + @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case code_security = "code_security" + case secret_protection = "secret_protection" + } + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. + public var advanced_security: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. + @frozen public enum dependency_graphPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependency Graph + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. + public var dependency_graph: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action`. + @frozen public enum dependency_graph_autosubmit_actionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action`. + public var dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options`. + public struct dependency_graph_autosubmit_action_optionsPayload: Codable, Hashable, Sendable { + /// Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options/labeled_runners`. + public var labeled_runners: Swift.Bool? + /// Creates a new `dependency_graph_autosubmit_action_optionsPayload`. + /// + /// - Parameters: + /// - labeled_runners: Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. + public init(labeled_runners: Swift.Bool? = nil) { + self.labeled_runners = labeled_runners + } + public enum CodingKeys: String, CodingKey { + case labeled_runners + } + } + /// Feature options for Automatic dependency submission + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph_autosubmit_action_options`. + public var dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_alerts`. + @frozen public enum dependabot_alertsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot alerts + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_alerts`. + public var dependabot_alerts: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_security_updates`. + @frozen public enum dependabot_security_updatesPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Dependabot security updates + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependabot_security_updates`. + public var dependabot_security_updates: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup`. + @frozen public enum code_scanning_default_setupPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning default setup + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup`. + public var code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup_options`. + public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. + @frozen public enum code_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. + public var code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. + @frozen public enum secret_scanningPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. + public var secret_scanning: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_push_protection`. + @frozen public enum secret_scanning_push_protectionPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning push protection + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? + /// The enablement status of secret scanning validity checks + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_validity_checks`. + @frozen public enum secret_scanning_validity_checksPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning validity checks + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? + /// The enablement status of secret scanning non-provider patterns + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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/enterprises/{enterprise}/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_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_generic_secrets`. + @frozen public enum secret_scanning_generic_secretsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_generic_secrets`. + public var secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. + @frozen public enum secret_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. + public var secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. + @frozen public enum private_vulnerability_reportingPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of private vulnerability reporting + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. + public var private_vulnerability_reporting: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/enforcement`. + @frozen public enum enforcementPayload: String, Codable, Hashable, Sendable { + case enforced = "enforced" + case unenforced = "unenforced" + } + /// The enforcement status for a security configuration + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/enforcement`. + public var enforcement: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.enforcementPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the code security configuration. Must be unique across the enterprise. + /// - description: A description of the code security configuration + /// - advanced_security: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - dependency_graph: The enablement status of Dependency Graph + /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission + /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission + /// - dependabot_alerts: The enablement status of Dependabot alerts + /// - dependabot_security_updates: The enablement status of Dependabot security updates + /// - code_scanning_default_setup: The enablement status of code scanning default setup + /// - code_scanning_default_setup_options: + /// - code_scanning_delegated_alert_dismissal: The enablement status of code scanning delegated alert dismissal + /// - secret_scanning: The enablement status of secret scanning + /// - secret_scanning_push_protection: The enablement status of secret scanning push protection + /// - 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 + /// - secret_scanning_generic_secrets: The enablement status of Copilot secret scanning + /// - secret_scanning_delegated_alert_dismissal: The enablement status of secret scanning delegated alert dismissal + /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting + /// - enforcement: The enforcement status for a security configuration + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + advanced_security: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? = nil, + dependency_graph: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload? = nil, + dependency_graph_autosubmit_action: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload? = nil, + dependency_graph_autosubmit_action_options: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload? = nil, + dependabot_alerts: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload? = nil, + dependabot_security_updates: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, + code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, + code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? = nil, + code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? = nil, + secret_scanning: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload? = nil, + secret_scanning_push_protection: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload? = nil, + secret_scanning_validity_checks: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_validity_checksPayload? = nil, + secret_scanning_non_provider_patterns: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload? = nil, + secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? = nil, + secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? = nil, + private_vulnerability_reporting: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload? = nil, + enforcement: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.enforcementPayload? = nil + ) { + self.name = name + self.description = description + self.advanced_security = advanced_security + self.dependency_graph = dependency_graph + self.dependency_graph_autosubmit_action = dependency_graph_autosubmit_action + self.dependency_graph_autosubmit_action_options = dependency_graph_autosubmit_action_options + self.dependabot_alerts = dependabot_alerts + self.dependabot_security_updates = dependabot_security_updates + self.code_scanning_default_setup = code_scanning_default_setup + self.code_scanning_default_setup_options = code_scanning_default_setup_options + self.code_scanning_delegated_alert_dismissal = code_scanning_delegated_alert_dismissal + self.secret_scanning = secret_scanning + self.secret_scanning_push_protection = secret_scanning_push_protection + self.secret_scanning_validity_checks = secret_scanning_validity_checks + self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns + self.secret_scanning_generic_secrets = secret_scanning_generic_secrets + self.secret_scanning_delegated_alert_dismissal = secret_scanning_delegated_alert_dismissal + self.private_vulnerability_reporting = private_vulnerability_reporting + self.enforcement = enforcement + } + public enum CodingKeys: String, CodingKey { + case name + case description + case advanced_security + case dependency_graph + case dependency_graph_autosubmit_action + case dependency_graph_autosubmit_action_options + case dependabot_alerts + case dependabot_security_updates + case code_scanning_default_setup + case code_scanning_default_setup_options + case code_scanning_delegated_alert_dismissal + case secret_scanning + case secret_scanning_push_protection + case secret_scanning_validity_checks + case secret_scanning_non_provider_patterns + case secret_scanning_generic_secrets + case secret_scanning_delegated_alert_dismissal + case private_vulnerability_reporting + case enforcement + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + description = try container.decodeIfPresent( + Swift.String.self, + forKey: .description + ) + advanced_security = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload.self, + forKey: .advanced_security + ) + dependency_graph = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graphPayload.self, + forKey: .dependency_graph + ) + dependency_graph_autosubmit_action = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_actionPayload.self, + forKey: .dependency_graph_autosubmit_action + ) + dependency_graph_autosubmit_action_options = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependency_graph_autosubmit_action_optionsPayload.self, + forKey: .dependency_graph_autosubmit_action_options + ) + dependabot_alerts = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_alertsPayload.self, + forKey: .dependabot_alerts + ) + dependabot_security_updates = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload.self, + forKey: .dependabot_security_updates + ) + code_scanning_default_setup = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload.self, + forKey: .code_scanning_default_setup + ) + code_scanning_default_setup_options = try container.decodeIfPresent( + Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.self, + forKey: .code_scanning_default_setup_options + ) + code_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload.self, + forKey: .code_scanning_delegated_alert_dismissal + ) + secret_scanning = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload.self, + forKey: .secret_scanning + ) + secret_scanning_push_protection = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_push_protectionPayload.self, + forKey: .secret_scanning_push_protection + ) + secret_scanning_validity_checks = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_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_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, + forKey: .secret_scanning_non_provider_patterns + ) + secret_scanning_generic_secrets = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload.self, + forKey: .secret_scanning_generic_secrets + ) + secret_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload.self, + forKey: .secret_scanning_delegated_alert_dismissal + ) + private_vulnerability_reporting = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.private_vulnerability_reportingPayload.self, + forKey: .private_vulnerability_reporting + ) + enforcement = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.enforcementPayload.self, + forKey: .enforcement + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "advanced_security", + "dependency_graph", + "dependency_graph_autosubmit_action", + "dependency_graph_autosubmit_action_options", + "dependabot_alerts", + "dependabot_security_updates", + "code_scanning_default_setup", + "code_scanning_default_setup_options", + "code_scanning_delegated_alert_dismissal", + "secret_scanning", + "secret_scanning_push_protection", + "secret_scanning_validity_checks", + "secret_scanning_non_provider_patterns", + "secret_scanning_generic_secrets", + "secret_scanning_delegated_alert_dismissal", + "private_vulnerability_reporting", + "enforcement" + ]) + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.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/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.code_hyphen_security_hyphen_configuration) + /// 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.code_hyphen_security_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.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.code_hyphen_security_sol_update_hyphen_enterprise_hyphen_configuration.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.not_modified) + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.not_modified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)/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}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)/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 + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/patch(code-security/update-enterprise-configuration)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + 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 code security configuration for an enterprise + /// + /// Deletes a code security configuration from an enterprise. + /// Repositories attached to the configuration will retain their settings but will no longer be associated with + /// the configuration. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)`. + public enum code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/delete-configuration-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/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}/code-security/configurations/{configuration_id}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/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_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_delete_hyphen_configuration_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.no_content) + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.no_content { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)/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//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-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}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-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 + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/delete(code-security/delete-configuration-for-enterprise)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + 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 + ] + } + } + } + /// Attach an enterprise configuration to repositories + /// + /// Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + /// + /// If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)`. + public enum code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration { + public static let id: Swift.String = "code-security/attach-enterprise-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/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}/code-security/configurations/{configuration_id}/attach/POST/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/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.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The type of repositories to attach the configuration to. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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" + } + /// The type of repositories to attach the configuration to. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/requestBody/json/scope`. + public var scope: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.scopePayload + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - scope: The type of repositories to attach the configuration to. + public init(scope: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.scopePayload) { + self.scope = scope + } + public enum CodingKeys: String, CodingKey { + case scope + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + scope = try container.decode( + Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload.scopePayload.self, + forKey: .scope + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "scope" + ]) + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Path, + headers: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_attach_hyphen_enterprise_hyphen_configuration.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)/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 + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)/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 `#/components/schemas/code-scanning-default-setup-options/runner_type`. - @frozen public enum runner_typePayload: String, Codable, Hashable, Sendable { - case standard = "standard" - case labeled = "labeled" - case not_set = "not_set" + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)/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 + ) + } + } } - /// Whether to use labeled runners or standard GitHub runners. + /// Conflict /// - /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options/runner_type`. - public var runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.runner_typePayload? - /// The label of the runner to use for code scanning default setup when runner_type is 'labeled'. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/post(code-security/attach-enterprise-configuration)/responses/409`. /// - /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options/runner_label`. - public var runner_label: Swift.String? - /// Creates a new `code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options`. + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.conflict) + /// The associated value of the enum case if `self` is `.conflict`. /// - /// - Parameters: - /// - runner_type: Whether to use labeled runners or standard GitHub runners. - /// - runner_label: The label of the runner to use for code scanning default setup when runner_type is 'labeled'. - public init( - runner_type: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.runner_typePayload? = nil, - runner_label: Swift.String? = nil - ) { - self.runner_type = runner_type - self.runner_label = runner_label + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } } - public enum CodingKeys: String, CodingKey { - case runner_type - case runner_label + /// 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 + ] } } - /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations`. - public struct code_hyphen_security_hyphen_default_hyphen_configurationsPayload: Codable, Hashable, Sendable { - /// The visibility of newly created repositories for which the code security configuration will be applied to by default - /// - /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/default_for_new_repos`. - public var default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? - /// - Remark: Generated from `#/components/schemas/code_hyphen_security_hyphen_default_hyphen_configurations/configuration`. - public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? - /// Creates a new `code_hyphen_security_hyphen_default_hyphen_configurationsPayload`. + } + /// Set a code security configuration as a default for an enterprise + /// + /// Sets a code security configuration as a default to be applied to new repositories in your enterprise. + /// + /// This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set. + /// + /// The authenticated user must be an administrator for the enterprise to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)`. + public enum code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "code-security/set-configuration-as-default-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/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}/code-security/configurations/{configuration_id}/defaults/PUT/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id + } + } + public var path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/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_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Specify which types of repository this security configuration should be applied to by default. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json/default_for_new_repos`. + @frozen public enum default_for_new_reposPayload: String, Codable, Hashable, Sendable { + case all = "all" + case none = "none" + case private_and_internal = "private_and_internal" + case _public = "public" + } + /// Specify which types of repository this security configuration should be applied to by default. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/json/default_for_new_repos`. + public var default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.default_for_new_reposPayload? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - default_for_new_repos: Specify which types of repository this security configuration should be applied to by default. + public init(default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload.default_for_new_reposPayload? = nil) { + self.default_for_new_repos = default_for_new_repos + } + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/requestBody/content/application\/json`. + case json(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body.jsonPayload) + } + public var body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body + /// Creates a new `Input`. /// /// - Parameters: - /// - default_for_new_repos: The visibility of newly created repositories for which the code security configuration will be applied to by default - /// - configuration: + /// - path: + /// - headers: + /// - body: public init( - default_for_new_repos: OpenAPIRuntime.OpenAPIValueContainer? = nil, - configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + path: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Path, + headers: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Headers = .init(), + body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Input.Body ) { - self.default_for_new_repos = default_for_new_repos - self.configuration = configuration - } - public enum CodingKeys: String, CodingKey { - case default_for_new_repos - case configuration + self.path = path + self.headers = headers + self.body = body } } - /// A list of default code security configurations - /// - /// - Remark: Generated from `#/components/schemas/code-security-default-configurations`. - public typealias code_hyphen_security_hyphen_default_hyphen_configurations = [Components.Schemas.code_hyphen_security_hyphen_default_hyphen_configurationsPayload] - /// Repositories associated with a code security configuration and attachment status - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories`. - public struct code_hyphen_security_hyphen_configuration_hyphen_repositories: Codable, Hashable, Sendable { - /// The attachment status of the code security configuration on the repository. + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Specifies which types of repository this security configuration is applied to by default. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/default_for_new_repos`. + @frozen public enum default_for_new_reposPayload: String, Codable, Hashable, Sendable { + case all = "all" + case none = "none" + case private_and_internal = "private_and_internal" + case _public = "public" + } + /// Specifies which types of repository this security configuration is applied to by default. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/default_for_new_repos`. + public var default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload.default_for_new_reposPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/json/configuration`. + public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - default_for_new_repos: Specifies which types of repository this security configuration is applied to by default. + /// - configuration: + public init( + default_for_new_repos: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload.default_for_new_reposPayload? = nil, + configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil + ) { + self.default_for_new_repos = default_for_new_repos + self.configuration = configuration + } + public enum CodingKeys: String, CodingKey { + case default_for_new_repos + case configuration + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/responses/200/content/application\/json`. + case json(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_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.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_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.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } + } + /// Default successfully changed. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case attached = "attached" - case attaching = "attaching" - case detached = "detached" - case removed = "removed" - case enforced = "enforced" - case failed = "failed" - case updating = "updating" - case removed_by_enterprise = "removed_by_enterprise" + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_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.code_hyphen_security_sol_set_hyphen_configuration_hyphen_as_hyphen_default_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The attachment status of the code security configuration on the repository. + /// Forbidden /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/status`. - public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? - /// - Remark: Generated from `#/components/schemas/code-security-configuration-repositories/repository`. - public var repository: Components.Schemas.simple_hyphen_repository? - /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_repositories`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)/responses/403`. /// - /// - Parameters: - /// - status: The attachment status of the code security configuration on the repository. - /// - repository: - public init( - status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories.statusPayload? = nil, - repository: Components.Schemas.simple_hyphen_repository? = nil - ) { - self.status = status - self.repository = repository - } - public enum CodingKeys: String, CodingKey { - case status - case repository - } - } - /// Code security configuration associated with a repository and attachment status - /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository`. - public struct code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository: Codable, Hashable, Sendable { - /// The attachment status of the code security configuration on the repository. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. - @frozen public enum statusPayload: String, Codable, Hashable, Sendable { - case attached = "attached" - case attaching = "attaching" - case detached = "detached" - case removed = "removed" - case enforced = "enforced" - case failed = "failed" - case updating = "updating" - case removed_by_enterprise = "removed_by_enterprise" + /// - 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 + ) + } + } } - /// The attachment status of the code security configuration on the repository. + /// Resource not found /// - /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/status`. - public var status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? - /// - Remark: Generated from `#/components/schemas/code-security-configuration-for-repository/configuration`. - public var configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? - /// Creates a new `code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/put(code-security/set-configuration-as-default-for-enterprise)/responses/404`. /// - /// - Parameters: - /// - status: The attachment status of the code security configuration on the repository. - /// - configuration: - public init( - status: Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_for_hyphen_repository.statusPayload? = nil, - configuration: Components.Schemas.code_hyphen_security_hyphen_configuration? = nil - ) { - self.status = status - self.configuration = configuration - } - public enum CodingKeys: String, CodingKey { - case status - case configuration - } - } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// 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 `#/components/parameters/pagination-before`. - public typealias pagination_hyphen_before = Swift.String - /// 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 `#/components/parameters/pagination-after`. - public typealias pagination_hyphen_after = Swift.String - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias org = Swift.String - /// The unique identifier of the code security configuration. - /// - /// - Remark: Generated from `#/components/parameters/configuration-id`. - public typealias configuration_hyphen_id = Swift.Int - } - /// 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 - } + /// 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.not_found.Body - /// Creates a new `not_found`. + /// Undocumented response. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.not_found.Body) { - self.body = body + /// 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 + ] } } - 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`. + } + /// Get repositories associated with an enterprise code security configuration + /// + /// Lists the repositories associated with an enterprise code security configuration in an organization. + /// + /// The authenticated user must be an administrator of the enterprise in order to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)`. + public enum code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration { + public static let id: Swift.String = "code-security/get-repositories-for-enterprise-configuration" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. /// - /// - 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 `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// The unique identifier of the code security configuration. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path/configuration_id`. + public var configuration_id: Components.Parameters.configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - configuration_id: The unique identifier of the code security configuration. + public init( + enterprise: Components.Parameters.enterprise, + configuration_id: Components.Parameters.configuration_hyphen_id + ) { + self.enterprise = enterprise + self.configuration_id = configuration_id } - /// - 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`. + } + public var path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/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)." /// - /// - 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 - ) - } - } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/query/per_page`. + public var per_page: Swift.Int? + /// 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/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/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/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/query/after`. + public var after: Components.Parameters.pagination_hyphen_after? + /// A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. + /// + /// Can be: `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/query/status`. + public var status: Swift.String? + /// 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)." + /// - 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)." + /// - status: A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. + public init( + per_page: Swift.Int? = nil, + before: Components.Parameters.pagination_hyphen_before? = nil, + after: Components.Parameters.pagination_hyphen_after? = nil, + status: Swift.String? = nil + ) { + self.per_page = per_page + self.before = before + self.after = after + self.status = status } } - /// 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 accepted: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/accepted/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/accepted/content/application\/json`. - case json(OpenAPIRuntime.OpenAPIObjectContainer) - /// The associated value of the enum case if `self` is `.json`. + public var query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: OpenAPIRuntime.OpenAPIObjectContainer { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - /// Received HTTP response body - public var body: Components.Responses.accepted.Body - /// Creates a new `accepted`. + public var headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.accepted.Body) { - self.body = body + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Path, + query: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Query = .init(), + headers: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - public struct not_modified: Sendable, Hashable { - /// Creates a new `not_modified`. - public init() {} - } - 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 + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/responses/200/content/application\/json`. + case json([Components.Schemas.code_hyphen_security_hyphen_configuration_hyphen_repositories]) + /// 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.code_hyphen_security_hyphen_configuration_hyphen_repositories] { + get throws { + switch self { + case let .json(body): + return body + } } } } + /// Received HTTP response body + public var body: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output.Ok.Body) { + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.forbidden.Body - /// Creates a new `forbidden`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.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.code_hyphen_security_sol_get_hyphen_repositories_hyphen_for_hyphen_enterprise_hyphen_configuration.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - } - public struct conflict: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/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 - } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)/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 + ) } } } - /// Received HTTP response body - public var body: Components.Responses.conflict.Body - /// Creates a new `conflict`. + /// Resource not found /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.conflict.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-enterprise-configuration)/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) } - public struct no_content: Sendable, Hashable { - /// Creates a new `no_content`. - public init() {} + @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 {} -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { /// Get code security configurations for an organization /// /// Lists all code security configurations available in an organization. @@ -2060,14 +5184,16 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/description`. public var description: Swift.String - /// The enablement status of GitHub Advanced Security + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { case enabled = "enabled" case disabled = "disabled" + case code_security = "code_security" + case secret_protection = "secret_protection" } - /// The enablement status of GitHub Advanced Security + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. public var advanced_security: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? @@ -2156,6 +5282,18 @@ public enum Operations { public var code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup_options`. public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. + @frozen public enum code_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. + public var code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning`. @@ -2277,6 +5415,30 @@ public enum Operations { /// /// - 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 Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_generic_secrets`. + @frozen public enum secret_scanning_generic_secretsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_generic_secrets`. + public var secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. + @frozen public enum secret_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning_delegated_alert_dismissal`. + public var secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/private_vulnerability_reporting`. @@ -2305,7 +5467,7 @@ public enum Operations { /// - Parameters: /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration - /// - advanced_security: The enablement status of GitHub Advanced Security + /// - advanced_security: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// - dependency_graph: The enablement status of Dependency Graph /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission @@ -2313,12 +5475,15 @@ public enum Operations { /// - dependabot_security_updates: The enablement status of Dependabot security updates /// - code_scanning_default_setup: The enablement status of code scanning default setup /// - code_scanning_default_setup_options: + /// - code_scanning_delegated_alert_dismissal: The enablement status of code scanning delegated alert dismissal /// - 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 + /// - secret_scanning_generic_secrets: The enablement status of Copilot secret scanning + /// - secret_scanning_delegated_alert_dismissal: The enablement status of secret scanning delegated alert dismissal /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -2332,12 +5497,15 @@ public enum Operations { dependabot_security_updates: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, code_scanning_default_setup: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? = nil, + code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? = 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, + secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? = nil, + secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? = 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 ) { @@ -2351,12 +5519,15 @@ public enum Operations { self.dependabot_security_updates = dependabot_security_updates self.code_scanning_default_setup = code_scanning_default_setup self.code_scanning_default_setup_options = code_scanning_default_setup_options + self.code_scanning_delegated_alert_dismissal = code_scanning_delegated_alert_dismissal 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.secret_scanning_generic_secrets = secret_scanning_generic_secrets + self.secret_scanning_delegated_alert_dismissal = secret_scanning_delegated_alert_dismissal self.private_vulnerability_reporting = private_vulnerability_reporting self.enforcement = enforcement } @@ -2371,12 +5542,15 @@ public enum Operations { case dependabot_security_updates case code_scanning_default_setup case code_scanning_default_setup_options + case code_scanning_delegated_alert_dismissal 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 secret_scanning_generic_secrets + case secret_scanning_delegated_alert_dismissal case private_vulnerability_reporting case enforcement } @@ -2422,6 +5596,10 @@ public enum Operations { Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.self, forKey: .code_scanning_default_setup_options ) + code_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload.self, + forKey: .code_scanning_delegated_alert_dismissal + ) secret_scanning = try container.decodeIfPresent( Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload.self, forKey: .secret_scanning @@ -2446,6 +5624,14 @@ public enum Operations { Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, forKey: .secret_scanning_non_provider_patterns ) + secret_scanning_generic_secrets = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload.self, + forKey: .secret_scanning_generic_secrets + ) + secret_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_create_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload.self, + forKey: .secret_scanning_delegated_alert_dismissal + ) 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 @@ -2465,12 +5651,15 @@ public enum Operations { "dependabot_security_updates", "code_scanning_default_setup", "code_scanning_default_setup_options", + "code_scanning_delegated_alert_dismissal", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", "secret_scanning_delegated_bypass_options", "secret_scanning_validity_checks", "secret_scanning_non_provider_patterns", + "secret_scanning_generic_secrets", + "secret_scanning_delegated_alert_dismissal", "private_vulnerability_reporting", "enforcement" ]) @@ -3302,14 +6491,16 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/description`. public var description: Swift.String? - /// The enablement status of GitHub Advanced Security + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. @frozen public enum advanced_securityPayload: String, Codable, Hashable, Sendable { case enabled = "enabled" case disabled = "disabled" + case code_security = "code_security" + case secret_protection = "secret_protection" } - /// The enablement status of GitHub Advanced Security + /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. public var advanced_security: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.advanced_securityPayload? @@ -3398,6 +6589,18 @@ public enum Operations { public var code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_default_setup_options`. public var code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. + @frozen public enum code_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of code scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. + public var code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. @@ -3519,6 +6722,30 @@ public enum Operations { /// /// - 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 Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_generic_secrets`. + @frozen public enum secret_scanning_generic_secretsPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of Copilot secret scanning + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_generic_secrets`. + public var secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. + @frozen public enum secret_scanning_delegated_alert_dismissalPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case not_set = "not_set" + } + /// The enablement status of secret scanning delegated alert dismissal + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning_delegated_alert_dismissal`. + public var secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? /// The enablement status of private vulnerability reporting /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/private_vulnerability_reporting`. @@ -3547,7 +6774,7 @@ public enum Operations { /// - Parameters: /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration - /// - advanced_security: The enablement status of GitHub Advanced Security + /// - advanced_security: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// - dependency_graph: The enablement status of Dependency Graph /// - dependency_graph_autosubmit_action: The enablement status of Automatic dependency submission /// - dependency_graph_autosubmit_action_options: Feature options for Automatic dependency submission @@ -3555,12 +6782,15 @@ public enum Operations { /// - dependabot_security_updates: The enablement status of Dependabot security updates /// - code_scanning_default_setup: The enablement status of code scanning default setup /// - code_scanning_default_setup_options: + /// - code_scanning_delegated_alert_dismissal: The enablement status of code scanning delegated alert dismissal /// - 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 + /// - secret_scanning_generic_secrets: The enablement status of Copilot secret scanning + /// - secret_scanning_delegated_alert_dismissal: The enablement status of secret scanning delegated alert dismissal /// - private_vulnerability_reporting: The enablement status of private vulnerability reporting /// - enforcement: The enforcement status for a security configuration public init( @@ -3574,12 +6804,15 @@ public enum Operations { dependabot_security_updates: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.dependabot_security_updatesPayload? = nil, code_scanning_default_setup: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_default_setupPayload? = nil, code_scanning_default_setup_options: Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options? = nil, + code_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload? = 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, + secret_scanning_generic_secrets: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload? = nil, + secret_scanning_delegated_alert_dismissal: Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload? = 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 ) { @@ -3593,12 +6826,15 @@ public enum Operations { self.dependabot_security_updates = dependabot_security_updates self.code_scanning_default_setup = code_scanning_default_setup self.code_scanning_default_setup_options = code_scanning_default_setup_options + self.code_scanning_delegated_alert_dismissal = code_scanning_delegated_alert_dismissal 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.secret_scanning_generic_secrets = secret_scanning_generic_secrets + self.secret_scanning_delegated_alert_dismissal = secret_scanning_delegated_alert_dismissal self.private_vulnerability_reporting = private_vulnerability_reporting self.enforcement = enforcement } @@ -3613,12 +6849,15 @@ public enum Operations { case dependabot_security_updates case code_scanning_default_setup case code_scanning_default_setup_options + case code_scanning_delegated_alert_dismissal 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 secret_scanning_generic_secrets + case secret_scanning_delegated_alert_dismissal case private_vulnerability_reporting case enforcement } @@ -3664,6 +6903,10 @@ public enum Operations { Components.Schemas.code_hyphen_scanning_hyphen_default_hyphen_setup_hyphen_options.self, forKey: .code_scanning_default_setup_options ) + code_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.code_scanning_delegated_alert_dismissalPayload.self, + forKey: .code_scanning_delegated_alert_dismissal + ) secret_scanning = try container.decodeIfPresent( Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanningPayload.self, forKey: .secret_scanning @@ -3688,6 +6931,14 @@ public enum Operations { Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_non_provider_patternsPayload.self, forKey: .secret_scanning_non_provider_patterns ) + secret_scanning_generic_secrets = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_generic_secretsPayload.self, + forKey: .secret_scanning_generic_secrets + ) + secret_scanning_delegated_alert_dismissal = try container.decodeIfPresent( + Operations.code_hyphen_security_sol_update_hyphen_configuration.Input.Body.jsonPayload.secret_scanning_delegated_alert_dismissalPayload.self, + forKey: .secret_scanning_delegated_alert_dismissal + ) 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 @@ -3707,12 +6958,15 @@ public enum Operations { "dependabot_security_updates", "code_scanning_default_setup", "code_scanning_default_setup_options", + "code_scanning_delegated_alert_dismissal", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", "secret_scanning_delegated_bypass_options", "secret_scanning_validity_checks", "secret_scanning_non_provider_patterns", + "secret_scanning_generic_secrets", + "secret_scanning_delegated_alert_dismissal", "private_vulnerability_reporting", "enforcement" ]) From 48cad739a206983a4013c17c667fe29e65a69f21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:54:23 +0000 Subject: [PATCH 30/37] Commit via running ake Sources/private-registries --- Sources/private-registries/Client.swift | 652 ++++++++ Sources/private-registries/Types.swift | 1992 ++++++++++++++++++++++- 2 files changed, 2638 insertions(+), 6 deletions(-) diff --git a/Sources/private-registries/Client.swift b/Sources/private-registries/Client.swift index 87202523ac7..0736a7ba3a6 100644 --- a/Sources/private-registries/Client.swift +++ b/Sources/private-registries/Client.swift @@ -38,4 +38,656 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List private registries for an organization + /// + /// + /// Lists all private registry configurations available at the organization-level without revealing their encrypted + /// values. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)`. + public func private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries(_ input: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input) async throws -> Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries", + 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 + ) + 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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.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 + )) + 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 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 + ) + ) + } + } + ) + } + /// Create a private registry for an organization + /// + /// + /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)`. + public func private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries", + 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.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.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.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.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.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 private registries public key for an organization + /// + /// + /// Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)`. + public func private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key(_ input: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries/public-key", + parameters: [ + input.path.org + ] + ) + 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 headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.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 + )) + 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 a private registry for an organization + /// + /// + /// Get the configuration of a single private registry defined for an organization, omitting its encrypted value. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)`. + public func private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries/{}", + parameters: [ + input.path.org, + input.path.secret_name + ] + ) + 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.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.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.org_hyphen_private_hyphen_registry_hyphen_configuration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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 + ) + ) + } + } + ) + } + /// Update a private registry for an organization + /// + /// + /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)`. + public func private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries/{}", + parameters: [ + input.path.org, + input.path.secret_name + ] + ) + 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 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)) + 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 + ) + ) + } + } + ) + } + /// Delete a private registry for an organization + /// + /// + /// Delete a private registry configuration at the organization-level. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)`. + public func private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Output { + try await client.send( + input: input, + forOperation: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/private-registries/{}", + parameters: [ + input.path.org, + input.path.secret_name + ] + ) + 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 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 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 + ) + ) + } + } + ) + } } diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 2a210decbff..c6ae22521ab 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -10,10 +10,187 @@ import struct Foundation.Data import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable {} +public protocol APIProtocol: Sendable { + /// List private registries for an organization + /// + /// + /// Lists all private registry configurations available at the organization-level without revealing their encrypted + /// values. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)`. + func private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries(_ input: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input) async throws -> Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output + /// Create a private registry for an organization + /// + /// + /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)`. + func private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output + /// Get private registries public key for an organization + /// + /// + /// Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)`. + func private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key(_ input: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output + /// Get a private registry for an organization + /// + /// + /// Get the configuration of a single private registry defined for an organization, omitting its encrypted value. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)`. + func private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output + /// Update a private registry for an organization + /// + /// + /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)`. + func private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Output + /// Delete a private registry for an organization + /// + /// + /// Delete a private registry configuration at the organization-level. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)`. + func private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry(_ input: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input) async throws -> Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List private registries for an organization + /// + /// + /// Lists all private registry configurations available at the organization-level without revealing their encrypted + /// values. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)`. + public func private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries( + path: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Path, + query: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Query = .init(), + headers: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Headers = .init() + ) async throws -> Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output { + try await private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries(Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a private registry for an organization + /// + /// + /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)`. + public func private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry( + path: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init(), + body: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body + ) async throws -> Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output { + try await private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry(Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get private registries public key for an organization + /// + /// + /// Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)`. + public func private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key( + path: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input.Path, + headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input.Headers = .init() + ) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output { + try await private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key(Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input( + path: path, + headers: headers + )) + } + /// Get a private registry for an organization + /// + /// + /// Get the configuration of a single private registry defined for an organization, omitting its encrypted value. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)`. + public func private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry( + path: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init() + ) async throws -> Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output { + try await private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry(Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input( + path: path, + headers: headers + )) + } + /// Update a private registry for an organization + /// + /// + /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)`. + public func private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry( + path: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init(), + body: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body + ) async throws -> Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Output { + try await private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry(Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a private registry for an organization + /// + /// + /// Delete a private registry configuration at the organization-level. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)`. + public func private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry( + path: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init() + ) async throws -> Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Output { + try await private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry(Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -29,16 +206,1819 @@ public enum Servers { /// 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 {} + 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 + } + } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct validation_hyphen_error: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentation_url: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`. + public struct errorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + @frozen public enum valuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + 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 .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`. + public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? + /// Creates a new `errorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.validation_hyphen_error.errorsPayload? + /// Creates a new `validation_hyphen_error`. + /// + /// - Parameters: + /// - message: + /// - documentation_url: + /// - errors: + public init( + message: Swift.String, + documentation_url: Swift.String, + errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil + ) { + self.message = message + self.documentation_url = documentation_url + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentation_url + case errors + } + } + /// Private registry configuration for an organization + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration`. + public struct org_hyphen_private_hyphen_registry_hyphen_configuration: Codable, Hashable, Sendable { + /// The name of the private registry configuration. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/name`. + public var name: Swift.String + /// The registry type. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/registry_type`. + @frozen public enum registry_typePayload: String, Codable, Hashable, Sendable { + case maven_repository = "maven_repository" + } + /// The registry type. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/registry_type`. + public var registry_type: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration.registry_typePayload + /// The username to use when authenticating with the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/username`. + public var username: Swift.String? + /// Which type of organization repositories have access to the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Which type of organization repositories have access to the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/visibility`. + public var visibility: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration.visibilityPayload + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `org_hyphen_private_hyphen_registry_hyphen_configuration`. + /// + /// - Parameters: + /// - name: The name of the private registry configuration. + /// - registry_type: The registry type. + /// - username: The username to use when authenticating with the private registry. + /// - visibility: Which type of organization repositories have access to the private registry. + /// - created_at: + /// - updated_at: + public init( + name: Swift.String, + registry_type: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration.registry_typePayload, + username: Swift.String? = nil, + visibility: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration.visibilityPayload, + created_at: Foundation.Date, + updated_at: Foundation.Date + ) { + self.name = name + self.registry_type = registry_type + self.username = username + self.visibility = visibility + self.created_at = created_at + self.updated_at = updated_at + } + public enum CodingKeys: String, CodingKey { + case name + case registry_type + case username + case visibility + case created_at + case updated_at + } + } + /// Private registry configuration for an organization + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories`. + public struct org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories: Codable, Hashable, Sendable { + /// The name of the private registry configuration. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/name`. + public var name: Swift.String + /// The registry type. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/registry_type`. + @frozen public enum registry_typePayload: String, Codable, Hashable, Sendable { + case maven_repository = "maven_repository" + } + /// The registry type. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/registry_type`. + public var registry_type: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories.registry_typePayload + /// The username to use when authenticating with the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/username`. + public var username: Swift.String? + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/visibility`. + public var visibility: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories.visibilityPayload + /// An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int]? + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/created_at`. + public var created_at: Foundation.Date + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/updated_at`. + public var updated_at: Foundation.Date + /// Creates a new `org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories`. + /// + /// - Parameters: + /// - name: The name of the private registry configuration. + /// - registry_type: The registry type. + /// - username: The username to use when authenticating with the private registry. + /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// - selected_repository_ids: An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. + /// - created_at: + /// - updated_at: + public init( + name: Swift.String, + registry_type: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories.registry_typePayload, + username: Swift.String? = nil, + visibility: Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories.visibilityPayload, + selected_repository_ids: [Swift.Int]? = nil, + created_at: Foundation.Date, + updated_at: Foundation.Date + ) { + self.name = name + self.registry_type = registry_type + self.username = username + self.visibility = visibility + self.selected_repository_ids = selected_repository_ids + self.created_at = created_at + self.updated_at = updated_at + } + public enum CodingKeys: String, CodingKey { + case name + case registry_type + case username + case visibility + case selected_repository_ids + case created_at + case updated_at + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + public enum Parameters { + /// 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 `#/components/parameters/per-page`. + public typealias per_hyphen_page = Swift.Int + /// 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`. + public typealias page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = Swift.String + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/parameters/secret-name`. + public typealias secret_hyphen_name = 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 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 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 validation_failed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.validation_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.validation_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.validation_failed.Body + /// Creates a new `validation_failed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.validation_failed.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} + 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 {} +public enum Operations { + /// List private registries for an organization + /// + /// + /// Lists all private registry configurations available at the organization-level without revealing their encrypted + /// values. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)`. + public enum private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries { + public static let id: Swift.String = "private-registries/list-org-private-registries" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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}/private-registries/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}/private-registries/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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Path, + query: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Input.Query = .init(), + headers: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.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}/private-registries/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/responses/200/content/json/configurations`. + public var configurations: [Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - configurations: + public init( + total_count: Swift.Int, + configurations: [Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration] + ) { + self.total_count = total_count + self.configurations = configurations + } + public enum CodingKeys: String, CodingKey { + case total_count + case configurations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/GET/responses/200/content/application\/json`. + case json(Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Headers = .init(), + body: Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.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.private_hyphen_registries_sol_list_hyphen_org_hyphen_private_hyphen_registries.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)/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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/get(private-registries/list-org-private-registries)/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 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 + ] + } + } + } + /// Create a private registry for an organization + /// + /// + /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/private-registries`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)`. + public enum private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry { + public static let id: Swift.String = "private-registries/create-org-private-registry" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/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.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The registry type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/registry_type`. + @frozen public enum registry_typePayload: String, Codable, Hashable, Sendable { + case maven_repository = "maven_repository" + } + /// The registry type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/registry_type`. + public var registry_type: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.registry_typePayload + /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/username`. + public var username: Swift.String? + /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/encrypted_value`. + public var encrypted_value: Swift.String + /// The ID of the key you used to encrypt the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/key_id`. + public var key_id: Swift.String + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/visibility`. + public var visibility: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.visibilityPayload + /// An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - registry_type: The registry type. + /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// - encrypted_value: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + /// - key_id: The ID of the key you used to encrypt the secret. + /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// - selected_repository_ids: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. + public init( + registry_type: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.registry_typePayload, + username: Swift.String? = nil, + encrypted_value: Swift.String, + key_id: Swift.String, + visibility: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.visibilityPayload, + selected_repository_ids: [Swift.Int]? = nil + ) { + self.registry_type = registry_type + self.username = username + self.encrypted_value = encrypted_value + self.key_id = key_id + self.visibility = visibility + self.selected_repository_ids = selected_repository_ids + } + public enum CodingKeys: String, CodingKey { + case registry_type + case username + case encrypted_value + case key_id + case visibility + case selected_repository_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/content/application\/json`. + case json(Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload) + } + public var body: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init(), + body: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.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}/private-registries/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/responses/201/content/application\/json`. + case json(Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories) + /// 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.org_hyphen_private_hyphen_registry_hyphen_configuration_hyphen_with_hyphen_selected_hyphen_repositories { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output.Created.Body) { + self.body = body + } + } + /// The organization private registry configuration + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.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.private_hyphen_registries_sol_create_hyphen_org_hyphen_private_hyphen_registry.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/post(private-registries/create-org-private-registry)/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 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 private registries public key for an organization + /// + /// + /// Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)`. + public enum private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key { + public static let id: Swift.String = "private-registries/get-org-public-key" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Input.Path, + headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.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}/private-registries/public-key/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The identifier for the key. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/responses/200/content/json/key_id`. + public var key_id: Swift.String + /// The Base64 encoded public key. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/responses/200/content/json/key`. + public var key: Swift.String + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - key_id: The identifier for the key. + /// - key: The Base64 encoded public key. + public init( + key_id: Swift.String, + key: Swift.String + ) { + self.key_id = key_id + self.key = key + } + public enum CodingKeys: String, CodingKey { + case key_id + case key + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/public-key/GET/responses/200/content/application\/json`. + case json(Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Headers = .init(), + body: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.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.private_hyphen_registries_sol_get_hyphen_org_hyphen_public_hyphen_key.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/public-key/get(private-registries/get-org-public-key)/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 a private registry for an organization + /// + /// + /// Get the configuration of a single private registry defined for an organization, omitting its encrypted value. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)`. + public enum private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry { + public static let id: Swift.String = "private-registries/get-org-private-registry" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/GET/path/org`. + public var org: Components.Parameters.org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/GET/path/secret_name`. + public var secret_name: Components.Parameters.secret_hyphen_name + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secret_name: The name of the secret. + public init( + org: Components.Parameters.org, + secret_name: Components.Parameters.secret_hyphen_name + ) { + self.org = org + self.secret_name = secret_name + } + } + public var path: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/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.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.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}/private-registries/{secret_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.org_hyphen_private_hyphen_registry_hyphen_configuration) + /// 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.org_hyphen_private_hyphen_registry_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output.Ok.Body) { + self.body = body + } + } + /// The specified private registry configuration for the organization + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.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.private_hyphen_registries_sol_get_hyphen_org_hyphen_private_hyphen_registry.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/get(private-registries/get-org-private-registry)/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 + ] + } + } + } + /// Update a private registry for an organization + /// + /// + /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)`. + public enum private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry { + public static let id: Swift.String = "private-registries/update-org-private-registry" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/path/org`. + public var org: Components.Parameters.org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/path/secret_name`. + public var secret_name: Components.Parameters.secret_hyphen_name + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secret_name: The name of the secret. + public init( + org: Components.Parameters.org, + secret_name: Components.Parameters.secret_hyphen_name + ) { + self.org = org + self.secret_name = secret_name + } + } + public var path: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/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.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The registry type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/registry_type`. + @frozen public enum registry_typePayload: String, Codable, Hashable, Sendable { + case maven_repository = "maven_repository" + } + /// The registry type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/registry_type`. + public var registry_type: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.registry_typePayload? + /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/username`. + public var username: Swift.String? + /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/encrypted_value`. + public var encrypted_value: Swift.String? + /// The ID of the key you used to encrypt the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/key_id`. + public var key_id: Swift.String? + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/visibility`. + @frozen public enum visibilityPayload: String, Codable, Hashable, Sendable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.visibilityPayload? + /// An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/selected_repository_ids`. + public var selected_repository_ids: [Swift.Int]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - registry_type: The registry type. + /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + /// - encrypted_value: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + /// - key_id: The ID of the key you used to encrypt the secret. + /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + /// - selected_repository_ids: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. + public init( + registry_type: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.registry_typePayload? = nil, + username: Swift.String? = nil, + encrypted_value: Swift.String? = nil, + key_id: Swift.String? = nil, + visibility: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload.visibilityPayload? = nil, + selected_repository_ids: [Swift.Int]? = nil + ) { + self.registry_type = registry_type + self.username = username + self.encrypted_value = encrypted_value + self.key_id = key_id + self.visibility = visibility + self.selected_repository_ids = selected_repository_ids + } + public enum CodingKeys: String, CodingKey { + case registry_type + case username + case encrypted_value + case key_id + case visibility + case selected_repository_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/content/application\/json`. + case json(Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body.jsonPayload) + } + public var body: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Headers = .init(), + body: Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.Input.Body + ) { + self.path = path + self.headers = headers + 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}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.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.private_hyphen_registries_sol_update_hyphen_org_hyphen_private_hyphen_registry.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}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/patch(private-registries/update-org-private-registry)/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 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 private registry for an organization + /// + /// + /// Delete a private registry configuration at the organization-level. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/private-registries/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)`. + public enum private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry { + public static let id: Swift.String = "private-registries/delete-org-private-registry" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/DELETE/path/org`. + public var org: Components.Parameters.org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/DELETE/path/secret_name`. + public var secret_name: Components.Parameters.secret_hyphen_name + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secret_name: The name of the secret. + public init( + org: Components.Parameters.org, + secret_name: Components.Parameters.secret_hyphen_name + ) { + self.org = org + self.secret_name = secret_name + } + } + public var path: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/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.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Input.Path, + headers: Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.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}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.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.private_hyphen_registries_sol_delete_hyphen_org_hyphen_private_hyphen_registry.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)/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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/private-registries/{secret_name}/delete(private-registries/delete-org-private-registry)/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 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 + ] + } + } + } +} From 0aa24dd13e098fb080b70ebfde512b9c7ac83968 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:54:46 +0000 Subject: [PATCH 31/37] Commit via running ake Sources/hosted-compute --- Sources/hosted-compute/Client.swift | 473 ++++++++++ Sources/hosted-compute/Types.swift | 1324 +++++++++++++++++++++++++++ 2 files changed, 1797 insertions(+) create mode 100644 Sources/hosted-compute/Client.swift create mode 100644 Sources/hosted-compute/Types.swift diff --git a/Sources/hosted-compute/Client.swift b/Sources/hosted-compute/Client.swift new file mode 100644 index 00000000000..e84741437d2 --- /dev/null +++ b/Sources/hosted-compute/Client.swift @@ -0,0 +1,473 @@ +// 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 + } + /// List hosted compute network configurations for an organization + /// + /// Lists all hosted compute network configurations configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/get(hosted-compute/list-network-configurations-for-org)`. + public func hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-configurations", + 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 + ) + 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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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 + ) + ) + } + } + ) + } + /// Create a hosted compute network configuration for an organization + /// + /// Creates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/post(hosted-compute/create-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-configurations", + 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.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_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.network_hyphen_configuration.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 hosted compute network configuration for an organization + /// + /// Gets a hosted compute network configuration configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/get(hosted-compute/get-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-configurations/{}", + parameters: [ + input.path.org, + input.path.network_configuration_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 headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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.network_hyphen_configuration.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 + ) + ) + } + } + ) + } + /// Update a hosted compute network configuration for an organization + /// + /// Updates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/patch(hosted-compute/update-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-configurations/{}", + parameters: [ + input.path.org, + input.path.network_configuration_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.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_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.network_hyphen_configuration.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 hosted compute network configuration from an organization + /// + /// Deletes a hosted compute network configuration from an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/delete(hosted-compute/delete-network-configuration-from-org)`. + public func hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-configurations/{}", + parameters: [ + input.path.org, + input.path.network_configuration_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 + ) + ) + } + } + ) + } + /// Get a hosted compute network settings resource for an organization + /// + /// Gets a hosted compute network settings resource configured for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-settings/{network_settings_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-settings/{network_settings_id}/get(hosted-compute/get-network-settings-for-org)`. + public func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/network-settings/{}", + parameters: [ + input.path.org, + input.path.network_settings_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 headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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.network_hyphen_settings.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 + ) + ) + } + } + ) + } +} diff --git a/Sources/hosted-compute/Types.swift b/Sources/hosted-compute/Types.swift new file mode 100644 index 00000000000..3ea064e4dba --- /dev/null +++ b/Sources/hosted-compute/Types.swift @@ -0,0 +1,1324 @@ +// 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 { + /// List hosted compute network configurations for an organization + /// + /// Lists all hosted compute network configurations configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/get(hosted-compute/list-network-configurations-for-org)`. + func hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output + /// Create a hosted compute network configuration for an organization + /// + /// Creates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/post(hosted-compute/create-network-configuration-for-org)`. + func hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output + /// Get a hosted compute network configuration for an organization + /// + /// Gets a hosted compute network configuration configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/get(hosted-compute/get-network-configuration-for-org)`. + func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output + /// Update a hosted compute network configuration for an organization + /// + /// Updates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/patch(hosted-compute/update-network-configuration-for-org)`. + func hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output + /// Delete a hosted compute network configuration from an organization + /// + /// Deletes a hosted compute network configuration from an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/delete(hosted-compute/delete-network-configuration-from-org)`. + func hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Output + /// Get a hosted compute network settings resource for an organization + /// + /// Gets a hosted compute network settings resource configured for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-settings/{network_settings_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-settings/{network_settings_id}/get(hosted-compute/get-network-settings-for-org)`. + func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org(_ input: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List hosted compute network configurations for an organization + /// + /// Lists all hosted compute network configurations configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/get(hosted-compute/list-network-configurations-for-org)`. + public func hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org( + path: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Path, + query: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output { + try await hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org(Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a hosted compute network configuration for an organization + /// + /// Creates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/post(hosted-compute/create-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org( + path: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a hosted compute network configuration for an organization + /// + /// Gets a hosted compute network configuration configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/get(hosted-compute/get-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org( + path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } + /// Update a hosted compute network configuration for an organization + /// + /// Updates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/patch(hosted-compute/update-network-configuration-for-org)`. + public func hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org( + path: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body + ) async throws -> Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output { + try await hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org(Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a hosted compute network configuration from an organization + /// + /// Deletes a hosted compute network configuration from an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/delete(hosted-compute/delete-network-configuration-from-org)`. + public func hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org(path: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Input.Path) async throws -> Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Output { + try await hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org(Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Input(path: path)) + } + /// Get a hosted compute network settings resource for an organization + /// + /// Gets a hosted compute network settings resource configured for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-settings/{network_settings_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-settings/{network_settings_id}/get(hosted-compute/get-network-settings-for-org)`. + public func hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org( + path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input.Headers = .init() + ) async throws -> Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output { + try await hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org(Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input( + path: path, + headers: headers + )) + } +} + +/// 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 { + /// A hosted compute network configuration. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration`. + public struct network_hyphen_configuration: Codable, Hashable, Sendable { + /// The unique identifier of the network configuration. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/id`. + public var id: Swift.String + /// The name of the network configuration. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/name`. + public var name: Swift.String + /// The hosted compute service the network configuration supports. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/compute_service`. + @frozen public enum compute_servicePayload: String, Codable, Hashable, Sendable { + case none = "none" + case actions = "actions" + case codespaces = "codespaces" + } + /// The hosted compute service the network configuration supports. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/compute_service`. + public var compute_service: Components.Schemas.network_hyphen_configuration.compute_servicePayload? + /// The unique identifier of each network settings in the configuration. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/network_settings_ids`. + public var network_settings_ids: [Swift.String]? + /// The time at which the network configuration was created, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/network-configuration/created_on`. + public var created_on: Foundation.Date? + /// Creates a new `network_hyphen_configuration`. + /// + /// - Parameters: + /// - id: The unique identifier of the network configuration. + /// - name: The name of the network configuration. + /// - compute_service: The hosted compute service the network configuration supports. + /// - network_settings_ids: The unique identifier of each network settings in the configuration. + /// - created_on: The time at which the network configuration was created, in ISO 8601 format. + public init( + id: Swift.String, + name: Swift.String, + compute_service: Components.Schemas.network_hyphen_configuration.compute_servicePayload? = nil, + network_settings_ids: [Swift.String]? = nil, + created_on: Foundation.Date? = nil + ) { + self.id = id + self.name = name + self.compute_service = compute_service + self.network_settings_ids = network_settings_ids + self.created_on = created_on + } + public enum CodingKeys: String, CodingKey { + case id + case name + case compute_service + case network_settings_ids + case created_on + } + } + /// A hosted compute network settings resource. + /// + /// - Remark: Generated from `#/components/schemas/network-settings`. + public struct network_hyphen_settings: Codable, Hashable, Sendable { + /// The unique identifier of the network settings resource. + /// + /// - Remark: Generated from `#/components/schemas/network-settings/id`. + public var id: Swift.String + /// The identifier of the network configuration that is using this settings resource. + /// + /// - Remark: Generated from `#/components/schemas/network-settings/network_configuration_id`. + public var network_configuration_id: Swift.String? + /// The name of the network settings resource. + /// + /// - Remark: Generated from `#/components/schemas/network-settings/name`. + public var name: Swift.String + /// The subnet this network settings resource is configured for. + /// + /// - Remark: Generated from `#/components/schemas/network-settings/subnet_id`. + public var subnet_id: Swift.String + /// The location of the subnet this network settings resource is configured for. + /// + /// - Remark: Generated from `#/components/schemas/network-settings/region`. + public var region: Swift.String + /// Creates a new `network_hyphen_settings`. + /// + /// - Parameters: + /// - id: The unique identifier of the network settings resource. + /// - network_configuration_id: The identifier of the network configuration that is using this settings resource. + /// - name: The name of the network settings resource. + /// - subnet_id: The subnet this network settings resource is configured for. + /// - region: The location of the subnet this network settings resource is configured for. + public init( + id: Swift.String, + network_configuration_id: Swift.String? = nil, + name: Swift.String, + subnet_id: Swift.String, + region: Swift.String + ) { + self.id = id + self.network_configuration_id = network_configuration_id + self.name = name + self.subnet_id = subnet_id + self.region = region + } + public enum CodingKeys: String, CodingKey { + case id + case network_configuration_id + case name + case subnet_id + case region + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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 `#/components/parameters/per-page`. + public typealias per_hyphen_page = Swift.Int + /// 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`. + public typealias page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = Swift.String + /// Unique identifier of the hosted compute network configuration. + /// + /// - Remark: Generated from `#/components/parameters/network-configuration-id`. + public typealias network_hyphen_configuration_hyphen_id = Swift.String + /// Unique identifier of the hosted compute network settings. + /// + /// - Remark: Generated from `#/components/parameters/network-settings-id`. + public typealias network_hyphen_settings_hyphen_id = 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 {} + /// 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 hosted compute network configurations for an organization + /// + /// Lists all hosted compute network configurations configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/get(hosted-compute/list-network-configurations-for-org)`. + public enum hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org { + public static let id: Swift.String = "hosted-compute/list-network-configurations-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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}/settings/network-configurations/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}/settings/network-configurations/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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Path, + query: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Input.Query = .init(), + headers: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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}/settings/network-configurations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/responses/200/content/json/total_count`. + public var total_count: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/responses/200/content/json/network_configurations`. + public var network_configurations: [Components.Schemas.network_hyphen_configuration] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_count: + /// - network_configurations: + public init( + total_count: Swift.Int, + network_configurations: [Components.Schemas.network_hyphen_configuration] + ) { + self.total_count = total_count + self.network_configurations = network_configurations + } + public enum CodingKeys: String, CodingKey { + case total_count + case network_configurations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/GET/responses/200/content/application\/json`. + case json(Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/get(hosted-compute/list-network-configurations-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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.hosted_hyphen_compute_sol_list_hyphen_network_hyphen_configurations_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 hosted compute network configuration for an organization + /// + /// Creates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/settings/network-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/post(hosted-compute/create-network-configuration-for-org)`. + public enum hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org { + public static let id: Swift.String = "hosted-compute/create-network-configuration-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/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.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/name`. + public var name: Swift.String + /// The hosted compute service to use for the network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/compute_service`. + @frozen public enum compute_servicePayload: String, Codable, Hashable, Sendable { + case none = "none" + case actions = "actions" + } + /// The hosted compute service to use for the network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/compute_service`. + public var compute_service: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload.compute_servicePayload? + /// The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/network_settings_ids`. + public var network_settings_ids: [Swift.String] + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// - compute_service: The hosted compute service to use for the network configuration. + /// - network_settings_ids: The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + public init( + name: Swift.String, + compute_service: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload.compute_servicePayload? = nil, + network_settings_ids: [Swift.String] + ) { + self.name = name + self.compute_service = compute_service + self.network_settings_ids = network_settings_ids + } + public enum CodingKeys: String, CodingKey { + case name + case compute_service + case network_settings_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/content/application\/json`. + case json(Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_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}/settings/network-configurations/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.network_hyphen_configuration) + /// 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.network_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/post(hosted-compute/create-network-configuration-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_create_hyphen_network_hyphen_configuration_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 hosted compute network configuration for an organization + /// + /// Gets a hosted compute network configuration configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/get(hosted-compute/get-network-configuration-for-org)`. + public enum hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org { + public static let id: Swift.String = "hosted-compute/get-network-configuration-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/GET/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/GET/path/network_configuration_id`. + public var network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - network_configuration_id: Unique identifier of the hosted compute network configuration. + public init( + org: Components.Parameters.org, + network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + ) { + self.org = org + self.network_configuration_id = network_configuration_id + } + } + public var path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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}/settings/network-configurations/{network_configuration_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.network_hyphen_configuration) + /// 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.network_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/get(hosted-compute/get-network-configuration-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_configuration_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 hosted compute network configuration for an organization + /// + /// Updates a hosted compute network configuration for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/patch(hosted-compute/update-network-configuration-for-org)`. + public enum hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org { + public static let id: Swift.String = "hosted-compute/update-network-configuration-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/path/network_configuration_id`. + public var network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - network_configuration_id: Unique identifier of the hosted compute network configuration. + public init( + org: Components.Parameters.org, + network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + ) { + self.org = org + self.network_configuration_id = network_configuration_id + } + } + public var path: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_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.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The hosted compute service to use for the network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/compute_service`. + @frozen public enum compute_servicePayload: String, Codable, Hashable, Sendable { + case none = "none" + case actions = "actions" + } + /// The hosted compute service to use for the network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/compute_service`. + public var compute_service: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload.compute_servicePayload? + /// The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/network_settings_ids`. + public var network_settings_ids: [Swift.String]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// - compute_service: The hosted compute service to use for the network configuration. + /// - network_settings_ids: The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. + public init( + name: Swift.String? = nil, + compute_service: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload.compute_servicePayload? = nil, + network_settings_ids: [Swift.String]? = nil + ) { + self.name = name + self.compute_service = compute_service + self.network_settings_ids = network_settings_ids + } + public enum CodingKeys: String, CodingKey { + case name + case compute_service + case network_settings_ids + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body.jsonPayload) + } + public var body: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Input.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_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}/settings/network-configurations/{network_configuration_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.network_hyphen_configuration) + /// 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.network_hyphen_configuration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_hyphen_for_hyphen_org.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/patch(hosted-compute/update-network-configuration-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_update_hyphen_network_hyphen_configuration_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 hosted compute network configuration from an organization + /// + /// Deletes a hosted compute network configuration from an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-configurations/{network_configuration_id}/delete(hosted-compute/delete-network-configuration-from-org)`. + public enum hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org { + public static let id: Swift.String = "hosted-compute/delete-network-configuration-from-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/DELETE/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/DELETE/path/network_configuration_id`. + public var network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - network_configuration_id: Unique identifier of the hosted compute network configuration. + public init( + org: Components.Parameters.org, + network_configuration_id: Components.Parameters.network_hyphen_configuration_hyphen_id + ) { + self.org = org + self.network_configuration_id = network_configuration_id + } + } + public var path: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_hyphen_from_hyphen_org.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_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}/settings/network-configurations/{network_configuration_id}/delete(hosted-compute/delete-network-configuration-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_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.hosted_hyphen_compute_sol_delete_hyphen_network_hyphen_configuration_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) + } + } + /// Get a hosted compute network settings resource for an organization + /// + /// Gets a hosted compute network settings resource configured for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/network-settings/{network_settings_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-settings/{network_settings_id}/get(hosted-compute/get-network-settings-for-org)`. + public enum hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org { + public static let id: Swift.String = "hosted-compute/get-network-settings-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/GET/path/org`. + public var org: Components.Parameters.org + /// Unique identifier of the hosted compute network settings. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/GET/path/network_settings_id`. + public var network_settings_id: Components.Parameters.network_hyphen_settings_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - network_settings_id: Unique identifier of the hosted compute network settings. + public init( + org: Components.Parameters.org, + network_settings_id: Components.Parameters.network_hyphen_settings_hyphen_id + ) { + self.org = org + self.network_settings_id = network_settings_id + } + } + public var path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Input.Path, + headers: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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}/settings/network-settings/{network_settings_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-settings/{network_settings_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.network_hyphen_settings) + /// 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.network_hyphen_settings { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output.Ok.Headers = .init(), + body: Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_hyphen_for_hyphen_org.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/network-settings/{network_settings_id}/get(hosted-compute/get-network-settings-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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.hosted_hyphen_compute_sol_get_hyphen_network_hyphen_settings_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 + ] + } + } + } +} From ad05c76b3a5a04ec9388de032073e67b0676b94a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:55:09 +0000 Subject: [PATCH 32/37] Commit via running ake Sources/campaigns --- Sources/campaigns/Client.swift | 760 ++++++++++ Sources/campaigns/Types.swift | 2486 ++++++++++++++++++++++++++++++++ 2 files changed, 3246 insertions(+) create mode 100644 Sources/campaigns/Client.swift create mode 100644 Sources/campaigns/Types.swift diff --git a/Sources/campaigns/Client.swift b/Sources/campaigns/Client.swift new file mode 100644 index 00000000000..ae99ad9c1c8 --- /dev/null +++ b/Sources/campaigns/Client.swift @@ -0,0 +1,760 @@ +// 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 + } + /// List campaigns for an organization + /// + /// Lists campaigns in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`. + public func campaigns_sol_list_hyphen_org_hyphen_campaigns(_ input: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input) async throws -> Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output { + try await client.send( + input: input, + forOperation: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/campaigns", + 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: "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: "state", + value: input.query.state + ) + 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 headers: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.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.campaigns_sol_list_hyphen_org_hyphen_campaigns.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.campaign_hyphen_summary].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + 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 campaign for an organization + /// + /// Create a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included + /// in the campaign. + /// + /// - Remark: HTTP `POST /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`. + public func campaigns_sol_create_hyphen_campaign(_ input: Operations.campaigns_sol_create_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_create_hyphen_campaign.Output { + try await client.send( + input: input, + forOperation: Operations.campaigns_sol_create_hyphen_campaign.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/campaigns", + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.campaigns_sol_create_hyphen_campaign.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.campaign_hyphen_summary.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: Operations.campaigns_sol_create_hyphen_campaign.Output.BadRequest.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 .badRequest(.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: Operations.campaigns_sol_create_hyphen_campaign.Output.UnprocessableContent.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)) + case 429: + return .tooManyRequests(.init()) + 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 a campaign for an organization + /// + /// Gets a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`. + public func campaigns_sol_get_hyphen_campaign_hyphen_summary(_ input: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input) async throws -> Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output { + try await client.send( + input: input, + forOperation: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/campaigns/{}", + parameters: [ + input.path.org, + input.path.campaign_number + ] + ) + 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.campaigns_sol_get_hyphen_campaign_hyphen_summary.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.campaign_hyphen_summary.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.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: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.UnprocessableContent.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)) + 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 + ) + ) + } + } + ) + } + /// Update a campaign + /// + /// Updates a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`. + public func campaigns_sol_update_hyphen_campaign(_ input: Operations.campaigns_sol_update_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_update_hyphen_campaign.Output { + try await client.send( + input: input, + forOperation: Operations.campaigns_sol_update_hyphen_campaign.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/campaigns/{}", + parameters: [ + input.path.org, + input.path.campaign_number + ] + ) + 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.campaigns_sol_update_hyphen_campaign.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.campaign_hyphen_summary.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: Operations.campaigns_sol_update_hyphen_campaign.Output.BadRequest.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 .badRequest(.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: Operations.campaigns_sol_update_hyphen_campaign.Output.UnprocessableContent.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)) + 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 + ) + ) + } + } + ) + } + /// Delete a campaign for an organization + /// + /// Deletes a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`. + public func campaigns_sol_delete_hyphen_campaign(_ input: Operations.campaigns_sol_delete_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_delete_hyphen_campaign.Output { + try await client.send( + input: input, + forOperation: Operations.campaigns_sol_delete_hyphen_campaign.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/campaigns/{}", + parameters: [ + input.path.org, + input.path.campaign_number + ] + ) + 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 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 + ) + ) + } + } + ) + } +} diff --git a/Sources/campaigns/Types.swift b/Sources/campaigns/Types.swift new file mode 100644 index 00000000000..768df1d84ee --- /dev/null +++ b/Sources/campaigns/Types.swift @@ -0,0 +1,2486 @@ +// 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 { + /// List campaigns for an organization + /// + /// Lists campaigns in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`. + func campaigns_sol_list_hyphen_org_hyphen_campaigns(_ input: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input) async throws -> Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output + /// Create a campaign for an organization + /// + /// Create a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included + /// in the campaign. + /// + /// - Remark: HTTP `POST /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`. + func campaigns_sol_create_hyphen_campaign(_ input: Operations.campaigns_sol_create_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_create_hyphen_campaign.Output + /// Get a campaign for an organization + /// + /// Gets a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`. + func campaigns_sol_get_hyphen_campaign_hyphen_summary(_ input: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input) async throws -> Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output + /// Update a campaign + /// + /// Updates a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`. + func campaigns_sol_update_hyphen_campaign(_ input: Operations.campaigns_sol_update_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_update_hyphen_campaign.Output + /// Delete a campaign for an organization + /// + /// Deletes a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`. + func campaigns_sol_delete_hyphen_campaign(_ input: Operations.campaigns_sol_delete_hyphen_campaign.Input) async throws -> Operations.campaigns_sol_delete_hyphen_campaign.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List campaigns for an organization + /// + /// Lists campaigns in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`. + public func campaigns_sol_list_hyphen_org_hyphen_campaigns( + path: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Path, + query: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Query = .init(), + headers: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Headers = .init() + ) async throws -> Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output { + try await campaigns_sol_list_hyphen_org_hyphen_campaigns(Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a campaign for an organization + /// + /// Create a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included + /// in the campaign. + /// + /// - Remark: HTTP `POST /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`. + public func campaigns_sol_create_hyphen_campaign( + path: Operations.campaigns_sol_create_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_create_hyphen_campaign.Input.Headers = .init(), + body: Operations.campaigns_sol_create_hyphen_campaign.Input.Body + ) async throws -> Operations.campaigns_sol_create_hyphen_campaign.Output { + try await campaigns_sol_create_hyphen_campaign(Operations.campaigns_sol_create_hyphen_campaign.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a campaign for an organization + /// + /// Gets a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`. + public func campaigns_sol_get_hyphen_campaign_hyphen_summary( + path: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input.Path, + headers: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input.Headers = .init() + ) async throws -> Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output { + try await campaigns_sol_get_hyphen_campaign_hyphen_summary(Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input( + path: path, + headers: headers + )) + } + /// Update a campaign + /// + /// Updates a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`. + public func campaigns_sol_update_hyphen_campaign( + path: Operations.campaigns_sol_update_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_update_hyphen_campaign.Input.Headers = .init(), + body: Operations.campaigns_sol_update_hyphen_campaign.Input.Body + ) async throws -> Operations.campaigns_sol_update_hyphen_campaign.Output { + try await campaigns_sol_update_hyphen_campaign(Operations.campaigns_sol_update_hyphen_campaign.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a campaign for an organization + /// + /// Deletes a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`. + public func campaigns_sol_delete_hyphen_campaign( + path: Operations.campaigns_sol_delete_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_delete_hyphen_campaign.Input.Headers = .init() + ) async throws -> Operations.campaigns_sol_delete_hyphen_campaign.Output { + try await campaigns_sol_delete_hyphen_campaign(Operations.campaigns_sol_delete_hyphen_campaign.Input( + path: path, + headers: headers + )) + } +} + +/// 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 { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct simple_hyphen_user: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatar_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatar_id: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followers_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var following_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gists_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starred_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptions_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizations_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var repos_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var received_events_url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + 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: + /// - name: + /// - email: + /// - login: + /// - id: + /// - node_id: + /// - avatar_url: + /// - gravatar_id: + /// - url: + /// - html_url: + /// - followers_url: + /// - following_url: + /// - gists_url: + /// - starred_url: + /// - subscriptions_url: + /// - organizations_url: + /// - repos_url: + /// - events_url: + /// - received_events_url: + /// - _type: + /// - site_admin: + /// - starred_at: + /// - user_view_type: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + node_id: Swift.String, + avatar_url: Swift.String, + gravatar_id: Swift.String? = nil, + url: Swift.String, + html_url: Swift.String, + followers_url: Swift.String, + following_url: Swift.String, + gists_url: Swift.String, + starred_url: Swift.String, + subscriptions_url: Swift.String, + organizations_url: Swift.String, + repos_url: Swift.String, + events_url: Swift.String, + received_events_url: Swift.String, + _type: Swift.String, + site_admin: Swift.Bool, + starred_at: Swift.String? = nil, + user_view_type: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.node_id = node_id + self.avatar_url = avatar_url + self.gravatar_id = gravatar_id + self.url = url + self.html_url = html_url + self.followers_url = followers_url + self.following_url = following_url + self.gists_url = gists_url + self.starred_url = starred_url + self.subscriptions_url = subscriptions_url + self.organizations_url = organizations_url + self.repos_url = repos_url + self.events_url = events_url + self.received_events_url = received_events_url + 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 + case email + case login + case id + case node_id + case avatar_url + case gravatar_id + case url + case html_url + case followers_url + case following_url + case gists_url + case starred_url + case subscriptions_url + case organizations_url + case repos_url + case events_url + case received_events_url + case _type = "type" + case site_admin + case starred_at + case user_view_type + } + } + /// 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 + } + } + /// Indicates whether a campaign is open or closed + /// + /// - Remark: Generated from `#/components/schemas/campaign-state`. + @frozen public enum campaign_hyphen_state: String, Codable, Hashable, Sendable { + case open = "open" + case closed = "closed" + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct nullable_hyphen_team_hyphen_simple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var node_id: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var members_url: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldap_dn: Swift.String? + /// Creates a new `nullable_hyphen_team_hyphen_simple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - node_id: + /// - url: URL for the team + /// - members_url: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notification_setting: The notification setting the team has set + /// - html_url: + /// - repositories_url: + /// - slug: + /// - ldap_dn: Distinguished Name (DN) that team maps to within LDAP environment + public init( + id: Swift.Int, + node_id: Swift.String, + url: Swift.String, + members_url: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + html_url: Swift.String, + repositories_url: Swift.String, + slug: Swift.String, + ldap_dn: Swift.String? = nil + ) { + self.id = id + self.node_id = node_id + self.url = url + self.members_url = members_url + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notification_setting = notification_setting + self.html_url = html_url + self.repositories_url = repositories_url + self.slug = slug + self.ldap_dn = ldap_dn + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case url + case members_url + case name + case description + case permission + case privacy + case notification_setting + case html_url + case repositories_url + case slug + case ldap_dn + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var node_id: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notification_setting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct permissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `permissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.team.permissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var html_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var members_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositories_url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? + /// Creates a new `team`. + /// + /// - Parameters: + /// - id: + /// - node_id: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notification_setting: + /// - permission: + /// - permissions: + /// - url: + /// - html_url: + /// - members_url: + /// - repositories_url: + /// - parent: + public init( + id: Swift.Int, + node_id: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notification_setting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.team.permissionsPayload? = nil, + url: Swift.String, + html_url: Swift.String, + members_url: Swift.String, + repositories_url: Swift.String, + parent: Components.Schemas.nullable_hyphen_team_hyphen_simple? = nil + ) { + self.id = id + self.node_id = node_id + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notification_setting = notification_setting + self.permission = permission + self.permissions = permissions + self.url = url + self.html_url = html_url + self.members_url = members_url + self.repositories_url = repositories_url + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case node_id + case name + case slug + case description + case privacy + case notification_setting + case permission + case permissions + case url + case html_url + case members_url + case repositories_url + case parent + } + } + /// The campaign metadata and alert stats. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary`. + public struct campaign_hyphen_summary: Codable, Hashable, Sendable { + /// The number of the newly created campaign + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/number`. + public var number: Swift.Int + /// The date and time the campaign was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/created_at`. + public var created_at: Foundation.Date + /// The date and time the campaign was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/updated_at`. + public var updated_at: Foundation.Date + /// The campaign name + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/name`. + public var name: Swift.String? + /// The campaign description + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/description`. + public var description: Swift.String + /// The campaign managers + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/managers`. + public var managers: [Components.Schemas.simple_hyphen_user] + /// The campaign team managers + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/team_managers`. + public var team_managers: [Components.Schemas.team]? + /// The date and time the campaign was published, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/published_at`. + public var published_at: Foundation.Date? + /// The date and time the campaign has ended, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/ends_at`. + public var ends_at: Foundation.Date + /// The date and time the campaign was closed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the campaign is still open. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/closed_at`. + public var closed_at: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/campaign-summary/state`. + public var state: Components.Schemas.campaign_hyphen_state + /// The contact link of the campaign. + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/contact_link`. + public var contact_link: Swift.String? + /// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats`. + public struct alert_statsPayload: Codable, Hashable, Sendable { + /// The number of open alerts + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/open_count`. + public var open_count: Swift.Int + /// The number of closed alerts + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/closed_count`. + public var closed_count: Swift.Int + /// The number of in-progress alerts + /// + /// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/in_progress_count`. + public var in_progress_count: Swift.Int + /// Creates a new `alert_statsPayload`. + /// + /// - Parameters: + /// - open_count: The number of open alerts + /// - closed_count: The number of closed alerts + /// - in_progress_count: The number of in-progress alerts + public init( + open_count: Swift.Int, + closed_count: Swift.Int, + in_progress_count: Swift.Int + ) { + self.open_count = open_count + self.closed_count = closed_count + self.in_progress_count = in_progress_count + } + public enum CodingKeys: String, CodingKey { + case open_count + case closed_count + case in_progress_count + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + open_count = try container.decode( + Swift.Int.self, + forKey: .open_count + ) + closed_count = try container.decode( + Swift.Int.self, + forKey: .closed_count + ) + in_progress_count = try container.decode( + Swift.Int.self, + forKey: .in_progress_count + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "open_count", + "closed_count", + "in_progress_count" + ]) + } + } + /// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats`. + public var alert_stats: Components.Schemas.campaign_hyphen_summary.alert_statsPayload? + /// Creates a new `campaign_hyphen_summary`. + /// + /// - Parameters: + /// - number: The number of the newly created campaign + /// - created_at: The date and time the campaign was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - updated_at: The date and time the campaign was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - name: The campaign name + /// - description: The campaign description + /// - managers: The campaign managers + /// - team_managers: The campaign team managers + /// - published_at: The date and time the campaign was published, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - ends_at: The date and time the campaign has ended, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - closed_at: The date and time the campaign was closed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the campaign is still open. + /// - state: + /// - contact_link: The contact link of the campaign. + /// - alert_stats: + public init( + number: Swift.Int, + created_at: Foundation.Date, + updated_at: Foundation.Date, + name: Swift.String? = nil, + description: Swift.String, + managers: [Components.Schemas.simple_hyphen_user], + team_managers: [Components.Schemas.team]? = nil, + published_at: Foundation.Date? = nil, + ends_at: Foundation.Date, + closed_at: Foundation.Date? = nil, + state: Components.Schemas.campaign_hyphen_state, + contact_link: Swift.String? = nil, + alert_stats: Components.Schemas.campaign_hyphen_summary.alert_statsPayload? = nil + ) { + self.number = number + self.created_at = created_at + self.updated_at = updated_at + self.name = name + self.description = description + self.managers = managers + self.team_managers = team_managers + self.published_at = published_at + self.ends_at = ends_at + self.closed_at = closed_at + self.state = state + self.contact_link = contact_link + self.alert_stats = alert_stats + } + public enum CodingKeys: String, CodingKey { + case number + case created_at + case updated_at + case name + case description + case managers + case team_managers + case published_at + case ends_at + case closed_at + case state + case contact_link + case alert_stats + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// 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 `#/components/parameters/per-page`. + public typealias per_hyphen_page = Swift.Int + /// 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`. + public typealias page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = 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`. + /// + /// - 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 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 + } + } + } + /// 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 campaigns for an organization + /// + /// Lists campaigns in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`. + public enum campaigns_sol_list_hyphen_org_hyphen_campaigns { + public static let id: Swift.String = "campaigns/list-org-campaigns" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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}/campaigns/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}/campaigns/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}/campaigns/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// If specified, only campaigns with this state will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/query/state`. + public var state: Components.Schemas.campaign_hyphen_state? + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/query/sort`. + @frozen public enum sortPayload: String, Codable, Hashable, Sendable { + case created = "created" + case updated = "updated" + case ends_at = "ends_at" + case published = "published" + } + /// The property by which to sort the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/query/sort`. + public var sort: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Query.sortPayload? + /// 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)." + /// - direction: The direction to sort the results by. + /// - state: If specified, only campaigns with this state will be returned. + /// - sort: The property by which to sort the results. + public init( + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + state: Components.Schemas.campaign_hyphen_state? = nil, + sort: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Query.sortPayload? = nil + ) { + self.page = page + self.per_page = per_page + self.direction = direction + self.state = state + self.sort = sort + } + } + public var query: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Path, + query: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Input.Query = .init(), + headers: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.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}/campaigns/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/GET/responses/200/content/application\/json`. + case json([Components.Schemas.campaign_hyphen_summary]) + /// 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.campaign_hyphen_summary] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output.Ok.Headers = .init(), + body: Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.campaigns_sol_list_hyphen_org_hyphen_campaigns.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.campaigns_sol_list_hyphen_org_hyphen_campaigns.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)/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//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)/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 campaign for an organization + /// + /// Create a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included + /// in the campaign. + /// + /// - Remark: HTTP `POST /orgs/{org}/campaigns`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`. + public enum campaigns_sol_create_hyphen_campaign { + public static let id: Swift.String = "campaigns/create-campaign" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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.campaigns_sol_create_hyphen_campaign.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/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.campaigns_sol_create_hyphen_campaign.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/name`. + public var name: Swift.String + /// A description for the campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/description`. + public var description: Swift.String + /// The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/managers`. + public var managers: [Swift.String]? + /// The slugs of the teams to set as the campaign managers. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/team_managers`. + public var team_managers: [Swift.String]? + /// The end date and time of the campaign. The date must be in the future. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/ends_at`. + public var ends_at: Foundation.Date + /// The contact link of the campaign. Must be a URI. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/contact_link`. + public var contact_link: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alertsPayload`. + public struct code_scanning_alertsPayloadPayload: Codable, Hashable, Sendable { + /// The repository id + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alertsPayload/repository_id`. + public var repository_id: Swift.Int + /// The alert numbers + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alertsPayload/alert_numbers`. + public var alert_numbers: [Swift.Int] + /// Creates a new `code_scanning_alertsPayloadPayload`. + /// + /// - Parameters: + /// - repository_id: The repository id + /// - alert_numbers: The alert numbers + public init( + repository_id: Swift.Int, + alert_numbers: [Swift.Int] + ) { + self.repository_id = repository_id + self.alert_numbers = alert_numbers + } + public enum CodingKeys: String, CodingKey { + case repository_id + case alert_numbers + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + repository_id = try container.decode( + Swift.Int.self, + forKey: .repository_id + ) + alert_numbers = try container.decode( + [Swift.Int].self, + forKey: .alert_numbers + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "repository_id", + "alert_numbers" + ]) + } + } + /// The code scanning alerts to include in this campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alerts`. + public typealias code_scanning_alertsPayload = [Operations.campaigns_sol_create_hyphen_campaign.Input.Body.jsonPayload.code_scanning_alertsPayloadPayload] + /// The code scanning alerts to include in this campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alerts`. + public var code_scanning_alerts: Operations.campaigns_sol_create_hyphen_campaign.Input.Body.jsonPayload.code_scanning_alertsPayload + /// If true, will automatically generate issues for the campaign. The default is false. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/generate_issues`. + public var generate_issues: Swift.Bool? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the campaign + /// - description: A description for the campaign + /// - managers: The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. + /// - team_managers: The slugs of the teams to set as the campaign managers. + /// - ends_at: The end date and time of the campaign. The date must be in the future. + /// - contact_link: The contact link of the campaign. Must be a URI. + /// - code_scanning_alerts: The code scanning alerts to include in this campaign + /// - generate_issues: If true, will automatically generate issues for the campaign. The default is false. + public init( + name: Swift.String, + description: Swift.String, + managers: [Swift.String]? = nil, + team_managers: [Swift.String]? = nil, + ends_at: Foundation.Date, + contact_link: Swift.String? = nil, + code_scanning_alerts: Operations.campaigns_sol_create_hyphen_campaign.Input.Body.jsonPayload.code_scanning_alertsPayload, + generate_issues: Swift.Bool? = nil + ) { + self.name = name + self.description = description + self.managers = managers + self.team_managers = team_managers + self.ends_at = ends_at + self.contact_link = contact_link + self.code_scanning_alerts = code_scanning_alerts + self.generate_issues = generate_issues + } + public enum CodingKeys: String, CodingKey { + case name + case description + case managers + case team_managers + case ends_at + case contact_link + case code_scanning_alerts + case generate_issues + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decode( + Swift.String.self, + forKey: .name + ) + description = try container.decode( + Swift.String.self, + forKey: .description + ) + managers = try container.decodeIfPresent( + [Swift.String].self, + forKey: .managers + ) + team_managers = try container.decodeIfPresent( + [Swift.String].self, + forKey: .team_managers + ) + ends_at = try container.decode( + Foundation.Date.self, + forKey: .ends_at + ) + contact_link = try container.decodeIfPresent( + Swift.String.self, + forKey: .contact_link + ) + code_scanning_alerts = try container.decode( + Operations.campaigns_sol_create_hyphen_campaign.Input.Body.jsonPayload.code_scanning_alertsPayload.self, + forKey: .code_scanning_alerts + ) + generate_issues = try container.decodeIfPresent( + Swift.Bool.self, + forKey: .generate_issues + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "managers", + "team_managers", + "ends_at", + "contact_link", + "code_scanning_alerts", + "generate_issues" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/content/application\/json`. + case json(Operations.campaigns_sol_create_hyphen_campaign.Input.Body.jsonPayload) + } + public var body: Operations.campaigns_sol_create_hyphen_campaign.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.campaigns_sol_create_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_create_hyphen_campaign.Input.Headers = .init(), + body: Operations.campaigns_sol_create_hyphen_campaign.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}/campaigns/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/responses/200/content/application\/json`. + case json(Components.Schemas.campaign_hyphen_summary) + /// 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.campaign_hyphen_summary { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.campaigns_sol_create_hyphen_campaign.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_create_hyphen_campaign.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.campaigns_sol_create_hyphen_campaign.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.campaigns_sol_create_hyphen_campaign.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/responses/400/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: Operations.campaigns_sol_create_hyphen_campaign.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_create_hyphen_campaign.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.campaigns_sol_create_hyphen_campaign.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.campaigns_sol_create_hyphen_campaign.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/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 { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/responses/422/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: Operations.campaigns_sol_create_hyphen_campaign.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_create_hyphen_campaign.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Unprocessable Entity + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.campaigns_sol_create_hyphen_campaign.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.campaigns_sol_create_hyphen_campaign.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + public struct TooManyRequests: Sendable, Hashable { + /// Creates a new `TooManyRequests`. + public init() {} + } + /// Too Many Requests + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/responses/429`. + /// + /// HTTP response code: `429 tooManyRequests`. + case tooManyRequests(Operations.campaigns_sol_create_hyphen_campaign.Output.TooManyRequests) + /// The associated value of the enum case if `self` is `.tooManyRequests`. + /// + /// - Throws: An error if `self` is not `.tooManyRequests`. + /// - SeeAlso: `.tooManyRequests`. + public var tooManyRequests: Operations.campaigns_sol_create_hyphen_campaign.Output.TooManyRequests { + get throws { + switch self { + case let .tooManyRequests(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "tooManyRequests", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)/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 + ] + } + } + } + /// Get a campaign for an organization + /// + /// Gets a campaign for an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`. + public enum campaigns_sol_get_hyphen_campaign_hyphen_summary { + public static let id: Swift.String = "campaigns/get-campaign-summary" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/path/org`. + public var org: Components.Parameters.org + /// The campaign number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/path/campaign_number`. + public var campaign_number: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - campaign_number: The campaign number. + public init( + org: Components.Parameters.org, + campaign_number: Swift.Int + ) { + self.org = org + self.campaign_number = campaign_number + } + } + public var path: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/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.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Input.Path, + headers: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.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}/campaigns/{campaign_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.campaign_hyphen_summary) + /// 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.campaign_hyphen_summary { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.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.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)/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 { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/GET/responses/422/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: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Unprocessable Entity + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.campaigns_sol_get_hyphen_campaign_hyphen_summary.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.campaigns_sol_get_hyphen_campaign_hyphen_summary.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)/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 + ] + } + } + } + /// Update a campaign + /// + /// Updates a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`. + public enum campaigns_sol_update_hyphen_campaign { + public static let id: Swift.String = "campaigns/update-campaign" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/path/org`. + public var org: Components.Parameters.org + /// The campaign number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/path/campaign_number`. + public var campaign_number: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - campaign_number: The campaign number. + public init( + org: Components.Parameters.org, + campaign_number: Swift.Int + ) { + self.org = org + self.campaign_number = campaign_number + } + } + public var path: Operations.campaigns_sol_update_hyphen_campaign.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/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.campaigns_sol_update_hyphen_campaign.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The name of the campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A description for the campaign + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/managers`. + public var managers: [Swift.String]? + /// The slugs of the teams to set as the campaign managers. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/team_managers`. + public var team_managers: [Swift.String]? + /// The end date and time of the campaign, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/ends_at`. + public var ends_at: Foundation.Date? + /// The contact link of the campaign. Must be a URI. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/contact_link`. + public var contact_link: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/json/state`. + public var state: Components.Schemas.campaign_hyphen_state? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - name: The name of the campaign + /// - description: A description for the campaign + /// - managers: The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. + /// - team_managers: The slugs of the teams to set as the campaign managers. + /// - ends_at: The end date and time of the campaign, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - contact_link: The contact link of the campaign. Must be a URI. + /// - state: + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + managers: [Swift.String]? = nil, + team_managers: [Swift.String]? = nil, + ends_at: Foundation.Date? = nil, + contact_link: Swift.String? = nil, + state: Components.Schemas.campaign_hyphen_state? = nil + ) { + self.name = name + self.description = description + self.managers = managers + self.team_managers = team_managers + self.ends_at = ends_at + self.contact_link = contact_link + self.state = state + } + public enum CodingKeys: String, CodingKey { + case name + case description + case managers + case team_managers + case ends_at + case contact_link + case state + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + name = try container.decodeIfPresent( + Swift.String.self, + forKey: .name + ) + description = try container.decodeIfPresent( + Swift.String.self, + forKey: .description + ) + managers = try container.decodeIfPresent( + [Swift.String].self, + forKey: .managers + ) + team_managers = try container.decodeIfPresent( + [Swift.String].self, + forKey: .team_managers + ) + ends_at = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .ends_at + ) + contact_link = try container.decodeIfPresent( + Swift.String.self, + forKey: .contact_link + ) + state = try container.decodeIfPresent( + Components.Schemas.campaign_hyphen_state.self, + forKey: .state + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name", + "description", + "managers", + "team_managers", + "ends_at", + "contact_link", + "state" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/requestBody/content/application\/json`. + case json(Operations.campaigns_sol_update_hyphen_campaign.Input.Body.jsonPayload) + } + public var body: Operations.campaigns_sol_update_hyphen_campaign.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.campaigns_sol_update_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_update_hyphen_campaign.Input.Headers = .init(), + body: Operations.campaigns_sol_update_hyphen_campaign.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}/campaigns/{campaign_number}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.campaign_hyphen_summary) + /// 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.campaign_hyphen_summary { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.campaigns_sol_update_hyphen_campaign.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_update_hyphen_campaign.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.campaigns_sol_update_hyphen_campaign.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.campaigns_sol_update_hyphen_campaign.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/responses/400/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: Operations.campaigns_sol_update_hyphen_campaign.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_update_hyphen_campaign.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.campaigns_sol_update_hyphen_campaign.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.campaigns_sol_update_hyphen_campaign.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)/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 { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/PATCH/responses/422/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: Operations.campaigns_sol_update_hyphen_campaign.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.campaigns_sol_update_hyphen_campaign.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Unprocessable Entity + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.campaigns_sol_update_hyphen_campaign.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.campaigns_sol_update_hyphen_campaign.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)/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 + ] + } + } + } + /// Delete a campaign for an organization + /// + /// Deletes a campaign in an organization. + /// + /// The authenticated user must be an owner or security manager for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`. + public enum campaigns_sol_delete_hyphen_campaign { + public static let id: Swift.String = "campaigns/delete-campaign" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/DELETE/path/org`. + public var org: Components.Parameters.org + /// The campaign number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/DELETE/path/campaign_number`. + public var campaign_number: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - campaign_number: The campaign number. + public init( + org: Components.Parameters.org, + campaign_number: Swift.Int + ) { + self.org = org + self.campaign_number = campaign_number + } + } + public var path: Operations.campaigns_sol_delete_hyphen_campaign.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/{campaign_number}/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.campaigns_sol_delete_hyphen_campaign.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.campaigns_sol_delete_hyphen_campaign.Input.Path, + headers: Operations.campaigns_sol_delete_hyphen_campaign.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() {} + } + /// Deletion successful + /// + /// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.campaigns_sol_delete_hyphen_campaign.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.campaigns_sol_delete_hyphen_campaign.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}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)/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//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)/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 + ] + } + } + } +} From 4c66d37bc1e4626553f9f2631af6f24ecf1326f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:55:10 +0000 Subject: [PATCH 33/37] Commit via running ake Package.swift --- Package.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Package.swift b/Package.swift index be43e368b45..6306bada50c 100644 --- a/Package.swift +++ b/Package.swift @@ -15,6 +15,7 @@ let package = Package( .library(name: "GitHubRestAPIActivity", targets: ["GitHubRestAPIActivity"]), .library(name: "GitHubRestAPIApps", targets: ["GitHubRestAPIApps"]), .library(name: "GitHubRestAPIBilling", targets: ["GitHubRestAPIBilling"]), + .library(name: "GitHubRestAPICampaigns", targets: ["GitHubRestAPICampaigns"]), .library(name: "GitHubRestAPIChecks", targets: ["GitHubRestAPIChecks"]), .library(name: "GitHubRestAPIClassroom", targets: ["GitHubRestAPIClassroom"]), .library(name: "GitHubRestAPICode_Scanning", targets: ["GitHubRestAPICode_Scanning"]), @@ -30,6 +31,7 @@ let package = Package( .library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]), .library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]), .library(name: "GitHubRestAPIGitignore", targets: ["GitHubRestAPIGitignore"]), + .library(name: "GitHubRestAPIHosted_Compute", targets: ["GitHubRestAPIHosted_Compute"]), .library(name: "GitHubRestAPIInteractions", targets: ["GitHubRestAPIInteractions"]), .library(name: "GitHubRestAPIIssues", targets: ["GitHubRestAPIIssues"]), .library(name: "GitHubRestAPILicenses", targets: ["GitHubRestAPILicenses"]), @@ -89,6 +91,14 @@ let package = Package( ], path: "Sources/billing" ), + .target( + name: "GitHubRestAPICampaigns", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/campaigns" + ), .target( name: "GitHubRestAPIChecks", dependencies: [ @@ -209,6 +219,14 @@ let package = Package( ], path: "Sources/gitignore" ), + .target( + name: "GitHubRestAPIHosted_Compute", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/hosted-compute" + ), .target( name: "GitHubRestAPIInteractions", dependencies: [ From 662a7a6378194f02978b956f191b49dd2f6338c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 19 Apr 2025 16:55:11 +0000 Subject: [PATCH 34/37] Commit via running ake .spi.yml --- .spi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.spi.yml b/.spi.yml index f829d7e353b..7ce45f7db18 100644 --- a/.spi.yml +++ b/.spi.yml @@ -6,6 +6,7 @@ builder: - GitHubRestAPIActivity - GitHubRestAPIApps - GitHubRestAPIBilling + - GitHubRestAPICampaigns - GitHubRestAPIChecks - GitHubRestAPIClassroom - GitHubRestAPICode_Scanning @@ -21,6 +22,7 @@ builder: - GitHubRestAPIGists - GitHubRestAPIGit - GitHubRestAPIGitignore + - GitHubRestAPIHosted_Compute - GitHubRestAPIInteractions - GitHubRestAPIIssues - GitHubRestAPILicenses From 4758b7cd430a0461190d54997b947d45677bda04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:44:21 +0000 Subject: [PATCH 35/37] Bump Submodule/github/rest-api-description from `a3b9020` to `8af3e59` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `a3b9020` to `8af3e59`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/a3b90207333d17877bcbab612a4163337ed7148c...8af3e59120fdf6294e2d385bdae74b39fa824da5) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 8af3e59120fdf6294e2d385bdae74b39fa824da5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Submodule/github/rest-api-description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index a3b90207333..8af3e59120f 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit a3b90207333d17877bcbab612a4163337ed7148c +Subproject commit 8af3e59120fdf6294e2d385bdae74b39fa824da5 From e83436dea3e3441cde63d6bf01ea4c57e5e6cb4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 28 Apr 2025 23:09:21 +0000 Subject: [PATCH 36/37] Commit via running ake Sources/checks --- Sources/checks/Client.swift | 4 ---- Sources/checks/Types.swift | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/Sources/checks/Client.swift b/Sources/checks/Client.swift index 38920d58672..ce23dfcd593 100644 --- a/Sources/checks/Client.swift +++ b/Sources/checks/Client.swift @@ -366,8 +366,6 @@ public struct Client: APIProtocol { /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest/post(checks/rerequest-run)`. public func checks_sol_rerequest_hyphen_run(_ input: Operations.checks_sol_rerequest_hyphen_run.Input) async throws -> Operations.checks_sol_rerequest_hyphen_run.Output { @@ -861,8 +859,6 @@ public struct Client: APIProtocol { /// /// Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest/post(checks/rerequest-suite)`. public func checks_sol_rerequest_hyphen_suite(_ input: Operations.checks_sol_rerequest_hyphen_suite.Input) async throws -> Operations.checks_sol_rerequest_hyphen_suite.Output { diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index 36299b84caf..1d371c9fcdb 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -64,8 +64,6 @@ public protocol APIProtocol: Sendable { /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest/post(checks/rerequest-run)`. func checks_sol_rerequest_hyphen_run(_ input: Operations.checks_sol_rerequest_hyphen_run.Input) async throws -> Operations.checks_sol_rerequest_hyphen_run.Output @@ -117,8 +115,6 @@ public protocol APIProtocol: Sendable { /// /// Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest/post(checks/rerequest-suite)`. func checks_sol_rerequest_hyphen_suite(_ input: Operations.checks_sol_rerequest_hyphen_suite.Input) async throws -> Operations.checks_sol_rerequest_hyphen_suite.Output @@ -243,8 +239,6 @@ extension APIProtocol { /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest/post(checks/rerequest-run)`. public func checks_sol_rerequest_hyphen_run( @@ -342,8 +336,6 @@ extension APIProtocol { /// /// Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest/post(checks/rerequest-suite)`. public func checks_sol_rerequest_hyphen_suite( @@ -3607,8 +3599,6 @@ public enum Operations { /// /// For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest/post(checks/rerequest-run)`. public enum checks_sol_rerequest_hyphen_run { @@ -4711,8 +4701,6 @@ public enum Operations { /// /// Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. /// - /// OAuth apps and personal access tokens (classic) cannot use this endpoint. - /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest/post(checks/rerequest-suite)`. public enum checks_sol_rerequest_hyphen_suite { From a00068fe14acbd137a8fbfa98659973f1de657be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 28 Apr 2025 23:11:09 +0000 Subject: [PATCH 37/37] Commit via running ake Sources/dependabot --- Sources/dependabot/Client.swift | 21 ++++ Sources/dependabot/Types.swift | 191 ++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 701e3b3542e..8fb44251c4c 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -101,6 +101,13 @@ public struct Client: APIProtocol { name: "epss_percentage", value: input.query.epss_percentage ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "has", + value: input.query.has + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -328,6 +335,13 @@ public struct Client: APIProtocol { name: "epss_percentage", value: input.query.epss_percentage ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "has", + value: input.query.has + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1167,6 +1181,13 @@ public struct Client: APIProtocol { name: "epss_percentage", value: input.query.epss_percentage ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "has", + value: input.query.has + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index a439100266b..ecb2dd39f6c 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -3633,6 +3633,50 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. public typealias dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss = Swift.String + /// Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. + /// Multiple `has` filters can be chained to check if multiple properties are present. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @@ -3936,6 +3980,52 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. + /// Multiple `has` filters can be chained to check if multiple properties are present. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/has`. + public var has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -3999,6 +4089,7 @@ public enum Operations { /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - has: Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. /// - 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. @@ -4013,6 +4104,7 @@ public enum Operations { ecosystem: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_ecosystems? = nil, package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, + has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -4027,6 +4119,7 @@ public enum Operations { self.ecosystem = ecosystem self.package = package self.epss_percentage = epss_percentage + self.has = has self.scope = scope self.sort = sort self.direction = direction @@ -4302,6 +4395,52 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/epss_percentage`. public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. + /// Multiple `has` filters can be chained to check if multiple properties are present. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/has`. + public var has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -4365,6 +4504,7 @@ public enum Operations { /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - has: Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. /// - 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. @@ -4379,6 +4519,7 @@ public enum Operations { ecosystem: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_ecosystems? = nil, package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, + has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -4393,6 +4534,7 @@ public enum Operations { self.ecosystem = ecosystem self.package = package self.epss_percentage = epss_percentage + self.has = has self.scope = scope self.sort = sort self.direction = direction @@ -6019,6 +6161,52 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/epss_percentage`. public var epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + 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 func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. + /// Multiple `has` filters can be chained to check if multiple properties are present. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/has`. + public var has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum dependabot_hyphen_alert_hyphen_scope: String, Codable, Hashable, Sendable { case development = "development" @@ -6089,6 +6277,7 @@ public enum Operations { /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - manifest: A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. /// - epss_percentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - has: Filters the list of alerts based on whether the alert has a patch. If specified, only alerts with a patch will be returned. /// - 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. @@ -6105,6 +6294,7 @@ public enum Operations { package: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_packages? = nil, manifest: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_manifests? = nil, epss_percentage: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_epss? = nil, + has: Components.Parameters.dependabot_hyphen_alert_hyphen_comma_hyphen_separated_hyphen_has? = nil, scope: Components.Parameters.dependabot_hyphen_alert_hyphen_scope? = nil, sort: Components.Parameters.dependabot_hyphen_alert_hyphen_sort? = nil, direction: Components.Parameters.direction? = nil, @@ -6121,6 +6311,7 @@ public enum Operations { self.package = package self.manifest = manifest self.epss_percentage = epss_percentage + self.has = has self.scope = scope self.sort = sort self.direction = direction