diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index d0b5bc7cff7..0f0bdd04249 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -38,22 +38,21 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// Get GitHub Actions cache usage for an organization + /// Get artifact and log retention settings 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 artifact and log retention settings for 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 `admin:org` scope or the "Actions policies" fine-grained permission 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 func actionsGetActionsCacheUsageForOrg(_ input: Operations.ActionsGetActionsCacheUsageForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public func actionsGetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheUsageForOrg.id, + forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/cache/usage", + template: "/organizations/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.org ] @@ -72,13 +71,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsGetActionsCacheUsageForOrg.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.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -88,7 +82,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheUsageOrgEnterprise.self, + Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, from: responseBody, transforming: { value in .json(value) @@ -97,10 +91,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -113,61 +148,52 @@ public struct Client: APIProtocol { } ) } - /// List repositories with GitHub Actions cache usage for an organization + /// Set artifact and log retention settings 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. + /// Sets artifact and log retention settings for 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 `admin:org` scope or the "Actions policies" fine-grained permission 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 func actionsGetActionsCacheUsageByRepoForOrg(_ input: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public func actionsSetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheUsageByRepoForOrg.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/cache/usage-by-repository", + template: "/organizations/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - 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) + 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 headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -177,7 +203,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -186,10 +212,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -202,21 +291,21 @@ public struct Client: APIProtocol { } ) } - /// List GitHub-hosted runners for an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Lists all GitHub-hosted runners configured in an organization. + /// Gets the fork PR contributor approval policy for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission 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 actionsListHostedRunnersForOrg(_ input: Operations.ActionsListHostedRunnersForOrg.Input) async throws -> Operations.ActionsListHostedRunnersForOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public func actionsGetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListHostedRunnersForOrg.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners", + template: "/organizations/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] @@ -226,20 +315,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -249,13 +324,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListHostedRunnersForOrg.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.ActionsListHostedRunnersForOrg.Output.Ok.Body + let body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -265,7 +335,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -274,10 +344,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -290,27 +379,28 @@ public struct Client: APIProtocol { } ) } - /// Create a GitHub-hosted runner for an organization + /// Set fork PR contributor approval permissions 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. + /// Sets the fork PR contributor approval policy for an organization. /// - /// - 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 actionsCreateHostedRunnerForOrg(_ input: Operations.ActionsCreateHostedRunnerForOrg.Input) async throws -> Operations.ActionsCreateHostedRunnerForOrg.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public func actionsSetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners", + template: "/organizations/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -330,9 +420,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -342,7 +434,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -351,7 +443,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -364,19 +478,19 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// Get private repo fork PR workflow settings for an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in 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 actionsGetHostedRunnersGithubOwnedImagesForOrg(_ input: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/github-owned", + template: "/organizations/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.org ] @@ -396,7 +510,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + let body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -406,7 +520,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -416,51 +530,31 @@ public struct Client: APIProtocol { 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 - ) + 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" + ] ) - } - } - ) - } - /// 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 actionsGetHostedRunnersPartnerImagesForOrg(_ input: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -470,7 +564,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -479,7 +573,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -492,39 +586,50 @@ public struct Client: APIProtocol { } ) } - /// Get limits on GitHub-hosted runners for an organization + /// Set private repo fork PR workflow settings for an organization /// - /// Get the GitHub-hosted runners limits for an organization. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in 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 actionsGetHostedRunnersLimitsForOrg(_ input: Operations.ActionsGetHostedRunnersLimitsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersLimitsForOrg.Output { + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/limits", + template: "/organizations/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) 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: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + let body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -534,7 +639,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerLimits.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -543,7 +648,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -556,19 +705,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-hosted runners machine specs for an organization + /// Get self-hosted runners settings for an organization /// - /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// Gets the settings for self-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 actionsGetHostedRunnersMachineSpecsForOrg(_ input: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public func actionsGetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, + forOperation: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/machine-sizes", + template: "/organizations/{}/actions/permissions/self-hosted-runners", parameters: [ input.path.org ] @@ -588,7 +739,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body + let body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -598,7 +749,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.SelfHostedRunnersSettings.self, from: responseBody, transforming: { value in .json(value) @@ -608,6 +759,50 @@ public struct Client: APIProtocol { 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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -620,39 +815,52 @@ public struct Client: APIProtocol { } ) } - /// Get platforms for GitHub-hosted runners in an organization + /// Set self-hosted runners settings for an organization /// - /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// Sets the settings for self-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 actionsGetHostedRunnersPlatformsForOrg(_ input: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPlatformsForOrg.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public func actionsSetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, + forOperation: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/platforms", + template: "/organizations/{}/actions/permissions/self-hosted-runners", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) 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: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -662,7 +870,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -671,7 +879,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -684,24 +958,23 @@ public struct Client: APIProtocol { } ) } - /// Get a GitHub-hosted runner for an organization + /// List repositories allowed to use self-hosted runners in an organization /// - /// Gets a GitHub-hosted runner configured in an organization. + /// Lists repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission 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 actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public func actionsListSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnerForOrg.id, + forOperation: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -709,6 +982,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -718,13 +1005,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsGetHostedRunnerForOrg.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.ActionsGetHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -734,7 +1016,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -743,10 +1025,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -759,28 +1082,28 @@ public struct Client: APIProtocol { } ) } - /// Update a GitHub-hosted runner for an organization + /// Set repositories allowed to use self-hosted runners in 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. + /// Sets repositories that are allowed to use self-hosted runners in an organization. /// - /// - 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 actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -800,9 +1123,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -812,7 +1137,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -821,53 +1146,32 @@ public struct Client: APIProtocol { 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 - ) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/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 func actionsDeleteHostedRunnerForOrg(_ input: Operations.ActionsDeleteHostedRunnerForOrg.Input) async throws -> Operations.ActionsDeleteHostedRunnerForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteHostedRunnerForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", - parameters: [ - input.path.org, - input.path.hostedRunnerId - ] - ) - 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: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -877,7 +1181,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -886,7 +1190,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .accepted(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -899,28 +1203,29 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for an organization + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. - public func actionsGetGithubActionsPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsOrganization.Output { + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public func actionsEnableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -931,9 +1236,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -943,7 +1250,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsOrganizationPermissions.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -952,7 +1259,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -965,45 +1338,129 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for an organization + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. - public func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output { + /// - Remark: HTTP `DELETE /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public func actionsDisableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -1016,21 +1473,22 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories enabled for GitHub Actions in an organization + /// Get GitHub Actions cache usage for an organization /// - /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-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 app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. - public func actionsListSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - 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 func actionsGetActionsCacheUsageForOrg(_ input: Operations.ActionsGetActionsCacheUsageForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsGetActionsCacheUsageForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/cache/usage", parameters: [ input.path.org ] @@ -1040,20 +1498,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1063,8 +1507,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsGetActionsCacheUsageForOrg.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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1074,7 +1523,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheUsageOrgEnterprise.self, from: responseBody, transforming: { value in .json(value) @@ -1083,7 +1532,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 + )) default: return .undocumented( statusCode: response.status.code, @@ -1096,132 +1548,83 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories enabled for GitHub Actions in an organization - /// - /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// 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 app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - 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 func actionsGetActionsCacheUsageByRepoForOrg(_ input: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsGetActionsCacheUsageByRepoForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/cache/usage-by-repository", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Enable a selected repository for GitHub Actions in an organization - /// - /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. - public func actionsEnableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", - parameters: [ - input.path.org, - input.path.repositoryId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage ) - 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 - ) - ) - } - } - ) - } - /// Disable a selected repository for GitHub Actions in an organization - /// - /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. - public func actionsDisableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", - parameters: [ - input.path.org, - input.path.repositoryId - ] + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - suppressMutabilityWarning(&request) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsGetActionsCacheUsageByRepoForOrg.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, @@ -1234,21 +1637,21 @@ public struct Client: APIProtocol { } ) } - /// Get allowed actions and reusable workflows for an organization + /// List GitHub-hosted runners for an organization /// - /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Lists all GitHub-hosted runners configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. - public func actionsGetAllowedActionsOrganization(_ input: Operations.ActionsGetAllowedActionsOrganization.Input) async throws -> Operations.ActionsGetAllowedActionsOrganization.Output { + /// - 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 actionsListHostedRunnersForOrg(_ input: Operations.ActionsListHostedRunnersForOrg.Input) async throws -> Operations.ActionsListHostedRunnersForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetAllowedActionsOrganization.id, + forOperation: Operations.ActionsListHostedRunnersForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/selected-actions", + template: "/orgs/{}/actions/hosted-runners", parameters: [ input.path.org ] @@ -1258,6 +1661,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1267,8 +1684,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListHostedRunnersForOrg.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.ActionsGetAllowedActionsOrganization.Output.Ok.Body + let body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1278,7 +1700,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SelectedActions.self, + Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1287,7 +1709,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 + )) default: return .undocumented( statusCode: response.status.code, @@ -1300,36 +1725,37 @@ public struct Client: APIProtocol { } ) } - /// Set allowed actions and reusable workflows for an organization - /// - /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Create a GitHub-hosted runner for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// 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 `PUT /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. - public func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { + /// - 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 actionsCreateHostedRunnerForOrg(_ input: Operations.ActionsCreateHostedRunnerForOrg.Input) async throws -> Operations.ActionsCreateHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetAllowedActionsOrganization.id, + forOperation: Operations.ActionsCreateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/selected-actions", + template: "/orgs/{}/actions/hosted-runners", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + 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( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -1339,8 +1765,28 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateHostedRunnerForOrg.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.ActionsHostedRunner.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, @@ -1353,23 +1799,19 @@ public struct Client: APIProtocol { } ) } - /// Get default workflow permissions for an organization - /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, - /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Get GitHub-owned images for GitHub-hosted runners in an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. - public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - 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 actionsGetHostedRunnersGithubOwnedImagesForOrg(_ input: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/hosted-runners/images/github-owned", parameters: [ input.path.org ] @@ -1389,7 +1831,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1399,7 +1841,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsGetDefaultWorkflowPermissions.self, + Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1421,49 +1863,58 @@ public struct Client: APIProtocol { } ) } - /// Set default workflow permissions for an organization + /// Get partner images for GitHub-hosted runners in an organization /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions - /// can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of partner images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. - public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - 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 actionsGetHostedRunnersPartnerImagesForOrg(_ input: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/hosted-runners/images/partner", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) - 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) + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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, @@ -1476,21 +1927,19 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runner groups for an organization - /// - /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// Get limits on GitHub-hosted runners for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the GitHub-hosted runners limits for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. - public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { + /// - 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 actionsGetHostedRunnersLimitsForOrg(_ input: Operations.ActionsGetHostedRunnersLimitsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersLimitsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnerGroupsForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + template: "/orgs/{}/actions/hosted-runners/limits", parameters: [ input.path.org ] @@ -1500,27 +1949,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "visible_to_repository", - value: input.query.visibleToRepository - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1531,7 +1959,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1541,7 +1969,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsHostedRunnerLimits.self, from: responseBody, transforming: { value in .json(value) @@ -1563,50 +1991,39 @@ public struct Client: APIProtocol { } ) } - /// Create a self-hosted runner group for an organization - /// - /// Creates a new self-hosted runner group for an organization. + /// Get GitHub-hosted runners machine specs for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. - public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { + /// - 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 actionsGetHostedRunnersMachineSpecsForOrg(_ input: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + template: "/orgs/{}/actions/hosted-runners/machine-sizes", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body + let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1616,7 +2033,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1625,7 +2042,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1638,24 +2055,21 @@ public struct Client: APIProtocol { } ) } - /// Get a self-hosted runner group for an organization - /// - /// Gets a specific self-hosted runner group for an organization. + /// Get platforms for GitHub-hosted runners in an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of platforms available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. - public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { + /// - 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 actionsGetHostedRunnersPlatformsForOrg(_ input: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPlatformsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/hosted-runners/platforms", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1673,7 +2087,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1683,7 +2097,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1705,51 +2119,47 @@ public struct Client: APIProtocol { } ) } - /// Update a self-hosted runner group for an organization + /// Get a GitHub-hosted runner for an organization /// - /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// Gets a GitHub-hosted runner configured in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin: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 `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. - public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { + /// - 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 actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsGetHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ input.path.org, - input.path.runnerGroupId + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsGetHostedRunnerForOrg.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.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1759,7 +2169,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -1768,7 +2178,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 + )) default: return .undocumented( statusCode: response.status.code, @@ -1781,88 +2194,104 @@ public struct Client: APIProtocol { } ) } - /// Delete a self-hosted runner group from an organization - /// - /// Deletes a self-hosted runner group for an organization. + /// Update a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin: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 `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. - public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { + /// - 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 actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, + forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ input.path.org, - input.path.runnerGroupId + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .patch ) suppressMutabilityWarning(&request) - return (request, nil) + 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()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsUpdateHostedRunnerForOrg.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.ActionsHostedRunner.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 + ) ) } } ) } - /// List GitHub-hosted runners in a group for an organization - /// - /// Lists the GitHub-hosted runners in an organization group. + /// Delete a GitHub-hosted runner for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Deletes a GitHub-hosted runner for an organization. /// - /// - 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 actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { + /// - 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 actionsDeleteHostedRunnerForOrg(_ input: Operations.ActionsDeleteHostedRunnerForOrg.Input) async throws -> Operations.ActionsDeleteHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsDeleteHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/hosted-runners", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ input.path.org, - input.path.runnerGroupId + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1871,14 +2300,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 202: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body + let body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1888,7 +2312,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -1897,10 +2321,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .accepted(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1913,24 +2334,23 @@ public struct Client: APIProtocol { } ) } - /// List repository access to a self-hosted runner group in an organization + /// Get GitHub Actions permissions for an organization /// - /// Lists the repositories with access to a self-hosted runner group configured in an organization. + /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsListRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. + public func actionsGetGithubActionsPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1938,20 +2358,6 @@ public struct Client: APIProtocol { 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.perPage - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1962,7 +2368,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1972,7 +2378,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsOrganizationPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -1994,24 +2400,23 @@ public struct Client: APIProtocol { } ) } - /// Set repository access for a self-hosted runner group in an organization + /// Set GitHub Actions permissions for an organization /// - /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsSetRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. + public func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2046,38 +2451,74 @@ public struct Client: APIProtocol { } ) } - /// Add repository access to a self-hosted runner group in an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsAddRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. + public func actionsListSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + 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 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.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, @@ -2090,33 +2531,41 @@ public struct Client: APIProtocol { } ) } - /// Remove repository access to a self-hosted runner group in an organization + /// Set selected repositories enabled for GitHub Actions in an organization + /// + /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) - 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 { @@ -2134,46 +2583,117 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runners in a group for an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Lists self-hosted runners that are in a specific organization group. + /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. - public func actionsListSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. + public func actionsEnableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners", + template: "/orgs/{}/actions/permissions/repositories/{}", parameters: [ input.path.org, - input.path.runnerGroupId + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - converter.setAcceptHeader( + 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 + ) + ) + } + } + ) + } + /// Disable a selected repository for GitHub Actions in an organization + /// + /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. + public func actionsDisableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + 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 allowed actions and reusable workflows for an organization + /// + /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. + public func actionsGetAllowedActionsOrganization(_ input: Operations.ActionsGetAllowedActionsOrganization.Input) async throws -> Operations.ActionsGetAllowedActionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetAllowedActionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/selected-actions", + 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 ) @@ -2182,13 +2702,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.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.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2198,7 +2713,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.SelectedActions.self, from: responseBody, transforming: { value in .json(value) @@ -2207,10 +2722,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2223,24 +2735,23 @@ public struct Client: APIProtocol { } ) } - /// Set self-hosted runners in a group for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. - public func actionsSetSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. + public func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsSetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2250,8 +2761,10 @@ public struct Client: APIProtocol { suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? switch input.body { + case .none: + body = nil case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( + body = try converter.setOptionalRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -2275,38 +2788,62 @@ public struct Client: APIProtocol { } ) } - /// Add a self-hosted runner to a group for an organization + /// Get default workflow permissions for an organization /// - /// Adds a self-hosted runner to a runner group configured in an organization. + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, + /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. - public func actionsAddSelfHostedRunnerToGroupForOrg(_ input: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input) async throws -> Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. + public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.id, + forOperation: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + template: "/orgs/{}/actions/permissions/workflow", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + 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 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.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.ActionsGetDefaultWorkflowPermissions.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, @@ -2319,33 +2856,44 @@ public struct Client: APIProtocol { } ) } - /// Remove a self-hosted runner from a group for an organization + /// Set default workflow permissions for an organization /// - /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions + /// can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. - public func actionsRemoveSelfHostedRunnerFromGroupForOrg(_ input: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input) async throws -> Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. + public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.id, + forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + template: "/orgs/{}/actions/permissions/workflow", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) - return (request, nil) + 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 { @@ -2363,23 +2911,21 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runners for an organization - /// - /// Lists all self-hosted runners configured in an organization. + /// List self-hosted runner groups for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. - public func actionsListSelfHostedRunnersForOrg(_ input: Operations.ActionsListSelfHostedRunnersForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnersForOrg.id, + forOperation: Operations.ActionsListSelfHostedRunnerGroupsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners", + template: "/orgs/{}/actions/runner-groups", parameters: [ input.path.org ] @@ -2393,22 +2939,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "name", - value: input.query.name + name: "per_page", + value: input.query.perPage ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "page", + value: input.query.page ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "visible_to_repository", + value: input.query.visibleToRepository ) converter.setAcceptHeader( in: &request.headerFields, @@ -2419,13 +2965,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListSelfHostedRunnersForOrg.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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2435,7 +2976,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2444,10 +2985,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2460,43 +2998,50 @@ public struct Client: APIProtocol { } ) } - /// List runner applications for an organization + /// Create a self-hosted runner group for an organization /// - /// Lists binaries for the runner application that you can download and run. + /// Creates a new self-hosted runner group for an organization. /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. - public func actionsListRunnerApplicationsForOrg(_ input: Operations.ActionsListRunnerApplicationsForOrg.Input) async throws -> Operations.ActionsListRunnerApplicationsForOrg.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRunnerApplicationsForOrg.id, + forOperation: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/downloads", + template: "/orgs/{}/actions/runner-groups", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) 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: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body + let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2506,7 +3051,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.RunnerApplication].self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -2515,7 +3060,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2528,118 +3073,42 @@ public struct Client: APIProtocol { } ) } - /// Create configuration for a just-in-time runner for an organization - /// - /// Generates a configuration that can be passed to the runner application at startup. + /// Get a self-hosted runner group for an organization /// - /// The authenticated user must have admin access to the organization. + /// Gets a specific self-hosted runner group for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. - public func actionsGenerateRunnerJitconfigForOrg(_ input: Operations.ActionsGenerateRunnerJitconfigForOrg.Input) async throws -> Operations.ActionsGenerateRunnerJitconfigForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGenerateRunnerJitconfigForOrg.id, + forOperation: Operations.ActionsGetSelfHostedRunnerGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/generate-jitconfig", + template: "/orgs/{}/actions/runner-groups/{}", parameters: [ - input.path.org + input.path.org, + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerJitconfig.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerJitconfig.Body.JsonPayload.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 409: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body + let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2649,7 +3118,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -2658,7 +3127,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .conflict(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2671,49 +3140,51 @@ public struct Client: APIProtocol { } ) } - /// Create a registration token for an organization - /// - /// Returns a token that you can pass to the `config` script. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: - /// - /// ``` - /// ./config.sh --url https://github.com/octo-org --token TOKEN - /// ``` + /// Update a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. - public func actionsCreateRegistrationTokenForOrg(_ input: Operations.ActionsCreateRegistrationTokenForOrg.Input) async throws -> Operations.ActionsCreateRegistrationTokenForOrg.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateRegistrationTokenForOrg.id, + forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/registration-token", + template: "/orgs/{}/actions/runner-groups/{}", parameters: [ - input.path.org + input.path.org, + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .patch ) 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 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body + let body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2723,7 +3194,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.AuthenticationToken.self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -2732,7 +3203,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2745,68 +3216,37 @@ public struct Client: APIProtocol { } ) } - /// Create a remove token for an organization - /// - /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: - /// - /// ``` - /// ./config.sh remove --token TOKEN - /// ``` + /// Delete a self-hosted runner group from an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Deletes a self-hosted runner group for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. - public func actionsCreateRemoveTokenForOrg(_ input: Operations.ActionsCreateRemoveTokenForOrg.Input) async throws -> Operations.ActionsCreateRemoveTokenForOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateRemoveTokenForOrg.id, + forOperation: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/remove-token", + template: "/orgs/{}/actions/runner-groups/{}", parameters: [ - input.path.org + input.path.org, + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + 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 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateRemoveTokenForOrg.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.AuthenticationToken.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -2819,26 +3259,24 @@ public struct Client: APIProtocol { } ) } - /// Get a self-hosted runner for an organization - /// - /// Gets a specific self-hosted runner configured in an organization. + /// List GitHub-hosted runners in a group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// 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. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. - public func actionsGetSelfHostedRunnerForOrg(_ input: Operations.ActionsGetSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerForOrg.Output { + /// - 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 actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}", + template: "/orgs/{}/actions/runner-groups/{}/hosted-runners", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2846,6 +3284,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2855,8 +3307,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2866,7 +3323,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Runner.self, + Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2875,7 +3332,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 + )) default: return .undocumented( statusCode: response.status.code, @@ -2888,33 +3348,45 @@ public struct Client: APIProtocol { } ) } - /// Delete a self-hosted runner from an organization - /// - /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + /// List repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. - public func actionsDeleteSelfHostedRunnerFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsListRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteSelfHostedRunnerFromOrg.id, + forOperation: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}", + template: "/orgs/{}/actions/runner-groups/{}/repositories", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + 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.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2923,11 +3395,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 422: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2937,7 +3407,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2946,7 +3416,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2959,85 +3429,46 @@ public struct Client: APIProtocol { } ) } - /// List labels for a self-hosted runner for an organization - /// - /// Lists all labels for a self-hosted runner configured in an organization. + /// Set repository access for a self-hosted runner group in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. - public func actionsListLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsSetRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups/{}/repositories", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) 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: Components.Responses.ActionsRunnerLabels.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3050,97 +3481,1873 @@ public struct Client: APIProtocol { } ) } - /// Add custom labels to a self-hosted runner for an organization - /// - /// Adds custom labels to a self-hosted runner configured in an organization. + /// Add repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. - public func actionsAddCustomLabelsToSelfHostedRunnerForOrg(_ input: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsAddRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + 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) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - 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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailedSimple.Body + } + } + ) + } + /// Remove repository access to a self-hosted runner group in an organization + /// + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public func actionsListSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelfHostedRunnersInGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + 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.perPage + ) + 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.ActionsListSelfHostedRunnersInGroupForOrg.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.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public func actionsSetSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public func actionsAddSelfHostedRunnerToGroupForOrg(_ input: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input) async throws -> Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId, + input.path.runnerId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public func actionsRemoveSelfHostedRunnerFromGroupForOrg(_ input: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input) async throws -> Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId, + input.path.runnerId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List self-hosted runners for an organization + /// + /// Lists all self-hosted runners configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. + public func actionsListSelfHostedRunnersForOrg(_ input: Operations.ActionsListSelfHostedRunnersForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelfHostedRunnersForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/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: "name", + value: input.query.name + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + 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.ActionsListSelfHostedRunnersForOrg.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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelfHostedRunnersForOrg.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 runner applications for an organization + /// + /// Lists binaries for the runner application that you can download and run. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. + public func actionsListRunnerApplicationsForOrg(_ input: Operations.ActionsListRunnerApplicationsForOrg.Input) async throws -> Operations.ActionsListRunnerApplicationsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListRunnerApplicationsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/downloads", + 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.ActionsListRunnerApplicationsForOrg.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.RunnerApplication].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create configuration for a just-in-time runner for an organization + /// + /// Generates a configuration that can be passed to the runner application at startup. + /// + /// The authenticated user must have admin access to the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. + public func actionsGenerateRunnerJitconfigForOrg(_ input: Operations.ActionsGenerateRunnerJitconfigForOrg.Input) async throws -> Operations.ActionsGenerateRunnerJitconfigForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGenerateRunnerJitconfigForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/generate-jitconfig", + 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: Components.Responses.ActionsRunnerJitconfig.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerJitconfig.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + 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.BasicError.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 + ) + ) + } + } + ) + } + /// Create a registration token for an organization + /// + /// Returns a token that you can pass to the `config` script. The token expires after one hour. + /// + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: + /// + /// ``` + /// ./config.sh --url https://github.com/octo-org --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. + public func actionsCreateRegistrationTokenForOrg(_ input: Operations.ActionsCreateRegistrationTokenForOrg.Input) async throws -> Operations.ActionsCreateRegistrationTokenForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsCreateRegistrationTokenForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/registration-token", + 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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateRegistrationTokenForOrg.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.AuthenticationToken.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 + ) + ) + } + } + ) + } + /// Create a remove token for an organization + /// + /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. + /// + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: + /// + /// ``` + /// ./config.sh remove --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. + public func actionsCreateRemoveTokenForOrg(_ input: Operations.ActionsCreateRemoveTokenForOrg.Input) async throws -> Operations.ActionsCreateRemoveTokenForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsCreateRemoveTokenForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/remove-token", + 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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateRemoveTokenForOrg.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.AuthenticationToken.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a self-hosted runner for an organization + /// + /// Gets a specific self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. + public func actionsGetSelfHostedRunnerForOrg(_ input: Operations.ActionsGetSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Runner.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a self-hosted runner from an organization + /// + /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. + public func actionsDeleteSelfHostedRunnerFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteSelfHostedRunnerFromOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.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 + ) + ) + } + } + ) + } + /// List labels for a self-hosted runner for an organization + /// + /// Lists all labels for a self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. + public func actionsListLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}/labels", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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: Components.Responses.ActionsRunnerLabels.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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 + ) + ) + } + } + ) + } + /// Add custom labels to a self-hosted runner for an organization + /// + /// Adds custom labels to a self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. + public func actionsAddCustomLabelsToSelfHostedRunnerForOrg(_ input: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}/labels", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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: Components.Responses.ActionsRunnerLabels.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.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 + ) + ) + } + } + ) + } + /// Set custom labels for a self-hosted runner for an organization + /// + /// Remove all previous custom labels and set the new custom labels for a specific + /// self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. + public func actionsSetCustomLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}/labels", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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: Components.Responses.ActionsRunnerLabels.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.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 + ) + ) + } + } + ) + } + /// Remove all custom labels from a self-hosted runner for an organization + /// + /// Remove all custom labels from a self-hosted runner configured in an + /// organization. Returns the remaining read-only labels from the runner. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. + public func actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}/labels", + parameters: [ + input.path.org, + input.path.runnerId + ] + ) + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ActionsRunnerLabelsReadonly.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabelsReadonly.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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 + ) + ) + } + } + ) + } + /// Remove a custom label from a self-hosted runner for an organization + /// + /// Remove a custom label from a self-hosted runner configured + /// in an organization. Returns the remaining labels from the runner. + /// + /// This endpoint returns a `404 Not Found` status if the custom label is not + /// present on the runner. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. + public func actionsRemoveCustomLabelFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runners/{}/labels/{}", + parameters: [ + input.path.org, + input.path.runnerId, + input.path.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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ActionsRunnerLabels.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.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 + ) + ) + } + } + ) + } + /// List organization secrets + /// + /// Lists all secrets available in an organization without revealing their + /// encrypted values. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. + public func actionsListOrgSecrets(_ input: Operations.ActionsListOrgSecrets.Input) async throws -> Operations.ActionsListOrgSecrets.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListOrgSecrets.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets", + 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.perPage + ) + 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.ActionsListOrgSecrets.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.ActionsListOrgSecrets.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListOrgSecrets.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 + ) + ) + } + } + ) + } + /// Get an organization public key + /// + /// Gets your public key, which you need to encrypt secrets. You need to + /// encrypt a secret before you can create or update secrets. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. + public func actionsGetOrgPublicKey(_ input: Operations.ActionsGetOrgPublicKey.Input) async throws -> Operations.ActionsGetOrgPublicKey.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetOrgPublicKey.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/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 contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetOrgPublicKey.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.ActionsPublicKey.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 an organization secret + /// + /// Gets a single organization secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. + public func actionsGetOrgSecret(_ input: Operations.ActionsGetOrgSecret.Input) async throws -> Operations.ActionsGetOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + 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.ActionsGetOrgSecret.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.OrganizationActionsSecret.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create or update an organization secret + /// + /// Creates or updates an organization 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)." + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. + public func actionsCreateOrUpdateOrgSecret(_ input: Operations.ActionsCreateOrUpdateOrgSecret.Input) async throws -> Operations.ActionsCreateOrUpdateOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsCreateOrUpdateOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + 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 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateOrUpdateOrgSecret.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.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an organization secret + /// + /// Deletes a secret in an organization using the secret name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. + public func actionsDeleteOrgSecret(_ input: Operations.ActionsDeleteOrgSecret.Input) async throws -> Operations.ActionsDeleteOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List selected repositories for an organization secret + /// + /// Lists all repositories that have been selected when the `visibility` + /// for repository access to a secret is set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. + public func actionsListSelectedReposForOrgSecret(_ input: Operations.ActionsListSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsListSelectedReposForOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelectedReposForOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}/repositories", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + 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.perPage + ) + 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.ActionsListSelectedReposForOrgSecret.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3150,7 +5357,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3159,7 +5366,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3172,27 +5379,28 @@ public struct Client: APIProtocol { } ) } - /// Set custom labels for a self-hosted runner for an organization + /// Set selected repositories for an organization secret /// - /// Remove all previous custom labels and set the new custom labels for a specific - /// self-hosted runner configured in an organization. + /// Replaces all repositories for an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. - public func actionsSetCustomLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. + public func actionsSetSelectedReposForOrgSecret(_ input: Operations.ActionsSetSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsSetSelectedReposForOrgSecret.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetSelectedReposForOrgSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/secrets/{}/repositories", parameters: [ input.path.org, - input.path.runnerId + input.path.secretName ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3200,10 +5408,6 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -3217,72 +5421,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3295,86 +5435,44 @@ public struct Client: APIProtocol { } ) } - /// Remove all custom labels from a self-hosted runner for an organization + /// Add selected repository to an organization secret /// - /// Remove all custom labels from a self-hosted runner configured in an - /// organization. Returns the remaining read-only labels from the runner. + /// Adds a repository to an organization secret when the `visibility` for + /// repository access is set to `selected`. For more information about setting the visibility, see [Create or + /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. - public func actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. + public func actionsAddSelectedRepoToOrgSecret(_ input: Operations.ActionsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgSecret.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsAddSelectedRepoToOrgSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/secrets/{}/repositories/{}", parameters: [ input.path.org, - input.path.runnerId + input.path.secretName, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) 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: Components.Responses.ActionsRunnerLabelsReadonly.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabelsReadonly.Body.JsonPayload.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3387,31 +5485,29 @@ public struct Client: APIProtocol { } ) } - /// Remove a custom label from a self-hosted runner for an organization - /// - /// Remove a custom label from a self-hosted runner configured - /// in an organization. Returns the remaining labels from the runner. - /// - /// This endpoint returns a `404 Not Found` status if the custom label is not - /// present on the runner. + /// Remove selected repository from an organization secret /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Removes a repository from an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. - public func actionsRemoveCustomLabelFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. + public func actionsRemoveSelectedRepoFromOrgSecret(_ input: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsRemoveSelectedRepoFromOrgSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels/{}", + template: "/orgs/{}/actions/secrets/{}/repositories/{}", parameters: [ input.path.org, - input.path.runnerId, - input.path.name + input.path.secretName, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3419,80 +5515,14 @@ public struct Client: APIProtocol { 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 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3505,24 +5535,23 @@ public struct Client: APIProtocol { } ) } - /// List organization secrets + /// List organization variables /// - /// Lists all secrets available in an organization without revealing their - /// encrypted values. + /// Lists all organization variables. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. - public func actionsListOrgSecrets(_ input: Operations.ActionsListOrgSecrets.Input) async throws -> Operations.ActionsListOrgSecrets.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. + public func actionsListOrgVariables(_ input: Operations.ActionsListOrgVariables.Input) async throws -> Operations.ActionsListOrgVariables.Output { try await client.send( input: input, - forOperation: Operations.ActionsListOrgSecrets.id, + forOperation: Operations.ActionsListOrgVariables.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets", + template: "/orgs/{}/actions/variables", parameters: [ input.path.org ] @@ -3555,13 +5584,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ActionsListOrgVariables.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.ActionsListOrgSecrets.Output.Ok.Body + let body: Operations.ActionsListOrgVariables.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3571,7 +5600,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3596,44 +5625,52 @@ public struct Client: APIProtocol { } ) } - /// Get an organization public key + /// Create an organization variable /// - /// Gets your public key, which you need to encrypt secrets. You need to - /// encrypt a secret before you can create or update secrets. + /// Creates an organization variable that you can reference in a GitHub Actions workflow. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. - public func actionsGetOrgPublicKey(_ input: Operations.ActionsGetOrgPublicKey.Input) async throws -> Operations.ActionsGetOrgPublicKey.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. + public func actionsCreateOrgVariable(_ input: Operations.ActionsCreateOrgVariable.Input) async throws -> Operations.ActionsCreateOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgPublicKey.id, + forOperation: Operations.ActionsCreateOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/public-key", + template: "/orgs/{}/actions/variables", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) 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: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body + let body: Operations.ActionsCreateOrgVariable.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3643,7 +5680,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsPublicKey.self, + Components.Schemas.EmptyObject.self, from: responseBody, transforming: { value in .json(value) @@ -3652,7 +5689,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3665,26 +5702,26 @@ public struct Client: APIProtocol { } ) } - /// Get an organization secret + /// Get an organization variable /// - /// Gets a single organization secret without revealing its encrypted value. + /// Gets a specific variable in an organization. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// The authenticated user must have collaborator access to a repository to create, update, or read variables. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. - public func actionsGetOrgSecret(_ input: Operations.ActionsGetOrgSecret.Input) async throws -> Operations.ActionsGetOrgSecret.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. + public func actionsGetOrgVariable(_ input: Operations.ActionsGetOrgVariable.Input) async throws -> Operations.ActionsGetOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgSecret.id, + forOperation: Operations.ActionsGetOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", + template: "/orgs/{}/actions/variables/{}", parameters: [ input.path.org, - input.path.secretName + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3702,7 +5739,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgSecret.Output.Ok.Body + let body: Operations.ActionsGetOrgVariable.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3712,7 +5749,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationActionsSecret.self, + Components.Schemas.OrganizationActionsVariable.self, from: responseBody, transforming: { value in .json(value) @@ -3734,38 +5771,33 @@ public struct Client: APIProtocol { } ) } - /// Create or update an organization secret + /// Update an organization variable /// - /// Creates or updates an organization 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)." + /// Updates an organization variable that you can reference in a GitHub Actions workflow. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. - public func actionsCreateOrUpdateOrgSecret(_ input: Operations.ActionsCreateOrUpdateOrgSecret.Input) async throws -> Operations.ActionsCreateOrUpdateOrgSecret.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. + public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateOrUpdateOrgSecret.id, + forOperation: Operations.ActionsUpdateOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", + template: "/orgs/{}/actions/variables/{}", parameters: [ input.path.org, - input.path.secretName + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -3779,28 +5811,6 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateOrUpdateOrgSecret.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.EmptyObject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) case 204: return .noContent(.init()) default: @@ -3815,26 +5825,26 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization secret + /// Delete an organization variable /// - /// Deletes a secret in an organization using the secret name. + /// Deletes an organization variable using the variable name. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. - public func actionsDeleteOrgSecret(_ input: Operations.ActionsDeleteOrgSecret.Input) async throws -> Operations.ActionsDeleteOrgSecret.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. + public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteOrgSecret.id, + forOperation: Operations.ActionsDeleteOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", + template: "/orgs/{}/actions/variables/{}", parameters: [ input.path.org, - input.path.secretName + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3860,27 +5870,27 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories for an organization secret + /// List selected repositories for an organization variable /// - /// Lists all repositories that have been selected when the `visibility` - /// for repository access to a secret is set to `selected`. + /// Lists all repositories that can access an organization variable + /// that is available to selected repositories. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. - public func actionsListSelectedReposForOrgSecret(_ input: Operations.ActionsListSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsListSelectedReposForOrgSecret.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. + public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedReposForOrgSecret.id, + forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories", + template: "/orgs/{}/actions/variables/{}/repositories", parameters: [ input.path.org, - input.path.secretName + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3912,7 +5922,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body + let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3922,7 +5932,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3932,6 +5942,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3944,28 +5956,28 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for an organization secret + /// Set selected repositories for an organization variable /// - /// Replaces all repositories for an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Replaces all repositories for an organization variable that is available + /// to selected repositories. Organization variables that are available to selected + /// repositories have their `visibility` field set to `selected`. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. - public func actionsSetSelectedReposForOrgSecret(_ input: Operations.ActionsSetSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsSetSelectedReposForOrgSecret.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. + public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedReposForOrgSecret.id, + forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories", + template: "/orgs/{}/actions/variables/{}/repositories", parameters: [ input.path.org, - input.path.secretName + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3988,6 +6000,8 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 409: + return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4000,28 +6014,27 @@ public struct Client: APIProtocol { } ) } - /// Add selected repository to an organization secret + /// Add selected repository to an organization variable /// - /// Adds a repository to an organization secret when the `visibility` for - /// repository access is set to `selected`. For more information about setting the visibility, see [Create or - /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Adds a repository to an organization variable that is available to selected repositories. + /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. /// /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. - public func actionsAddSelectedRepoToOrgSecret(_ input: Operations.ActionsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgSecret.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. + public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelectedRepoToOrgSecret.id, + forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories/{}", + template: "/orgs/{}/actions/variables/{}/repositories/{}", parameters: [ input.path.org, - input.path.secretName, + input.path.name, input.path.repositoryId ] ) @@ -4050,28 +6063,28 @@ public struct Client: APIProtocol { } ) } - /// Remove selected repository from an organization secret + /// Remove selected repository from an organization variable /// - /// Removes a repository from an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Removes a repository from an organization variable that is + /// available to selected repositories. Organization variables that are available to + /// selected repositories have their `visibility` field set to `selected`. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. - public func actionsRemoveSelectedRepoFromOrgSecret(_ input: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. + public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelectedRepoFromOrgSecret.id, + forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories/{}", + template: "/orgs/{}/actions/variables/{}/repositories/{}", parameters: [ input.path.org, - input.path.secretName, + input.path.name, input.path.repositoryId ] ) @@ -4100,25 +6113,26 @@ public struct Client: APIProtocol { } ) } - /// List organization variables + /// List artifacts for a repository /// - /// Lists all organization variables. + /// Lists all artifacts for a repository. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. - public func actionsListOrgVariables(_ input: Operations.ActionsListOrgVariables.Input) async throws -> Operations.ActionsListOrgVariables.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. + public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { try await client.send( input: input, - forOperation: Operations.ActionsListOrgVariables.id, + forOperation: Operations.ActionsListArtifactsForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables", + template: "/repos/{}/{}/actions/artifacts", parameters: [ - input.path.org + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4140,6 +6154,13 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "name", + value: input.query.name + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -4149,13 +6170,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ActionsListArtifactsForRepo.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.ActionsListOrgVariables.Output.Ok.Body + let body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4165,7 +6186,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4190,103 +6211,27 @@ public struct Client: APIProtocol { } ) } - /// Create an organization variable - /// - /// Creates an organization variable that you can reference in a GitHub Actions workflow. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. - /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. - public func actionsCreateOrgVariable(_ input: Operations.ActionsCreateOrgVariable.Input) async throws -> Operations.ActionsCreateOrgVariable.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsCreateOrgVariable.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables", - 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.ActionsCreateOrgVariable.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.EmptyObject.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 an organization variable + /// Get an artifact /// - /// Gets a specific variable in an organization. + /// Gets a specific artifact for a workflow run. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. - public func actionsGetOrgVariable(_ input: Operations.ActionsGetOrgVariable.Input) async throws -> Operations.ActionsGetOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. + public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgVariable.id, + forOperation: Operations.ActionsGetArtifact.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/repos/{}/{}/actions/artifacts/{}", parameters: [ - input.path.org, - input.path.name + input.path.owner, + input.path.repo, + input.path.artifactId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4304,7 +6249,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgVariable.Output.Ok.Body + let body: Operations.ActionsGetArtifact.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4314,7 +6259,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationActionsVariable.self, + Components.Schemas.Artifact.self, from: responseBody, transforming: { value in .json(value) @@ -4336,43 +6281,32 @@ public struct Client: APIProtocol { } ) } - /// Update an organization variable - /// - /// Updates an organization variable that you can reference in a GitHub Actions workflow. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Delete an artifact /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// Deletes an artifact for a workflow run. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. - public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. + public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateOrgVariable.id, + forOperation: Operations.ActionsDeleteArtifact.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/repos/{}/{}/actions/artifacts/{}", parameters: [ - input.path.org, - input.path.name - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + input.path.owner, + input.path.repo, + input.path.artifactId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { @@ -4390,39 +6324,71 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization variable - /// - /// Deletes an organization variable using the variable name. + /// Download an artifact /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + /// the response header to find the URL for the download. The `:archive_format` must be `zip`. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. - public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. + public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteOrgVariable.id, + forOperation: Operations.ActionsDownloadArtifact.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/repos/{}/{}/actions/artifacts/{}/{}", parameters: [ - input.path.org, - input.path.name + input.path.owner, + input.path.repo, + input.path.artifactId, + input.path.archiveFormat ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + 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 204: - return .noContent(.init()) + case 302: + let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Components.Headers.Location.self + )) + return .found(.init(headers: headers)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4435,27 +6401,27 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories for an organization variable + /// Get GitHub Actions cache usage for a repository /// - /// Lists all repositories that can access an organization variable - /// that is available to selected repositories. + /// Gets GitHub Actions cache usage for a repository. + /// 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. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. - public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. + public func actionsGetActionsCacheUsage(_ input: Operations.ActionsGetActionsCacheUsage.Input) async throws -> Operations.ActionsGetActionsCacheUsage.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsGetActionsCacheUsage.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/repos/{}/{}/actions/cache/usage", parameters: [ - input.path.org, - input.path.name + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4463,20 +6429,6 @@ public struct Client: APIProtocol { 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.perPage - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -4487,7 +6439,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4497,7 +6449,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsCacheUsageByRepository.self, from: responseBody, transforming: { value in .json(value) @@ -4507,8 +6459,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4521,52 +6471,111 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for an organization variable - /// - /// Replaces all repositories for an organization variable that is available - /// to selected repositories. Organization variables that are available to selected - /// repositories have their `visibility` field set to `selected`. + /// List GitHub Actions caches for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Lists the GitHub Actions caches for a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. - public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. + public func actionsGetActionsCacheList(_ input: Operations.ActionsGetActionsCacheList.Input) async throws -> Operations.ActionsGetActionsCacheList.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsGetActionsCacheList.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/repos/{}/{}/actions/caches", parameters: [ - input.path.org, - input.path.name + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + 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: "ref", + value: input.query.ref + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "key", + value: input.query.key + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + 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 409: - return .conflict(.init()) + case 200: + let headers: Operations.ActionsGetActionsCacheList.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.ActionsGetActionsCacheList.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.ActionsCacheList.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, @@ -4579,43 +6588,75 @@ public struct Client: APIProtocol { } ) } - /// Add selected repository to an organization variable - /// - /// Adds a repository to an organization variable that is available to selected repositories. - /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// Delete GitHub Actions caches for a repository (using a cache key) /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. - public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. + public func actionsDeleteActionsCacheByKey(_ input: Operations.ActionsDeleteActionsCacheByKey.Input) async throws -> Operations.ActionsDeleteActionsCacheByKey.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, + forOperation: Operations.ActionsDeleteActionsCacheByKey.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", + template: "/repos/{}/{}/actions/caches", parameters: [ - input.path.org, - input.path.name, - input.path.repositoryId + input.path.owner, + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "key", + value: input.query.key + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "ref", + value: input.query.ref + ) + 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 409: - return .conflict(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsDeleteActionsCacheByKey.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.ActionsCacheList.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, @@ -4628,29 +6669,25 @@ public struct Client: APIProtocol { } ) } - /// Remove selected repository from an organization variable - /// - /// Removes a repository from an organization variable that is - /// available to selected repositories. Organization variables that are available to - /// selected repositories have their `visibility` field set to `selected`. + /// Delete a GitHub Actions cache for a repository (using a cache ID) /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Deletes a GitHub Actions cache for a repository, using a cache ID. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. - public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. + public func actionsDeleteActionsCacheById(_ input: Operations.ActionsDeleteActionsCacheById.Input) async throws -> Operations.ActionsDeleteActionsCacheById.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, + forOperation: Operations.ActionsDeleteActionsCacheById.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", + template: "/repos/{}/{}/actions/caches/{}", parameters: [ - input.path.org, - input.path.name, - input.path.repositoryId + input.path.owner, + input.path.repo, + input.path.cacheId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4664,8 +6701,6 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4678,26 +6713,27 @@ public struct Client: APIProtocol { } ) } - /// List artifacts for a repository + /// Get a job for a workflow run /// - /// Lists all artifacts for a repository. + /// Gets a specific job in a workflow run. /// /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. - public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. + public func actionsGetJobForWorkflowRun(_ input: Operations.ActionsGetJobForWorkflowRun.Input) async throws -> Operations.ActionsGetJobForWorkflowRun.Output { try await client.send( input: input, - forOperation: Operations.ActionsListArtifactsForRepo.id, + forOperation: Operations.ActionsGetJobForWorkflowRun.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts", + template: "/repos/{}/{}/actions/jobs/{}", parameters: [ input.path.owner, - input.path.repo + input.path.repo, + input.path.jobId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4705,27 +6741,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - 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: "name", - value: input.query.name - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -4735,13 +6750,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListArtifactsForRepo.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.ActionsListArtifactsForRepo.Output.Ok.Body + let body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4751,7 +6761,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, + Components.Schemas.Job.self, from: responseBody, transforming: { value in .json(value) @@ -4760,10 +6770,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4776,27 +6783,28 @@ public struct Client: APIProtocol { } ) } - /// Get an artifact + /// Download job logs for a workflow run /// - /// Gets a specific artifact for a workflow run. + /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + /// for `Location:` in the response header to find the URL for the download. /// /// Anyone with read access to the repository can use this endpoint. /// /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. - public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. + public func actionsDownloadJobLogsForWorkflowRun(_ input: Operations.ActionsDownloadJobLogsForWorkflowRun.Input) async throws -> Operations.ActionsDownloadJobLogsForWorkflowRun.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetArtifact.id, + forOperation: Operations.ActionsDownloadJobLogsForWorkflowRun.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", + template: "/repos/{}/{}/actions/jobs/{}/logs", parameters: [ input.path.owner, input.path.repo, - input.path.artifactId + input.path.jobId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4804,36 +6812,17 @@ public struct Client: APIProtocol { 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.ActionsGetArtifact.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.Artifact.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 302: + let headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + return .found(.init(headers: headers)) default: return .undocumented( statusCode: response.status.code, @@ -4846,37 +6835,95 @@ public struct Client: APIProtocol { } ) } - /// Delete an artifact + /// Re-run a job from a workflow run /// - /// Deletes an artifact for a workflow run. - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Re-run a job and its dependent jobs in a workflow run. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. - public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. + public func actionsReRunJobForWorkflowRun(_ input: Operations.ActionsReRunJobForWorkflowRun.Input) async throws -> Operations.ActionsReRunJobForWorkflowRun.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteArtifact.id, + forOperation: Operations.ActionsReRunJobForWorkflowRun.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", + template: "/repos/{}/{}/actions/jobs/{}/rerun", parameters: [ input.path.owner, input.path.repo, - input.path.artifactId + input.path.jobId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) - return (request, nil) + 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 204: - return .noContent(.init()) + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsReRunJobForWorkflowRun.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.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4889,27 +6936,24 @@ public struct Client: APIProtocol { } ) } - /// Download an artifact + /// Get the customization template for an OIDC subject claim for a repository /// - /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in - /// the response header to find the URL for the download. The `:archive_format` must be `zip`. + /// Gets the customization template for an OpenID Connect (OIDC) subject claim. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. - public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. + public func actionsGetCustomOidcSubClaimForRepo(_ input: Operations.ActionsGetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsGetCustomOidcSubClaimForRepo.Output { try await client.send( input: input, - forOperation: Operations.ActionsDownloadArtifact.id, + forOperation: Operations.ActionsGetCustomOidcSubClaimForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}/{}", + template: "/repos/{}/{}/actions/oidc/customization/sub", parameters: [ input.path.owner, - input.path.repo, - input.path.artifactId, - input.path.archiveFormat + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4925,16 +6969,62 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 302: - let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Components.Headers.Location.self - )) - return .found(.init(headers: headers)) - case 410: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Operations.ActionsGetCustomOidcSubClaimForRepo.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.OidcCustomSubRepo.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.BadRequest.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(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.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4953,7 +7043,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4966,24 +7056,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions cache usage for a repository - /// - /// Gets GitHub Actions cache usage for a repository. - /// 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. + /// Set the customization template for an OIDC subject claim for a repository /// - /// Anyone with read access to the repository can use this endpoint. + /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. /// - /// If the repository is private, OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. - public func actionsGetActionsCacheUsage(_ input: Operations.ActionsGetActionsCacheUsage.Input) async throws -> Operations.ActionsGetActionsCacheUsage.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. + public func actionsSetCustomOidcSubClaimForRepo(_ input: Operations.ActionsSetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsSetCustomOidcSubClaimForRepo.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheUsage.id, + forOperation: Operations.ActionsSetCustomOidcSubClaimForRepo.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/cache/usage", + template: "/repos/{}/{}/actions/oidc/customization/sub", parameters: [ input.path.owner, input.path.repo @@ -4991,20 +7078,29 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) 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: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + let body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5014,7 +7110,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheUsageByRepository.self, + Components.Schemas.EmptyObject.self, from: responseBody, transforming: { value in .json(value) @@ -5023,7 +7119,82 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.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, @@ -5036,21 +7207,24 @@ public struct Client: APIProtocol { } ) } - /// List GitHub Actions caches for a repository + /// List repository organization secrets /// - /// Lists the GitHub Actions caches for a repository. + /// Lists all organization secrets shared with a repository without revealing their encrypted + /// values. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. - public func actionsGetActionsCacheList(_ input: Operations.ActionsGetActionsCacheList.Input) async throws -> Operations.ActionsGetActionsCacheList.Output { + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. + public func actionsListRepoOrganizationSecrets(_ input: Operations.ActionsListRepoOrganizationSecrets.Input) async throws -> Operations.ActionsListRepoOrganizationSecrets.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheList.id, + forOperation: Operations.ActionsListRepoOrganizationSecrets.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches", + template: "/repos/{}/{}/actions/organization-secrets", parameters: [ input.path.owner, input.path.repo @@ -5075,34 +7249,6 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "ref", - value: input.query.ref - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "key", - value: input.query.key - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5112,13 +7258,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ActionsListRepoOrganizationSecrets.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.ActionsGetActionsCacheList.Output.Ok.Body + let body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5128,7 +7274,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheList.self, + Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -5153,21 +7299,23 @@ public struct Client: APIProtocol { } ) } - /// Delete GitHub Actions caches for a repository (using a cache key) + /// List repository organization variables /// - /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. + /// Lists all organization variables shared with a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. - public func actionsDeleteActionsCacheByKey(_ input: Operations.ActionsDeleteActionsCacheByKey.Input) async throws -> Operations.ActionsDeleteActionsCacheByKey.Output { + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. + public func actionsListRepoOrganizationVariables(_ input: Operations.ActionsListRepoOrganizationVariables.Input) async throws -> Operations.ActionsListRepoOrganizationVariables.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteActionsCacheByKey.id, + forOperation: Operations.ActionsListRepoOrganizationVariables.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches", + template: "/repos/{}/{}/actions/organization-variables", parameters: [ input.path.owner, input.path.repo @@ -5175,22 +7323,22 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "key", - value: input.query.key + name: "per_page", + value: input.query.perPage ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "ref", - value: input.query.ref + name: "page", + value: input.query.page ) converter.setAcceptHeader( in: &request.headerFields, @@ -5201,8 +7349,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListRepoOrganizationVariables.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.ActionsDeleteActionsCacheByKey.Output.Ok.Body + let body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5212,7 +7365,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheList.self, + Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -5221,7 +7374,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 + )) default: return .undocumented( statusCode: response.status.code, @@ -5234,71 +7390,24 @@ public struct Client: APIProtocol { } ) } - /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// Get GitHub Actions permissions for a repository /// - /// Deletes a GitHub Actions cache for a repository, using a cache ID. + /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. - public func actionsDeleteActionsCacheById(_ input: Operations.ActionsDeleteActionsCacheById.Input) async throws -> Operations.ActionsDeleteActionsCacheById.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteActionsCacheById.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.cacheId - ] - ) - 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 job for a workflow run - /// - /// Gets a specific job in a workflow run. - /// - /// Anyone with read access to the repository can use this endpoint. - /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. - public func actionsGetJobForWorkflowRun(_ input: Operations.ActionsGetJobForWorkflowRun.Input) async throws -> Operations.ActionsGetJobForWorkflowRun.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. + public func actionsGetGithubActionsPermissionsRepository(_ input: Operations.ActionsGetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetJobForWorkflowRun.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}", + template: "/repos/{}/{}/actions/permissions", parameters: [ input.path.owner, - input.path.repo, - input.path.jobId + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5316,7 +7425,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5326,7 +7435,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Job.self, + Components.Schemas.ActionsRepositoryPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -5348,94 +7457,35 @@ public struct Client: APIProtocol { } ) } - /// Download job logs for a workflow run - /// - /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look - /// for `Location:` in the response header to find the URL for the download. - /// - /// Anyone with read access to the repository can use this endpoint. - /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. - public func actionsDownloadJobLogsForWorkflowRun(_ input: Operations.ActionsDownloadJobLogsForWorkflowRun.Input) async throws -> Operations.ActionsDownloadJobLogsForWorkflowRun.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDownloadJobLogsForWorkflowRun.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}/logs", - parameters: [ - input.path.owner, - input.path.repo, - input.path.jobId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 302: - let headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) - return .found(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Re-run a job from a workflow run + /// Set GitHub Actions permissions for a repository /// - /// Re-run a job and its dependent jobs in a workflow run. + /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. - public func actionsReRunJobForWorkflowRun(_ input: Operations.ActionsReRunJobForWorkflowRun.Input) async throws -> Operations.ActionsReRunJobForWorkflowRun.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. + public func actionsSetGithubActionsPermissionsRepository(_ input: Operations.ActionsSetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsReRunJobForWorkflowRun.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}/rerun", + template: "/repos/{}/{}/actions/permissions", parameters: [ input.path.owner, - input.path.repo, - input.path.jobId + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) 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( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -5445,50 +7495,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsReRunJobForWorkflowRun.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.EmptyObject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -5501,21 +7509,23 @@ public struct Client: APIProtocol { } ) } - /// Get the customization template for an OIDC subject claim for a repository + /// Get the level of access for workflows outside of the repository /// - /// Gets the customization template for an OpenID Connect (OIDC) subject claim. + /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." /// - /// OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. - public func actionsGetCustomOidcSubClaimForRepo(_ input: Operations.ActionsGetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsGetCustomOidcSubClaimForRepo.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. + public func actionsGetWorkflowAccessToRepository(_ input: Operations.ActionsGetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsGetWorkflowAccessToRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetCustomOidcSubClaimForRepo.id, + forOperation: Operations.ActionsGetWorkflowAccessToRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/oidc/customization/sub", + template: "/repos/{}/{}/actions/permissions/access", parameters: [ input.path.owner, input.path.repo @@ -5536,7 +7546,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body + let body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5546,7 +7556,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OidcCustomSubRepo.self, + Components.Schemas.ActionsWorkflowAccessToRepository.self, from: responseBody, transforming: { value in .json(value) @@ -5556,59 +7566,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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, @@ -5621,21 +7578,23 @@ public struct Client: APIProtocol { } ) } - /// Set the customization template for an OIDC subject claim for a repository + /// Set the level of access for workflows outside of the repository /// - /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. + /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. - public func actionsSetCustomOidcSubClaimForRepo(_ input: Operations.ActionsSetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsSetCustomOidcSubClaimForRepo.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. + public func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetCustomOidcSubClaimForRepo.id, + forOperation: Operations.ActionsSetWorkflowAccessToRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/oidc/customization/sub", + template: "/repos/{}/{}/actions/permissions/access", parameters: [ input.path.owner, input.path.repo @@ -5646,10 +7605,6 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -5663,103 +7618,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsSetCustomOidcSubClaimForRepo.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.EmptyObject.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -5772,24 +7632,21 @@ public struct Client: APIProtocol { } ) } - /// List repository organization secrets - /// - /// Lists all organization secrets shared with a repository without revealing their encrypted - /// values. + /// Get artifact and log retention settings for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Gets artifact and log retention settings for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. - public func actionsListRepoOrganizationSecrets(_ input: Operations.ActionsListRepoOrganizationSecrets.Input) async throws -> Operations.ActionsListRepoOrganizationSecrets.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public func actionsGetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoOrganizationSecrets.id, + forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/organization-secrets", + template: "/repos/{}/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.owner, input.path.repo @@ -5800,20 +7657,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5823,13 +7666,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListRepoOrganizationSecrets.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.ActionsListRepoOrganizationSecrets.Output.Ok.Body + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5839,7 +7677,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, from: responseBody, transforming: { value in .json(value) @@ -5848,10 +7686,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -5864,63 +7721,53 @@ public struct Client: APIProtocol { } ) } - /// List repository organization variables - /// - /// Lists all organization variables shared with a repository. + /// Set artifact and log retention settings for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Sets artifact and log retention settings for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. - public func actionsListRepoOrganizationVariables(_ input: Operations.ActionsListRepoOrganizationVariables.Input) async throws -> Operations.ActionsListRepoOrganizationVariables.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public func actionsSetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoOrganizationVariables.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/organization-variables", + template: "/repos/{}/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.owner, input.path.repo - ] - ) - 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.perPage + ] ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put ) + 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 headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5930,7 +7777,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5939,10 +7786,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -5955,21 +7821,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for a repository + /// Get fork PR contributor approval permissions for a repository /// - /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. + /// Gets the fork PR contributor approval policy for a repository. /// - /// OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. - public func actionsGetGithubActionsPermissionsRepository(_ input: Operations.ActionsGetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsRepository.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public func actionsGetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsPermissionsRepository.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions", + template: "/repos/{}/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.owner, input.path.repo @@ -5990,7 +7856,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body + let body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6000,7 +7866,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsRepositoryPermissions.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -6010,6 +7876,28 @@ public struct Client: APIProtocol { 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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -6022,21 +7910,21 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for a repository + /// Set fork PR contributor approval permissions for a repository /// - /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. + /// Sets the fork PR contributor approval policy for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. - public func actionsSetGithubActionsPermissionsRepository(_ input: Operations.ActionsSetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsRepository.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public func actionsSetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsPermissionsRepository.id, + forOperation: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions", + template: "/repos/{}/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.owner, input.path.repo @@ -6047,6 +7935,10 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -6062,6 +7954,50 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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, @@ -6074,23 +8010,21 @@ public struct Client: APIProtocol { } ) } - /// Get the level of access for workflows outside of the repository + /// Get private repo fork PR workflow settings for a repository /// - /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. - public func actionsGetWorkflowAccessToRepository(_ input: Operations.ActionsGetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsGetWorkflowAccessToRepository.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetWorkflowAccessToRepository.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions/access", + template: "/repos/{}/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.owner, input.path.repo @@ -6111,7 +8045,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body + let body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6121,7 +8055,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsWorkflowAccessToRepository.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -6131,6 +8065,50 @@ public struct Client: APIProtocol { 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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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, @@ -6143,23 +8121,21 @@ public struct Client: APIProtocol { } ) } - /// Set the level of access for workflows outside of the repository + /// Set private repo fork PR workflow settings for a repository /// - /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. - public func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetWorkflowAccessToRepository.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions/access", + template: "/repos/{}/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.owner, input.path.repo @@ -6170,6 +8146,10 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -6185,6 +8165,50 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 04dad52f07e..d7e30c4cf52 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -11,6 +11,110 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get artifact and log retention settings for an organization + /// + /// Gets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + func actionsGetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output + /// Set artifact and log retention settings for an organization + /// + /// Sets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + func actionsSetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output + /// Get fork PR contributor approval permissions for an organization + /// + /// Gets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + func actionsGetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output + /// Set fork PR contributor approval permissions for an organization + /// + /// Sets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + func actionsSetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output + /// Get private repo fork PR workflow settings for an organization + /// + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output + /// Set private repo fork PR workflow settings for an organization + /// + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output + /// Get self-hosted runners settings for an organization + /// + /// Gets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + func actionsGetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output + /// Set self-hosted runners settings for an organization + /// + /// Sets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + func actionsSetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output + /// List repositories allowed to use self-hosted runners in an organization + /// + /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + func actionsListSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output + /// Set repositories allowed to use self-hosted runners in an organization + /// + /// Sets repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization + /// + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + func actionsEnableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization + /// + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `DELETE /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + func actionsDisableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output /// Get GitHub Actions cache usage for an organization /// /// Gets the total GitHub Actions cache usage for an organization. @@ -884,6 +988,60 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output + /// Get artifact and log retention settings for a repository + /// + /// Gets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + func actionsGetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output + /// Set artifact and log retention settings for a repository + /// + /// Sets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + func actionsSetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output + /// Get fork PR contributor approval permissions for a repository + /// + /// Gets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + func actionsGetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output + /// Set fork PR contributor approval permissions for a repository + /// + /// Sets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + func actionsSetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output + /// Get private repo fork PR workflow settings for a repository + /// + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output + /// Set private repo fork PR workflow settings for a repository + /// + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output /// Get allowed actions and reusable workflows for a repository /// /// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." @@ -1602,6 +1760,218 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get artifact and log retention settings for an organization + /// + /// Gets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public func actionsGetArtifactAndLogRetentionSettingsOrganization( + path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output { + try await actionsGetArtifactAndLogRetentionSettingsOrganization(Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set artifact and log retention settings for an organization + /// + /// Sets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public func actionsSetArtifactAndLogRetentionSettingsOrganization( + path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body + ) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output { + try await actionsSetArtifactAndLogRetentionSettingsOrganization(Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get fork PR contributor approval permissions for an organization + /// + /// Gets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public func actionsGetForkPrContributorApprovalPermissionsOrganization( + path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output { + try await actionsGetForkPrContributorApprovalPermissionsOrganization(Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set fork PR contributor approval permissions for an organization + /// + /// Sets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public func actionsSetForkPrContributorApprovalPermissionsOrganization( + path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body + ) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output { + try await actionsSetForkPrContributorApprovalPermissionsOrganization(Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get private repo fork PR workflow settings for an organization + /// + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization( + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { + try await actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set private repo fork PR workflow settings for an organization + /// + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization( + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body + ) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { + try await actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get self-hosted runners settings for an organization + /// + /// Gets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public func actionsGetSelfHostedRunnersPermissionsOrganization( + path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output { + try await actionsGetSelfHostedRunnersPermissionsOrganization(Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set self-hosted runners settings for an organization + /// + /// Sets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public func actionsSetSelfHostedRunnersPermissionsOrganization( + path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body + ) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output { + try await actionsSetSelfHostedRunnersPermissionsOrganization(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// List repositories allowed to use self-hosted runners in an organization + /// + /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public func actionsListSelectedRepositoriesSelfHostedRunnersOrganization( + path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await actionsListSelectedRepositoriesSelfHostedRunnersOrganization(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set repositories allowed to use self-hosted runners in an organization + /// + /// Sets repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization( + path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body + ) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization + /// + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public func actionsEnableSelectedRepositorySelfHostedRunnersOrganization( + path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await actionsEnableSelectedRepositorySelfHostedRunnersOrganization(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input( + path: path, + headers: headers + )) + } + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization + /// + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `DELETE /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public func actionsDisableSelectedRepositorySelfHostedRunnersOrganization( + path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await actionsDisableSelectedRepositorySelfHostedRunnersOrganization(Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input( + path: path, + headers: headers + )) + } /// Get GitHub Actions cache usage for an organization /// /// Gets the total GitHub Actions cache usage for an organization. @@ -3115,6 +3485,114 @@ extension APIProtocol { body: body )) } + /// Get artifact and log retention settings for a repository + /// + /// Gets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public func actionsGetArtifactAndLogRetentionSettingsRepository( + path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output { + try await actionsGetArtifactAndLogRetentionSettingsRepository(Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input( + path: path, + headers: headers + )) + } + /// Set artifact and log retention settings for a repository + /// + /// Sets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public func actionsSetArtifactAndLogRetentionSettingsRepository( + path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body + ) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output { + try await actionsSetArtifactAndLogRetentionSettingsRepository(Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get fork PR contributor approval permissions for a repository + /// + /// Gets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public func actionsGetForkPrContributorApprovalPermissionsRepository( + path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output { + try await actionsGetForkPrContributorApprovalPermissionsRepository(Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input( + path: path, + headers: headers + )) + } + /// Set fork PR contributor approval permissions for a repository + /// + /// Sets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public func actionsSetForkPrContributorApprovalPermissionsRepository( + path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body + ) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output { + try await actionsSetForkPrContributorApprovalPermissionsRepository(Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get private repo fork PR workflow settings for a repository + /// + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository( + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output { + try await actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input( + path: path, + headers: headers + )) + } + /// Set private repo fork PR workflow settings for a repository + /// + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository( + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body + ) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output { + try await actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input( + path: path, + headers: headers, + body: body + )) + } /// Get allowed actions and reusable workflows for a repository /// /// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." @@ -4695,64 +5173,189 @@ public enum Components { case schemas } } - /// A GitHub user. + /// Validation Error /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct NullableSimpleUser: 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 nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatarId: 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 htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var receivedEventsUrl: 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 siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. - public var starredAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `NullableSimpleUser`. - /// - /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: 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 documentationUrl: 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.ValidationError.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.ValidationError.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.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct NullableSimpleUser: 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 nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatarId: 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 htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var receivedEventsUrl: 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 siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `NullableSimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: /// - url: /// - htmlUrl: /// - followersUrl: @@ -6809,6 +7412,196 @@ public enum Components { case customProperties = "custom_properties" } } + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response`. + public struct ActionsArtifactAndLogRetentionResponse: Codable, Hashable, Sendable { + /// The number of days artifacts and logs are retained + /// + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/days`. + public var days: Swift.Int + /// The maximum number of days that can be configured + /// + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/maximum_allowed_days`. + public var maximumAllowedDays: Swift.Int + /// Creates a new `ActionsArtifactAndLogRetentionResponse`. + /// + /// - Parameters: + /// - days: The number of days artifacts and logs are retained + /// - maximumAllowedDays: The maximum number of days that can be configured + public init( + days: Swift.Int, + maximumAllowedDays: Swift.Int + ) { + self.days = days + self.maximumAllowedDays = maximumAllowedDays + } + public enum CodingKeys: String, CodingKey { + case days + case maximumAllowedDays = "maximum_allowed_days" + } + } + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention`. + public struct ActionsArtifactAndLogRetention: Codable, Hashable, Sendable { + /// The number of days to retain artifacts and logs + /// + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention/days`. + public var days: Swift.Int + /// Creates a new `ActionsArtifactAndLogRetention`. + /// + /// - Parameters: + /// - days: The number of days to retain artifacts and logs + public init(days: Swift.Int) { + self.days = days + } + public enum CodingKeys: String, CodingKey { + case days + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval`. + public struct ActionsForkPrContributorApproval: Codable, Hashable, Sendable { + /// The policy that controls when fork PR workflows require approval from a maintainer. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval/approval_policy`. + @frozen public enum ApprovalPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case firstTimeContributorsNewToGithub = "first_time_contributors_new_to_github" + case firstTimeContributors = "first_time_contributors" + case allExternalContributors = "all_external_contributors" + } + /// The policy that controls when fork PR workflows require approval from a maintainer. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval/approval_policy`. + public var approvalPolicy: Components.Schemas.ActionsForkPrContributorApproval.ApprovalPolicyPayload + /// Creates a new `ActionsForkPrContributorApproval`. + /// + /// - Parameters: + /// - approvalPolicy: The policy that controls when fork PR workflows require approval from a maintainer. + public init(approvalPolicy: Components.Schemas.ActionsForkPrContributorApproval.ApprovalPolicyPayload) { + self.approvalPolicy = approvalPolicy + } + public enum CodingKeys: String, CodingKey { + case approvalPolicy = "approval_policy" + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos`. + public struct ActionsForkPrWorkflowsPrivateRepos: Codable, Hashable, Sendable { + /// Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/run_workflows_from_fork_pull_requests`. + public var runWorkflowsFromForkPullRequests: Swift.Bool + /// Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/send_write_tokens_to_workflows`. + public var sendWriteTokensToWorkflows: Swift.Bool + /// Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/send_secrets_and_variables`. + public var sendSecretsAndVariables: Swift.Bool + /// Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/require_approval_for_fork_pr_workflows`. + public var requireApprovalForForkPrWorkflows: Swift.Bool + /// Creates a new `ActionsForkPrWorkflowsPrivateRepos`. + /// + /// - Parameters: + /// - runWorkflowsFromForkPullRequests: Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// - sendWriteTokensToWorkflows: Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// - sendSecretsAndVariables: Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// - requireApprovalForForkPrWorkflows: Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + public init( + runWorkflowsFromForkPullRequests: Swift.Bool, + sendWriteTokensToWorkflows: Swift.Bool, + sendSecretsAndVariables: Swift.Bool, + requireApprovalForForkPrWorkflows: Swift.Bool + ) { + self.runWorkflowsFromForkPullRequests = runWorkflowsFromForkPullRequests + self.sendWriteTokensToWorkflows = sendWriteTokensToWorkflows + self.sendSecretsAndVariables = sendSecretsAndVariables + self.requireApprovalForForkPrWorkflows = requireApprovalForForkPrWorkflows + } + public enum CodingKeys: String, CodingKey { + case runWorkflowsFromForkPullRequests = "run_workflows_from_fork_pull_requests" + case sendWriteTokensToWorkflows = "send_write_tokens_to_workflows" + case sendSecretsAndVariables = "send_secrets_and_variables" + case requireApprovalForForkPrWorkflows = "require_approval_for_fork_pr_workflows" + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request`. + public struct ActionsForkPrWorkflowsPrivateReposRequest: Codable, Hashable, Sendable { + /// Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/run_workflows_from_fork_pull_requests`. + public var runWorkflowsFromForkPullRequests: Swift.Bool + /// Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/send_write_tokens_to_workflows`. + public var sendWriteTokensToWorkflows: Swift.Bool? + /// Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/send_secrets_and_variables`. + public var sendSecretsAndVariables: Swift.Bool? + /// Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/require_approval_for_fork_pr_workflows`. + public var requireApprovalForForkPrWorkflows: Swift.Bool? + /// Creates a new `ActionsForkPrWorkflowsPrivateReposRequest`. + /// + /// - Parameters: + /// - runWorkflowsFromForkPullRequests: Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// - sendWriteTokensToWorkflows: Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// - sendSecretsAndVariables: Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// - requireApprovalForForkPrWorkflows: Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + public init( + runWorkflowsFromForkPullRequests: Swift.Bool, + sendWriteTokensToWorkflows: Swift.Bool? = nil, + sendSecretsAndVariables: Swift.Bool? = nil, + requireApprovalForForkPrWorkflows: Swift.Bool? = nil + ) { + self.runWorkflowsFromForkPullRequests = runWorkflowsFromForkPullRequests + self.sendWriteTokensToWorkflows = sendWriteTokensToWorkflows + self.sendSecretsAndVariables = sendSecretsAndVariables + self.requireApprovalForForkPrWorkflows = requireApprovalForForkPrWorkflows + } + public enum CodingKeys: String, CodingKey { + case runWorkflowsFromForkPullRequests = "run_workflows_from_fork_pull_requests" + case sendWriteTokensToWorkflows = "send_write_tokens_to_workflows" + case sendSecretsAndVariables = "send_secrets_and_variables" + case requireApprovalForForkPrWorkflows = "require_approval_for_fork_pr_workflows" + } + } + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings`. + public struct SelfHostedRunnersSettings: Codable, Hashable, Sendable { + /// The policy that controls whether self-hosted runners can be used by repositories in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy that controls whether self-hosted runners can be used by repositories in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/enabled_repositories`. + public var enabledRepositories: Components.Schemas.SelfHostedRunnersSettings.EnabledRepositoriesPayload + /// The URL to the endpoint for managing selected repositories for self-hosted runners in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `SelfHostedRunnersSettings`. + /// + /// - Parameters: + /// - enabledRepositories: The policy that controls whether self-hosted runners can be used by repositories in the organization + /// - selectedRepositoriesUrl: The URL to the endpoint for managing selected repositories for self-hosted runners in the organization + public init( + enabledRepositories: Components.Schemas.SelfHostedRunnersSettings.EnabledRepositoriesPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.enabledRepositories = enabledRepositories + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + case selectedRepositoriesUrl = "selected_repositories_url" + } + } /// - Remark: Generated from `#/components/schemas/actions-cache-usage-org-enterprise`. public struct ActionsCacheUsageOrgEnterprise: Codable, Hashable, Sendable { /// The count of active caches across all repositories of an enterprise or an organization. @@ -10355,14 +11148,14 @@ 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 HostedRunnerId = Swift.Int /// The unique identifier of the repository. /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias RepositoryId = Swift.Int + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/components/parameters/hosted-runner-id`. + public typealias HostedRunnerId = Swift.Int /// Only return runner groups that are allowed to be used by this repository. /// /// - Remark: Generated from `#/components/parameters/visible-to-repository`. @@ -10636,6 +11429,34 @@ public enum Components { self.body = body } } + public struct ValidationFailed: 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.ValidationError) + /// 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.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -10915,23 +11736,22 @@ public enum Components { /// 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 artifact and log retention settings 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 artifact and log retention settings for 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 `admin:org` scope or the "Actions policies" fine-grained permission 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 ActionsGetActionsCacheUsageForOrg { - public static let id: Swift.String = "actions/get-actions-cache-usage-for-org" + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public enum ActionsGetArtifactAndLogRetentionSettingsOrganization { + public static let id: Swift.String = "actions/get-artifact-and-log-retention-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/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/organizations/{org}/actions/permissions/artifact-and-log-retention/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -10941,27 +11761,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/header`. + public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/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.ActionsGetActionsCacheUsageForOrg.Input.Headers + public var headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, - headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() + path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -10969,29 +11789,15 @@ 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`. - 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.ActionsGetActionsCacheUsageForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/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.ActionsCacheUsageOrgEnterprise) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetentionResponse) /// 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.ActionsCacheUsageOrgEnterprise { + public var json: Components.Schemas.ActionsArtifactAndLogRetentionResponse { get throws { switch self { case let .json(body): @@ -11001,31 +11807,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + public var body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok) + case ok(Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.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.ActionsGetActionsCacheUsageForOrg.Output.Ok { + public var ok: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -11038,6 +11839,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/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//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -11069,23 +11916,22 @@ public enum Operations { } } } - /// List repositories with GitHub Actions cache usage for an organization + /// Set artifact and log retention settings 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. + /// Sets artifact and log retention settings for 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 `admin:org` scope or the "Actions policies" fine-grained permission 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 ActionsGetActionsCacheUsageByRepoForOrg { - public static let id: Swift.String = "actions/get-actions-cache-usage-by-repo-for-org" + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public enum ActionsSetArtifactAndLogRetentionSettingsOrganization { + public static let id: Swift.String = "actions/set-artifact-and-log-retention-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/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/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11095,157 +11941,173 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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 perPage: Components.Parameters.PerPage? - /// 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: - /// - perPage: 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( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/header`. + public var path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/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.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers + public var headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetention) + } + public var body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, - query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), - headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() + path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @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 + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output.NoContent) + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response headers - public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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 totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/repository_cache_usages`. - public var repositoryCacheUsages: [Components.Schemas.ActionsCacheUsageByRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositoryCacheUsages: - public init( - totalCount: Swift.Int, - repositoryCacheUsages: [Components.Schemas.ActionsCacheUsageByRepository] - ) { - self.totalCount = totalCount - self.repositoryCacheUsages = repositoryCacheUsages - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositoryCacheUsages = "repository_cache_usages" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/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: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Conflict /// - /// - 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//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", response: self ) } } } - /// Undocumented response. + /// Validation failed, or the endpoint has been spammed. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + 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 @@ -11273,22 +12135,22 @@ public enum Operations { } } } - /// List GitHub-hosted runners for an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Lists all GitHub-hosted runners configured in an organization. + /// Gets the fork PR contributor approval policy for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission 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 ActionsListHostedRunnersForOrg { - public static let id: Swift.String = "actions/list-hosted-runners-for-org" + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public enum ActionsGetForkPrContributorApprovalPermissionsOrganization { + public static let id: Swift.String = "actions/get-fork-pr-contributor-approval-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11298,107 +12160,43 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsListHostedRunnersForOrg.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 perPage: Components.Parameters.PerPage? - /// 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: - /// - perPage: 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( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ActionsListHostedRunnersForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/header`. + public var path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/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.ActionsListHostedRunnersForOrg.Input.Headers + public var headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListHostedRunnersForOrg.Input.Path, - query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), - headers: Operations.ActionsListHostedRunnersForOrg.Input.Headers = .init() + path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.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.ActionsListHostedRunnersForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/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 totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.ActionsHostedRunner] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runners: - public init( - totalCount: Swift.Int, - runners: [Components.Schemas.ActionsHostedRunner] - ) { - self.totalCount = totalCount - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runners - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) /// 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.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsForkPrContributorApproval { get throws { switch self { case let .json(body): @@ -11408,31 +12206,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body + public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListHostedRunnersForOrg.Output.Ok) + case ok(Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.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.ActionsListHostedRunnersForOrg.Output.Ok { + public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -11445,6 +12238,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -11476,21 +12292,22 @@ public enum Operations { } } } - /// Create a GitHub-hosted runner for an organization + /// Set fork PR contributor approval permissions 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. + /// Sets the fork PR contributor approval policy for an organization. /// - /// - 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 ActionsCreateHostedRunnerForOrg { - public static let id: Swift.String = "actions/create-hosted-runner-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public enum ActionsSetForkPrContributorApprovalPermissionsOrganization { + public static let id: Swift.String = "actions/set-fork-pr-contributor-approval-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11500,121 +12317,25 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/header`. + public var path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/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.ActionsCreateHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody`. + public var headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/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, CaseIterable { - 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.ActionsCreateHostedRunnerForOrg.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.ActionsCreateHostedRunnerForOrg.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.ActionsCreateHostedRunnerForOrg.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 runnerGroupId: 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 maximumRunners: 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 enableStaticIp: 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` - /// - runnerGroupId: The existing runner group to add this runner to. - /// - maximumRunners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. - /// - enableStaticIp: 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.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload, - size: Swift.String, - runnerGroupId: Swift.Int, - maximumRunners: Swift.Int? = nil, - enableStaticIp: Swift.Bool? = nil - ) { - self.name = name - self.image = image - self.size = size - self.runnerGroupId = runnerGroupId - self.maximumRunners = maximumRunners - self.enableStaticIp = enableStaticIp - } - public enum CodingKeys: String, CodingKey { - case name - case image - case size - case runnerGroupId = "runner_group_id" - case maximumRunners = "maximum_runners" - case enableStaticIp = "enable_static_ip" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/content/application\/json`. - case json(Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) } - public var body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body + public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -11622,9 +12343,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsCreateHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body + path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body ) { self.path = path self.headers = headers @@ -11632,52 +12353,82 @@ public enum Operations { } } @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.ActionsHostedRunner) - /// 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.ActionsHostedRunner { - 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//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetForkPrContributorApprovalPermissionsOrganization.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.ActionsCreateHostedRunnerForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body) { - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/422`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateHostedRunnerForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateHostedRunnerForOrg.Output.Created { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .created(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "unprocessableContent", response: self ) } @@ -11714,20 +12465,20 @@ public enum Operations { } } } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// Get private repo fork PR workflow settings for an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in 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 ActionsGetHostedRunnersGithubOwnedImagesForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-github-owned-images-for-org" + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public enum ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization { + public static let id: Swift.String = "actions/get-private-repo-fork-pr-workflows-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11737,27 +12488,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/header`. + public var path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers + public var headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers = .init() + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11765,38 +12516,15 @@ public enum Operations { } @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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/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 totalCount: 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.ActionsHostedRunnerImage] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - images: - public init( - totalCount: Swift.Int, - images: [Components.Schemas.ActionsHostedRunnerImage] - ) { - self.totalCount = totalCount - self.images = images - } - public enum CodingKeys: String, CodingKey { - case totalCount = "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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateRepos) /// 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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { get throws { switch self { case let .json(body): @@ -11806,26 +12534,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + public var body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.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`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok) + case ok(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok { + public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -11838,6 +12566,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/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//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -11869,20 +12643,20 @@ public enum Operations { } } } - /// Get partner images for GitHub-hosted runners in an organization + /// Set private repo fork PR workflow settings for an organization /// - /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in 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 ActionsGetHostedRunnersPartnerImagesForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-partner-images-for-org" + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public enum ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization { + public static let id: Swift.String = "actions/set-private-repo-fork-pr-workflows-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/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/partner/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11892,102 +12666,169 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/header`. + public var path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/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.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers + public var headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateReposRequest) + } + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.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/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 totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/images`. - public var images: [Components.Schemas.ActionsHostedRunnerImage] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - images: - public init( - totalCount: Swift.Int, - images: [Components.Schemas.ActionsHostedRunnerImage] - ) { - self.totalCount = totalCount - self.images = images - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case images - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// Empty response for successful settings update /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent) + /// Empty response for successful settings update /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok { + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/content/application\/json`. + case json(Components.Schemas.BasicError) + /// 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.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden - Fork PR workflow settings for private repositories are managed by the enterprise owner + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.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: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.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//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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//organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -12024,20 +12865,22 @@ public enum Operations { } } } - /// Get limits on GitHub-hosted runners for an organization + /// Get self-hosted runners settings for an organization /// - /// Get the GitHub-hosted runners limits for an organization. + /// Gets the settings for self-hosted runners 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 ActionsGetHostedRunnersLimitsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-limits-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public enum ActionsGetSelfHostedRunnersPermissionsOrganization { + public static let id: Swift.String = "actions/get-self-hosted-runners-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-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/limits/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12047,27 +12890,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/header`. + public var path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/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.ActionsGetHostedRunnersLimitsForOrg.Input.Headers + public var headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers = .init() + path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12075,15 +12918,15 @@ public enum Operations { } @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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/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.ActionsHostedRunnerLimits) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SelfHostedRunnersSettings) /// 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.ActionsHostedRunnerLimits { + public var json: Components.Schemas.SelfHostedRunnersSettings { get throws { switch self { case let .json(body): @@ -12093,26 +12936,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + public var body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok) + case ok(Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.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.ActionsGetHostedRunnersLimitsForOrg.Output.Ok { + public var ok: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -12125,6 +12968,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/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//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -12156,20 +13045,22 @@ public enum Operations { } } } - /// Get GitHub-hosted runners machine specs for an organization + /// Set self-hosted runners settings for an organization /// - /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// Sets the settings for self-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 ActionsGetHostedRunnersMachineSpecsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-machine-specs-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public enum ActionsSetSelfHostedRunnersPermissionsOrganization { + public static let id: Swift.String = "actions/set-self-hosted-runners-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12179,102 +13070,189 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/header`. + public var path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/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.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers + public var headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy that controls whether self-hosted runners can be used in the organization + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy that controls whether self-hosted runners can be used in the organization + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy that controls whether self-hosted runners can be used in the organization + public init(enabledRepositories: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload) { + self.enabledRepositories = enabledRepositories + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers = .init() + path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.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/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 totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/machine_specs`. - public var machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - machineSpecs: - public init( - totalCount: Swift.Int, - machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] - ) { - self.totalCount = totalCount - self.machineSpecs = machineSpecs - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case machineSpecs = "machine_specs" - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output.NoContent) + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelfHostedRunnersPermissionsOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/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: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body) { - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -12311,20 +13289,22 @@ public enum Operations { } } } - /// Get platforms for GitHub-hosted runners in an organization + /// List repositories allowed to use self-hosted runners in an organization /// - /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// Lists repositories that are allowed to use self-hosted runners in 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 ActionsGetHostedRunnersPlatformsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-platforms-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public enum ActionsListSelectedRepositoriesSelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/list-selected-repositories-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12334,66 +13314,93 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/header`. + public var path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/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)." + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/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.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers = .init() + path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.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/platforms/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/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`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/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 totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/platforms`. - public var platforms: [Swift.String] + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.Repository]? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - platforms: + /// - repositories: public init( - totalCount: Swift.Int, - platforms: [Swift.String] + totalCount: Swift.Int? = nil, + repositories: [Components.Schemas.Repository]? = nil ) { self.totalCount = totalCount - self.platforms = platforms + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case platforms + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.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.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12403,26 +13410,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + public var body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok) + case ok(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.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.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -12435,6 +13442,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/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//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -12466,132 +13519,183 @@ public enum Operations { } } } - /// Get a GitHub-hosted runner for an organization + /// Set repositories allowed to use self-hosted runners in an organization /// - /// Gets a GitHub-hosted runner configured in an organization. + /// Sets repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission 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 enum ActionsGetHostedRunnerForOrg { - public static let id: Swift.String = "actions/get-hosted-runner-for-org" + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public enum ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/set-selected-repositories-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/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}/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/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 hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. - public init( - org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsGetHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/header`. + public var path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/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.ActionsGetHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// IDs of repositories that can use repository-level self-hosted runners + /// + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: IDs of repositories that can use repository-level self-hosted runners + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.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}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - 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`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent) + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response headers - public var headers: Operations.ActionsGetHostedRunnerForOrg.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/hosted-runners/{hosted_runner_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) - /// 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.ActionsHostedRunner { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/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: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnerForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ActionsGetHostedRunnerForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .ok(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "unprocessableContent", response: self ) } @@ -12628,174 +13732,199 @@ public enum Operations { } } } - /// Update a GitHub-hosted runner for an organization + /// Add a repository to the list of repositories allowed to use self-hosted runners in 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. + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// - 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 ActionsUpdateHostedRunnerForOrg { - public static let id: Swift.String = "actions/update-hosted-runner-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public enum ActionsEnableSelectedRepositorySelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/enable-selected-repository-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the GitHub-hosted runner. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.hostedRunnerId = hostedRunnerId + self.repositoryId = repositoryId } } - public var path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/header`. + public var path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_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.ActionsUpdateHostedRunnerForOrg.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 runnerGroupId: 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 maximumRunners: 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 enableStaticIp: 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 '_'. - /// - runnerGroupId: The existing runner group to add this runner to. - /// - maximumRunners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. - /// - enableStaticIp: 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, - runnerGroupId: Swift.Int? = nil, - maximumRunners: Swift.Int? = nil, - enableStaticIp: Swift.Bool? = nil - ) { - self.name = name - self.runnerGroupId = runnerGroupId - self.maximumRunners = maximumRunners - self.enableStaticIp = enableStaticIp - } - public enum CodingKeys: String, CodingKey { - case name - case runnerGroupId = "runner_group_id" - case maximumRunners = "maximum_runners" - case enableStaticIp = "enable_static_ip" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body + public var headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body + path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() ) { 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.ActionsHostedRunner) - /// 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.ActionsHostedRunner { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok { + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Undocumented response. + /// Forbidden /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/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//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + 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) @@ -12822,111 +13951,189 @@ public enum Operations { } } } - /// Delete a GitHub-hosted runner for an organization + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization /// - /// Deletes a GitHub-hosted runner for an organization. + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in 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 ActionsDeleteHostedRunnerForOrg { - public static let id: Swift.String = "actions/delete-hosted-runner-for-org" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `DELETE /organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public enum ActionsDisableSelectedRepositorySelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/disable-selected-repository-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the GitHub-hosted runner. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.hostedRunnerId = hostedRunnerId + self.repositoryId = repositoryId } } - public var path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/header`. + public var path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_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.ActionsDeleteHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers } } @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.ActionsHostedRunner) - /// 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.ActionsHostedRunner { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.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.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body - /// Creates a new `Accepted`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body) { - self.body = body + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/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 + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)/responses/202`. + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/404`. /// - /// HTTP response code: `202 accepted`. - case accepted(Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .accepted(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -12963,22 +14170,23 @@ public enum Operations { } } } - /// Get GitHub Actions permissions for an organization + /// Get GitHub Actions cache usage for an organization /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in 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 `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. - public enum ActionsGetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/get-github-actions-permissions-organization" + /// - 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 ActionsGetActionsCacheUsageForOrg { + 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/permissions/GET/path`. + /// - 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/permissions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12988,27 +14196,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/header`. + public var path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, + headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -13016,15 +14224,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content`. + /// - 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.ActionsGetActionsCacheUsageForOrg.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/permissions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsOrganizationPermissions) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheUsageOrgEnterprise) /// 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.ActionsOrganizationPermissions { + public var json: Components.Schemas.ActionsCacheUsageOrgEnterprise { get throws { switch self { case let .json(body): @@ -13034,26 +14256,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body) { + public init( + headers: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)/responses/200`. + /// - 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.ActionsGetGithubActionsPermissionsOrganization.Output.Ok) + case ok(Operations.ActionsGetActionsCacheUsageForOrg.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.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13097,132 +14324,23 @@ public enum Operations { } } } - /// Set GitHub Actions permissions for an organization - /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. - public enum ActionsSetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/set-github-actions-permissions-organization" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/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.ActionsSetGithubActionsPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/enabled_repositories`. - public var enabledRepositories: Components.Schemas.EnabledRepositories - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/allowed_actions`. - public var allowedActions: Components.Schemas.AllowedActions? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enabledRepositories: - /// - allowedActions: - public init( - enabledRepositories: Components.Schemas.EnabledRepositories, - allowedActions: Components.Schemas.AllowedActions? = nil - ) { - self.enabledRepositories = enabledRepositories - self.allowedActions = allowedActions - } - public enum CodingKeys: String, CodingKey { - case enabledRepositories = "enabled_repositories" - case allowedActions = "allowed_actions" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body.JsonPayload) - } - public var body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - body: - public init( - path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path, - body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body - ) { - self.path = path - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List selected repositories enabled for GitHub Actions in an organization + /// List repositories with GitHub Actions cache usage for an organization /// - /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-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 app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. - public enum ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { - public static let id: Swift.String = "actions/list-selected-repositories-enabled-github-actions-organization" + /// - 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 ActionsGetActionsCacheUsageByRepoForOrg { + 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/permissions/repositories/GET/path`. + /// - 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/permissions/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13232,16 +14350,16 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query`. + public var path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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/permissions/repositories/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// 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/permissions/repositories/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -13256,19 +14374,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/header`. + public var query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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] + 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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers + public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13276,9 +14394,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), - headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, + query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), + headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -13287,38 +14405,52 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content`. + /// - 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.ActionsGetActionsCacheUsageByRepoForOrg.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/permissions/repositories/GET/responses/200/content/json`. + /// - 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/permissions/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.Repository] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/json/repository_cache_usages`. + public var repositoryCacheUsages: [Components.Schemas.ActionsCacheUsageByRepository] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - repositories: + /// - repositoryCacheUsages: public init( - totalCount: Swift.Double, - repositories: [Components.Schemas.Repository] + totalCount: Swift.Int, + repositoryCacheUsages: [Components.Schemas.ActionsCacheUsageByRepository] ) { self.totalCount = totalCount - self.repositories = repositories + self.repositoryCacheUsages = repositoryCacheUsages } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case repositories + case repositoryCacheUsages = "repository_cache_usages" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -13328,26 +14460,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { + public init( + headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)/responses/200`. + /// - 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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok) + case ok(Operations.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13391,23 +14528,22 @@ public enum Operations { } } } - /// Set selected repositories enabled for GitHub Actions in an organization - /// - /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// 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 `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public enum ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { - public static let id: Swift.String = "actions/set-selected-repositories-enabled-github-actions-organization" + /// - 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 ActionsListHostedRunnersForOrg { + public static let id: Swift.String = "actions/list-hosted-runners-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path`. + /// - 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/permissions/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13417,74 +14553,148 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs to enable for GitHub Actions. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: List of repository IDs to enable for GitHub Actions. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } + public var path: Operations.ActionsListHostedRunnersForOrg.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 perPage: Components.Parameters.PerPage? + /// 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: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + public var query: Operations.ActionsListHostedRunnersForOrg.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.ActionsListHostedRunnersForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - query: + /// - headers: public init( - path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + path: Operations.ActionsListHostedRunnersForOrg.Input.Path, + query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), + headers: Operations.ActionsListHostedRunnersForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + 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}/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.ActionsListHostedRunnersForOrg.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 totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.ActionsHostedRunner] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runners: + public init( + totalCount: Swift.Int, + runners: [Components.Schemas.ActionsHostedRunner] + ) { + self.totalCount = totalCount + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListHostedRunnersForOrg.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.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListHostedRunnersForOrg.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.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListHostedRunnersForOrg.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 ) } @@ -13495,81 +14705,234 @@ 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 + ] + } + } } - /// Enable a selected repository for GitHub Actions in an organization - /// - /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Create a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// 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 `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. - public enum ActionsEnableSelectedRepositoryGithubActionsOrganization { - public static let id: Swift.String = "actions/enable-selected-repository-github-actions-organization" + /// - 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 ActionsCreateHostedRunnerForOrg { + public static let id: Swift.String = "actions/create-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path`. + /// - 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/permissions/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.repositoryId = repositoryId } } - public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path + public var path: Operations.ActionsCreateHostedRunnerForOrg.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.ActionsCreateHostedRunnerForOrg.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, CaseIterable { + 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.ActionsCreateHostedRunnerForOrg.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.ActionsCreateHostedRunnerForOrg.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.ActionsCreateHostedRunnerForOrg.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 runnerGroupId: 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 maximumRunners: 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 enableStaticIp: 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` + /// - runnerGroupId: The existing runner group to add this runner to. + /// - maximumRunners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// - enableStaticIp: 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.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload, + size: Swift.String, + runnerGroupId: Swift.Int, + maximumRunners: Swift.Int? = nil, + enableStaticIp: Swift.Bool? = nil + ) { + self.name = name + self.image = image + self.size = size + self.runnerGroupId = runnerGroupId + self.maximumRunners = maximumRunners + self.enableStaticIp = enableStaticIp + } + public enum CodingKeys: String, CodingKey { + case name + case image + case size + case runnerGroupId = "runner_group_id" + case maximumRunners = "maximum_runners" + case enableStaticIp = "enable_static_ip" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/content/application\/json`. + case json(Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) { + /// - headers: + /// - body: + public init( + path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsCreateHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsCreateHostedRunnerForOrg.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() {} + 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.ActionsHostedRunner) + /// 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.ActionsHostedRunner { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateHostedRunnerForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateHostedRunnerForOrg.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -13580,81 +14943,151 @@ 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 + ] + } + } } - /// Disable a selected repository for GitHub Actions in an organization - /// - /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Get GitHub-owned images for GitHub-hosted runners in an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. - public enum ActionsDisableSelectedRepositoryGithubActionsOrganization { - public static let id: Swift.String = "actions/disable-selected-repository-github-actions-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 ActionsGetHostedRunnersGithubOwnedImagesForOrg { + 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/permissions/repositories/{repository_id}/DELETE/path`. + /// - 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/permissions/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.repositoryId = repositoryId } } - public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path + public var path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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}/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 totalCount: 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.ActionsHostedRunnerImage] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - images: + public init( + totalCount: Swift.Int, + images: [Components.Schemas.ActionsHostedRunnerImage] + ) { + self.totalCount = totalCount + self.images = images + } + public enum CodingKeys: String, CodingKey { + case totalCount = "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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. + /// - 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: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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 ) } @@ -13665,23 +15098,46 @@ 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 + ] + } + } } - /// Get allowed actions and reusable workflows for an organization - /// - /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Get partner images for GitHub-hosted runners in an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of partner images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. - public enum ActionsGetAllowedActionsOrganization { - public static let id: Swift.String = "actions/get-allowed-actions-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 ActionsGetHostedRunnersPartnerImagesForOrg { + 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/permissions/selected-actions/GET/path`. + /// - 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. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13691,27 +15147,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetAllowedActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/header`. + public var path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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] + 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.ActionsGetAllowedActionsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetAllowedActionsOrganization.Input.Path, - headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -13719,15 +15175,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content`. + /// - 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/permissions/selected-actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.SelectedActions) + /// - 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 totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.ActionsHostedRunnerImage] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - images: + public init( + totalCount: Swift.Int, + images: [Components.Schemas.ActionsHostedRunnerImage] + ) { + self.totalCount = totalCount + self.images = images + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case images + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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: Components.Schemas.SelectedActions { + public var json: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -13737,26 +15216,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)/responses/200`. + /// - 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.ActionsGetAllowedActionsOrganization.Output.Ok) + case ok(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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.ActionsGetAllowedActionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13800,22 +15279,20 @@ public enum Operations { } } } - /// Set allowed actions and reusable workflows for an organization - /// - /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Get limits on GitHub-hosted runners for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the GitHub-hosted runners limits for an organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. - public enum ActionsSetAllowedActionsOrganization { - public static let id: Swift.String = "actions/set-allowed-actions-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 ActionsGetHostedRunnersLimitsForOrg { + 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/permissions/selected-actions/PUT/path`. + /// - 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. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13825,57 +15302,79 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetAllowedActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.SelectedActions) + public var path: Operations.ActionsGetHostedRunnersLimitsForOrg.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 + } } - public var body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? + public var headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetAllowedActionsOrganization.Input.Path, - body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? = nil + path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + 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}/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.ActionsHostedRunnerLimits) + /// 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.ActionsHostedRunnerLimits { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetAllowedActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetHostedRunnersLimitsForOrg.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.ActionsSetAllowedActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersLimitsForOrg.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 ) } @@ -13886,25 +15385,46 @@ 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 + ] + } + } } - /// Get default workflow permissions for an organization - /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, - /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Get GitHub-hosted runners machine specs for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. - public enum ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization { - public static let id: Swift.String = "actions/get-github-actions-default-workflow-permissions-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 ActionsGetHostedRunnersMachineSpecsForOrg { + 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/permissions/workflow/GET/path`. + /// - 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. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13914,27 +15434,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/header`. + public var path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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] + 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.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -13942,15 +15462,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content`. + /// - 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/permissions/workflow/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsGetDefaultWorkflowPermissions) + /// - 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 totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/machine_specs`. + public var machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - machineSpecs: + public init( + totalCount: Swift.Int, + machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + ) { + self.totalCount = totalCount + self.machineSpecs = machineSpecs + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case machineSpecs = "machine_specs" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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: Components.Schemas.ActionsGetDefaultWorkflowPermissions { + public var json: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -13960,26 +15503,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)/responses/200`. + /// - 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.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok) + case ok(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -14023,24 +15566,20 @@ public enum Operations { } } } - /// Set default workflow permissions for an organization - /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions - /// can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Get platforms for GitHub-hosted runners in an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of platforms available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. - public enum ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization { - public static let id: Swift.String = "actions/set-github-actions-default-workflow-permissions-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 ActionsGetHostedRunnersPlatformsForOrg { + 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/permissions/workflow/PUT/path`. + /// - 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/permissions/workflow/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14050,57 +15589,102 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.ActionsSetDefaultWorkflowPermissions) + public var path: Operations.ActionsGetHostedRunnersPlatformsForOrg.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`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } } - public var body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? + public var headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, - body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? = nil + path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + 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}/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 totalCount: 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: + /// - totalCount: + /// - platforms: + public init( + totalCount: Swift.Int, + platforms: [Swift.String] + ) { + self.totalCount = totalCount + self.platforms = platforms + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case platforms + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersPlatformsForOrg.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.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body) { + self.body = body + } } - /// Success response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent) - /// Success response + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetHostedRunnersPlatformsForOrg.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.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersPlatformsForOrg.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 ) } @@ -14111,126 +15695,117 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - } - /// List self-hosted runner groups for an organization - /// - /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. - public enum ActionsListSelfHostedRunnerGroupsForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runner-groups-for-org" + @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 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 enum ActionsGetHostedRunnerForOrg { + public static let id: Swift.String = "actions/get-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/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/runner-groups/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 hostedRunnerId: Components.Parameters.HostedRunnerId /// 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.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/page`. - public var page: Components.Parameters.Page? - /// Only return runner groups that are allowed to be used by this repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/visible_to_repository`. - public var visibleToRepository: Components.Parameters.VisibleToRepository? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: 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)." - /// - visibleToRepository: Only return runner groups that are allowed to be used by this repository. + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - visibleToRepository: Components.Parameters.VisibleToRepository? = nil + org: Components.Parameters.Org, + hostedRunnerId: Components.Parameters.HostedRunnerId ) { - self.perPage = perPage - self.page = page - self.visibleToRepository = visibleToRepository + self.org = org + self.hostedRunnerId = hostedRunnerId } } - public var query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/header`. + public var path: Operations.ActionsGetHostedRunnerForOrg.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.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers + public var headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/runner_groups`. - public var runnerGroups: [Components.Schemas.RunnerGroupsOrg] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runnerGroups: - public init( - totalCount: Swift.Double, - runnerGroups: [Components.Schemas.RunnerGroupsOrg] - ) { - self.totalCount = totalCount - self.runnerGroups = runnerGroups - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runnerGroups = "runner_groups" - } + /// - 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/hosted-runners/{hosted_runner_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 } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.ActionsGetHostedRunnerForOrg.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/hosted-runners/{hosted_runner_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) /// 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.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsHostedRunner { get throws { switch self { case let .json(body): @@ -14240,26 +15815,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body) { + public init( + headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-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.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok) + case ok(Operations.ActionsGetHostedRunnerForOrg.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.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnerForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -14303,133 +15883,101 @@ public enum Operations { } } } - /// Create a self-hosted runner group for an organization - /// - /// Creates a new self-hosted runner group for an organization. + /// Update a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin: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 `POST /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. - public enum ActionsCreateSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/create-self-hosted-runner-group-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 ActionsUpdateHostedRunnerForOrg { + public static let id: Swift.String = "actions/update-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/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/runner-groups/POST/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 hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. + public init( + org: Components.Parameters.Org, + hostedRunnerId: Components.Parameters.HostedRunnerId + ) { self.org = org + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/header`. + public var path: Operations.ActionsUpdateHostedRunnerForOrg.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] + 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.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody`. + public var headers: Operations.ActionsUpdateHostedRunnerForOrg.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/runner-groups/POST/requestBody/json`. + /// - 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 group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/name`. - public var name: Swift.String - /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case selected = "selected" - case all = "all" - case _private = "private" - } - /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. - public var visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? - /// List of repository IDs that can access the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// List of runner IDs to add to the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/runners`. - public var runners: [Swift.Int]? - /// Whether the runner group can be used by `public` repositories. + /// 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/runner-groups/POST/requestBody/json/allows_public_repositories`. - public var allowsPublicRepositories: Swift.Bool? - /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/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/runner-groups/POST/requestBody/json/restricted_to_workflows`. - public var restrictedToWorkflows: Swift.Bool? - /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/runner_group_id`. + public var runnerGroupId: 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/runner-groups/POST/requestBody/json/selected_workflows`. - public var selectedWorkflows: [Swift.String]? - /// The identifier of a hosted compute network configuration. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/maximum_runners`. + public var maximumRunners: 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/runner-groups/POST/requestBody/json/network_configuration_id`. - public var networkConfigurationId: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/enable_static_ip`. + public var enableStaticIp: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: Name of the runner group. - /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - selectedRepositoryIds: List of repository IDs that can access the runner group. - /// - runners: List of runner IDs to add to the runner group. - /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. - /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - networkConfigurationId: The identifier of a hosted compute network configuration. + /// - 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 '_'. + /// - runnerGroupId: The existing runner group to add this runner to. + /// - maximumRunners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// - enableStaticIp: 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, - visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, - selectedRepositoryIds: [Swift.Int]? = nil, - runners: [Swift.Int]? = nil, - allowsPublicRepositories: Swift.Bool? = nil, - restrictedToWorkflows: Swift.Bool? = nil, - selectedWorkflows: [Swift.String]? = nil, - networkConfigurationId: Swift.String? = nil + name: Swift.String? = nil, + runnerGroupId: Swift.Int? = nil, + maximumRunners: Swift.Int? = nil, + enableStaticIp: Swift.Bool? = nil ) { self.name = name - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - self.runners = runners - self.allowsPublicRepositories = allowsPublicRepositories - self.restrictedToWorkflows = restrictedToWorkflows - self.selectedWorkflows = selectedWorkflows - self.networkConfigurationId = networkConfigurationId + self.runnerGroupId = runnerGroupId + self.maximumRunners = maximumRunners + self.enableStaticIp = enableStaticIp } public enum CodingKeys: String, CodingKey { case name - case visibility - case selectedRepositoryIds = "selected_repository_ids" - case runners - case allowsPublicRepositories = "allows_public_repositories" - case restrictedToWorkflows = "restricted_to_workflows" - case selectedWorkflows = "selected_workflows" - case networkConfigurationId = "network_configuration_id" + case runnerGroupId = "runner_group_id" + case maximumRunners = "maximum_runners" + case enableStaticIp = "enable_static_ip" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. - case json(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + public var body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -14437,9 +15985,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), - body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body ) { self.path = path self.headers = headers @@ -14447,16 +15995,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content`. + 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/runner-groups/POST/responses/201/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) /// 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.RunnerGroupsOrg { + public var json: Components.Schemas.ActionsHostedRunner { get throws { switch self { case let .json(body): @@ -14466,33 +16014,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body) { + public init(body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsUpdateHostedRunnerForOrg.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.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsUpdateHostedRunnerForOrg.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 ) } @@ -14529,77 +16077,75 @@ public enum Operations { } } } - /// Get a self-hosted runner group for an organization - /// - /// Gets a specific self-hosted runner group for an organization. + /// Delete a GitHub-hosted runner for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Deletes a GitHub-hosted runner for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. - public enum ActionsGetSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/get-self-hosted-runner-group-for-org" + /// - 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 ActionsDeleteHostedRunnerForOrg { + public static let id: Swift.String = "actions/delete-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path`. + /// - 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/runner-groups/{runner_group_id}/GET/path/org`. + /// - 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 self-hosted runner group. + /// Unique identifier of the GitHub-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/hosted_runner_id`. + public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId + hostedRunnerId: Components.Parameters.HostedRunnerId ) { self.org = org - self.runnerGroupId = runnerGroupId + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/header`. + public var path: Operations.ActionsDeleteHostedRunnerForOrg.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.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers + public var headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers = .init() + path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content`. + 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/runner-groups/{runner_group_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) /// 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.RunnerGroupsOrg { + public var json: Components.Schemas.ActionsHostedRunner { get throws { switch self { case let .json(body): @@ -14609,33 +16155,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + /// Creates a new `Accepted`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)/responses/200`. + /// - 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.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `202 accepted`. + case accepted(Operations.ActionsDeleteHostedRunnerForOrg.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.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.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 ) } @@ -14672,182 +16218,97 @@ public enum Operations { } } } - /// Update a self-hosted runner group for an organization + /// Get GitHub Actions permissions for an organization /// - /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. - public enum ActionsUpdateSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/update-self-hosted-runner-group-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. + public enum ActionsGetGithubActionsPermissionsOrganization { + public static let id: Swift.String = "actions/get-github-actions-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/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}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/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}/PATCH/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/header`. + public var path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/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.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/name`. - public var name: Swift.String - /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + public var headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetGithubActionsPermissionsOrganization.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/permissions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsOrganizationPermissions) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case selected = "selected" - case all = "all" - case _private = "private" - } - /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. - public var visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? - /// Whether the runner group can be used by `public` repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/allows_public_repositories`. - public var allowsPublicRepositories: Swift.Bool? - /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/restricted_to_workflows`. - public var restrictedToWorkflows: Swift.Bool? - /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. - public var selectedWorkflows: [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 networkConfigurationId: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the runner group. - /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. - /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. - /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - networkConfigurationId: The identifier of a hosted compute network configuration. - public init( - name: Swift.String, - visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, - allowsPublicRepositories: Swift.Bool? = nil, - restrictedToWorkflows: Swift.Bool? = nil, - selectedWorkflows: [Swift.String]? = nil, - networkConfigurationId: Swift.String? = nil - ) { - self.name = name - self.visibility = visibility - self.allowsPublicRepositories = allowsPublicRepositories - self.restrictedToWorkflows = restrictedToWorkflows - self.selectedWorkflows = selectedWorkflows - self.networkConfigurationId = networkConfigurationId - } - public enum CodingKeys: String, CodingKey { - case name - case visibility - case allowsPublicRepositories = "allows_public_repositories" - case restrictedToWorkflows = "restricted_to_workflows" - case selectedWorkflows = "selected_workflows" - case networkConfigurationId = "network_configuration_id" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), - body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) - /// 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.RunnerGroupsOrg { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsOrganizationPermissions { + get throws { + switch self { + case let .json(body): + return body + } + } } } /// Received HTTP response body - public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok) + case ok(Operations.ActionsGetGithubActionsPermissionsOrganization.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.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok { + public var ok: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -14891,47 +16352,72 @@ public enum Operations { } } } - /// Delete a self-hosted runner group from an organization + /// Set GitHub Actions permissions for an organization /// - /// Deletes a self-hosted runner group for an organization. + /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. - public enum ActionsDeleteSelfHostedRunnerGroupFromOrg { - public static let id: Swift.String = "actions/delete-self-hosted-runner-group-from-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. + public enum ActionsSetGithubActionsPermissionsOrganization { + public static let id: Swift.String = "actions/set-github-actions-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path + public var path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Components.Schemas.EnabledRepositories + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/allowed_actions`. + public var allowedActions: Components.Schemas.AllowedActions? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: + /// - allowedActions: + public init( + enabledRepositories: Components.Schemas.EnabledRepositories, + allowedActions: Components.Schemas.AllowedActions? = nil + ) { + self.enabledRepositories = enabledRepositories + self.allowedActions = allowedActions + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + case allowedActions = "allowed_actions" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path) { + /// - body: + public init( + path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path, + body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body + ) { self.path = path + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -14941,13 +16427,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent) + case noContent(Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -14957,7 +16443,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent { + public var noContent: Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -14976,50 +16462,41 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List GitHub-hosted runners in a group for an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Lists the GitHub-hosted runners in an organization group. + /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/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 ActionsListGithubHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/list-github-hosted-runners-in-group-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. + public enum ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { + public static let id: Swift.String = "actions/list-selected-repositories-enabled-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query`. + public var path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// 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`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -15034,19 +16511,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/header`. + public var query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/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.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -15054,9 +16531,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path, - query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query = .init(), - headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers = .init() + path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() ) { self.path = path self.query = query @@ -15065,52 +16542,38 @@ public enum Operations { } @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.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/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`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/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`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/total_count`. public var totalCount: 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.ActionsHostedRunner] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.Repository] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - runners: + /// - repositories: public init( totalCount: Swift.Double, - runners: [Components.Schemas.ActionsHostedRunner] + repositories: [Components.Schemas.Repository] ) { self.totalCount = totalCount - self.runners = runners + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case runners + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.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.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -15120,31 +16583,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { 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`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok) + case ok(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.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.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -15188,163 +16646,100 @@ public enum Operations { } } } - /// List repository access to a self-hosted runner group in an organization + /// Set selected repositories enabled for GitHub Actions in an organization + /// + /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/list-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public enum ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { + public static let id: Swift.String = "actions/set-selected-repositories-enabled-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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)." - /// - perPage: 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, - perPage: Components.Parameters.PerPage? = nil - ) { - self.page = page - self.perPage = perPage } } - public var query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs to enable for GitHub Actions. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: List of repository IDs to enable for GitHub Actions. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body.JsonPayload) } - public var headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers + public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: - /// - headers: + /// - body: public init( - path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, - query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query = .init(), - headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers = .init() + path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body ) { self.path = path - self.query = query - self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Double, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.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.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -15355,101 +16750,48 @@ 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 - ] - } - } } - /// Set repository access for a self-hosted runner group in an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/set-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. + public enum ActionsEnableSelectedRepositoryGithubActionsOrganization { + public static let id: Swift.String = "actions/enable-selected-repository-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.runnerGroupId = runnerGroupId + self.repositoryId = repositoryId } } - public var path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs that can access the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: List of repository IDs that can access the runner group. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body + public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: - public init( - path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, - body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body - ) { + public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) { self.path = path - self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -15459,13 +16801,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + case noContent(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15475,7 +16817,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + public var noContent: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15494,53 +16836,46 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Add repository access to a self-hosted runner group in an organization + /// Disable a selected repository for GitHub Actions in an organization /// - /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/add-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. + public enum ActionsDisableSelectedRepositoryGithubActionsOrganization { + public static let id: Swift.String = "actions/disable-selected-repository-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/repository_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/repository_id`. public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.runnerGroupId = runnerGroupId self.repositoryId = repositoryId } } - public var path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path) { self.path = path } } @@ -15551,13 +16886,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + case noContent(Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15567,7 +16902,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + public var noContent: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15586,54 +16921,183 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Remove repository access to a self-hosted runner group in an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/remove-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. + public enum ActionsGetAllowedActionsOrganization { + public static let id: Swift.String = "actions/get-allowed-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// The unique identifier of the repository. + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetAllowedActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetAllowedActionsOrganization.Input.Path, + headers: Operations.ActionsGetAllowedActionsOrganization.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/permissions/selected-actions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SelectedActions) + /// 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.SelectedActions { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetAllowedActionsOrganization.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.ActionsGetAllowedActionsOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set allowed actions and reusable workflows for an organization + /// + /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. + public enum ActionsSetAllowedActionsOrganization { + public static let id: Swift.String = "actions/set-allowed-actions-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - self.repositoryId = repositoryId } } - public var path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + public var path: Operations.ActionsSetAllowedActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.SelectedActions) + } + public var body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + /// - body: + public init( + path: Operations.ActionsSetAllowedActionsOrganization.Input.Path, + body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? = nil + ) { self.path = path + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -15643,13 +17107,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + case noContent(Operations.ActionsSetAllowedActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15659,7 +17123,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + public var noContent: Operations.ActionsSetAllowedActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15678,141 +17142,70 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List self-hosted runners in a group for an organization + /// Get default workflow permissions for an organization /// - /// Lists self-hosted runners that are in a specific organization group. + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, + /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. - public enum ActionsListSelfHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runners-in-group-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. + public enum ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization { + public static let id: Swift.String = "actions/get-github-actions-default-workflow-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: 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( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page } } - public var query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/header`. + public var path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/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.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers + public var headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers = .init() + path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.Runner] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runners: - public init( - totalCount: Swift.Double, - runners: [Components.Schemas.Runner] - ) { - self.totalCount = totalCount - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runners - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsGetDefaultWorkflowPermissions) /// 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.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsGetDefaultWorkflowPermissions { get throws { switch self { case let .json(body): @@ -15822,38 +17215,2774 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body) { self.body = body } } - /// Response + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.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.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set default workflow permissions for an organization + /// + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions + /// can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. + public enum ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization { + public static let id: Swift.String = "actions/set-github-actions-default-workflow-permissions-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/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.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsSetDefaultWorkflowPermissions) + } + public var body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, + body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? = nil + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Success response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent) + /// Success response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List self-hosted runner groups for an organization + /// + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public enum ActionsListSelfHostedRunnerGroupsForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runner-groups-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/page`. + public var page: Components.Parameters.Page? + /// Only return runner groups that are allowed to be used by this repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/visible_to_repository`. + public var visibleToRepository: Components.Parameters.VisibleToRepository? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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)." + /// - visibleToRepository: Only return runner groups that are allowed to be used by this repository. + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + visibleToRepository: Components.Parameters.VisibleToRepository? = nil + ) { + self.perPage = perPage + self.page = page + self.visibleToRepository = visibleToRepository + } + } + public var query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/runner_groups`. + public var runnerGroups: [Components.Schemas.RunnerGroupsOrg] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runnerGroups: + public init( + totalCount: Swift.Double, + runnerGroups: [Components.Schemas.RunnerGroupsOrg] + ) { + self.totalCount = totalCount + self.runnerGroups = runnerGroups + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case runnerGroups = "runner_groups" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnerGroupsForOrg.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.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListSelfHostedRunnerGroupsForOrg.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.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a self-hosted runner group for an organization + /// + /// Creates a new self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public enum ActionsCreateSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/create-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + public var visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// List of runner IDs to add to the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/runners`. + public var runners: [Swift.Int]? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/allows_public_repositories`. + public var allowsPublicRepositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/restricted_to_workflows`. + public var restrictedToWorkflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_workflows`. + public var selectedWorkflows: [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 networkConfigurationId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// - selectedRepositoryIds: List of repository IDs that can access the runner group. + /// - runners: List of runner IDs to add to the runner group. + /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. + /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// - networkConfigurationId: The identifier of a hosted compute network configuration. + public init( + name: Swift.String, + visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, + selectedRepositoryIds: [Swift.Int]? = nil, + runners: [Swift.Int]? = nil, + allowsPublicRepositories: Swift.Bool? = nil, + restrictedToWorkflows: Swift.Bool? = nil, + selectedWorkflows: [Swift.String]? = nil, + networkConfigurationId: Swift.String? = nil + ) { + self.name = name + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + self.runners = runners + self.allowsPublicRepositories = allowsPublicRepositories + self.restrictedToWorkflows = restrictedToWorkflows + self.selectedWorkflows = selectedWorkflows + self.networkConfigurationId = networkConfigurationId + } + public enum CodingKeys: String, CodingKey { + case name + case visibility + case selectedRepositoryIds = "selected_repository_ids" + case runners + case allowsPublicRepositories = "allows_public_repositories" + case restrictedToWorkflows = "restricted_to_workflows" + case selectedWorkflows = "selected_workflows" + case networkConfigurationId = "network_configuration_id" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. + case json(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), + body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// 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.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.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.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public enum ActionsGetSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/get-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// 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.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetSelfHostedRunnerGroupForOrg.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.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update a self-hosted runner group for an organization + /// + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public enum ActionsUpdateSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/update-self-hosted-runner-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/allows_public_repositories`. + public var allowsPublicRepositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/restricted_to_workflows`. + public var restrictedToWorkflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. + public var selectedWorkflows: [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 networkConfigurationId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. + /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// - networkConfigurationId: The identifier of a hosted compute network configuration. + public init( + name: Swift.String, + visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, + allowsPublicRepositories: Swift.Bool? = nil, + restrictedToWorkflows: Swift.Bool? = nil, + selectedWorkflows: [Swift.String]? = nil, + networkConfigurationId: Swift.String? = nil + ) { + self.name = name + self.visibility = visibility + self.allowsPublicRepositories = allowsPublicRepositories + self.restrictedToWorkflows = restrictedToWorkflows + self.selectedWorkflows = selectedWorkflows + self.networkConfigurationId = networkConfigurationId + } + public enum CodingKeys: String, CodingKey { + case name + case visibility + case allowsPublicRepositories = "allows_public_repositories" + case restrictedToWorkflows = "restricted_to_workflows" + case selectedWorkflows = "selected_workflows" + case networkConfigurationId = "network_configuration_id" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), + body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// 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.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.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.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a self-hosted runner group from an organization + /// + /// Deletes a self-hosted runner group for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public enum ActionsDeleteSelfHostedRunnerGroupFromOrg { + public static let id: Swift.String = "actions/delete-self-hosted-runner-group-from-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List 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 ActionsListGithubHostedRunnersInGroupForOrg { + 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 runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.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 perPage: Components.Parameters.PerPage? + /// 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: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path, + query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query = .init(), + headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsListGithubHostedRunnersInGroupForOrg.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 totalCount: 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.ActionsHostedRunner] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runners: + public init( + totalCount: Swift.Double, + runners: [Components.Schemas.ActionsHostedRunner] + ) { + self.totalCount = totalCount + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case totalCount = "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.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsListGithubHostedRunnersInGroupForOrg.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.ActionsListGithubHostedRunnersInGroupForOrg.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. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/list-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// - perPage: 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, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, + query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query = .init(), + headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Double, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.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.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.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.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set repository access for a self-hosted runner group in an organization + /// + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/set-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: List of repository IDs that can access the runner group. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, + body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add repository access to a self-hosted runner group in an organization + /// + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/add-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove repository access to a self-hosted runner group in an organization + /// + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/remove-repo-access-to-self-hosted-runner-group-in-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List self-hosted runners in a group for an organization + /// + /// Lists self-hosted runners that are in a specific organization group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public enum ActionsListSelfHostedRunnersInGroupForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runners-in-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.Runner] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runners: + public init( + totalCount: Swift.Double, + runners: [Components.Schemas.Runner] + ) { + self.totalCount = totalCount + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnersInGroupForOrg.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.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListSelfHostedRunnersInGroupForOrg.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.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set self-hosted runners in a group for an organization + /// + /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public enum ActionsSetSelfHostedRunnersInGroupForOrg { + public static let id: Swift.String = "actions/set-self-hosted-runners-in-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + } + } + public var path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of runner IDs to add to the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json/runners`. + public var runners: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - runners: List of runner IDs to add to the runner group. + public init(runners: [Swift.Int]) { + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path, + body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add a self-hosted runner to a group for an organization + /// + /// Adds a self-hosted runner to a runner group configured in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public enum ActionsAddSelfHostedRunnerToGroupForOrg { + public static let id: Swift.String = "actions/add-self-hosted-runner-to-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + self.runnerId = runnerId + } + } + public var path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove a self-hosted runner from a group for an organization + /// + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public enum ActionsRemoveSelfHostedRunnerFromGroupForOrg { + public static let id: Swift.String = "actions/remove-self-hosted-runner-from-group-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerGroupId = runnerGroupId + self.runnerId = runnerId + } + } + public var path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List self-hosted runners for an organization + /// + /// Lists all self-hosted runners configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. + public enum ActionsListSelfHostedRunnersForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runners-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/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.ActionsListSelfHostedRunnersForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query`. + public struct Query: Sendable, Hashable { + /// The name of a self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/name`. + public var name: Swift.String? + /// 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/runners/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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/runners/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - name: The name of a self-hosted runner. + /// - perPage: 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( + name: Swift.String? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.name = name + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/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.ActionsListSelfHostedRunnersForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnersForOrg.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/runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.Runner] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runners: + public init( + totalCount: Swift.Int, + runners: [Components.Schemas.Runner] + ) { + self.totalCount = totalCount + self.runners = runners + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case runners + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnersForOrg.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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListSelfHostedRunnersForOrg.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.ActionsListSelfHostedRunnersForOrg.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 runner applications for an organization + /// + /// Lists binaries for the runner application that you can download and run. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. + public enum ActionsListRunnerApplicationsForOrg { + public static let id: Swift.String = "actions/list-runner-applications-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/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.ActionsListRunnerApplicationsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/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.ActionsListRunnerApplicationsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path, + headers: Operations.ActionsListRunnerApplicationsForOrg.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/runners/downloads/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content/application\/json`. + case json([Components.Schemas.RunnerApplication]) + /// 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.RunnerApplication] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListRunnerApplicationsForOrg.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.ActionsListRunnerApplicationsForOrg.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 configuration for a just-in-time runner for an organization + /// + /// Generates a configuration that can be passed to the runner application at startup. + /// + /// The authenticated user must have admin access to the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. + public enum ActionsGenerateRunnerJitconfigForOrg { + public static let id: Swift.String = "actions/generate-runner-jitconfig-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/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.ActionsGenerateRunnerJitconfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/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.ActionsGenerateRunnerJitconfigForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the new runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/name`. + public var name: Swift.String + /// The ID of the runner group to register the runner to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/runner_group_id`. + public var runnerGroupId: Swift.Int + /// The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/labels`. + public var labels: [Swift.String] + /// The working directory to be used for job execution, relative to the runner install directory. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/work_folder`. + public var workFolder: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the new runner. + /// - runnerGroupId: The ID of the runner group to register the runner to. + /// - labels: The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + /// - workFolder: The working directory to be used for job execution, relative to the runner install directory. + public init( + name: Swift.String, + runnerGroupId: Swift.Int, + labels: [Swift.String], + workFolder: Swift.String? = nil + ) { + self.name = name + self.runnerGroupId = runnerGroupId + self.labels = labels + self.workFolder = workFolder + } + public enum CodingKeys: String, CodingKey { + case name + case runnerGroupId = "runner_group_id" + case labels + case workFolder = "work_folder" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/content/application\/json`. + case json(Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path, + headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers = .init(), + body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Components.Responses.ActionsRunnerJitconfig) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Components.Responses.ActionsRunnerJitconfig { + 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}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// 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.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", response: self ) } @@ -15890,108 +20019,112 @@ public enum Operations { } } } - /// Set self-hosted runners in a group for an organization + /// Create a registration token for an organization /// - /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// Returns a token that you can pass to the `config` script. The token expires after one hour. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. - public enum ActionsSetSelfHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/set-self-hosted-runners-in-group-for-org" + /// ``` + /// ./config.sh --url https://github.com/octo-org --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. + public enum ActionsCreateRegistrationTokenForOrg { + public static let id: Swift.String = "actions/create-registration-token-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of runner IDs to add to the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json/runners`. - public var runners: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - runners: List of runner IDs to add to the runner group. - public init(runners: [Swift.Int]) { - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case runners - } + public var path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/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 } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + public var headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path, - body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path, + headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content/application\/json`. + case json(Components.Schemas.AuthenticationToken) + /// 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.AuthenticationToken { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateRegistrationTokenForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -16002,180 +20135,138 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - } - /// Add a self-hosted runner to a group for an organization - /// - /// Adds a self-hosted runner to a runner group configured in an organization. - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. - public enum ActionsAddSelfHostedRunnerToGroupForOrg { - public static let id: Swift.String = "actions/add-self-hosted-runner-to-group-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/org`. - public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - runnerId: Components.Parameters.RunnerId - ) { - self.org = org - self.runnerGroupId = runnerGroupId - self.runnerId = runnerId - } - } - public var path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: 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) } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + 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 a self-hosted runner from a group for an organization + /// Create a remove token for an organization /// - /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. - public enum ActionsRemoveSelfHostedRunnerFromGroupForOrg { - public static let id: Swift.String = "actions/remove-self-hosted-runner-from-group-for-org" + /// ``` + /// ./config.sh remove --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. + public enum ActionsCreateRemoveTokenForOrg { + public static let id: Swift.String = "actions/create-remove-token-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - self.runnerId = runnerId } } - public var path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path + public var path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/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.ActionsCreateRemoveTokenForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path, + headers: Operations.ActionsCreateRemoveTokenForOrg.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 Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content/application\/json`. + case json(Components.Schemas.AuthenticationToken) + /// 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.AuthenticationToken { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateRemoveTokenForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateRemoveTokenForOrg.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -16186,142 +20277,105 @@ 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 self-hosted runners for an organization + /// Get a self-hosted runner for an organization /// - /// Lists all self-hosted runners configured in an organization. + /// Gets a specific self-hosted runner configured in an organization. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. - public enum ActionsListSelfHostedRunnersForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runners-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. + public enum ActionsGetSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/get-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{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/runners/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// 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.ActionsListSelfHostedRunnersForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query`. - public struct Query: Sendable, Hashable { - /// The name of a self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/name`. - public var name: Swift.String? - /// 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/runners/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/runners/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - name: The name of a self-hosted runner. - /// - perPage: 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)." + /// - runnerId: Unique identifier of the self-hosted runner. public init( - name: Swift.String? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId ) { - self.name = name - self.perPage = perPage - self.page = page + self.org = org + self.runnerId = runnerId } } - public var query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/header`. + public var path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{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.ActionsListSelfHostedRunnersForOrg.Input.Headers + public var headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnersForOrg.Input.Headers = .init() + path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnerForOrg.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/runners/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content`. + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.Runner] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runners: - public init( - totalCount: Swift.Int, - runners: [Components.Schemas.Runner] - ) { - self.totalCount = totalCount - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runners - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.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.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.Runner { get throws { switch self { case let .json(body): @@ -16331,31 +20385,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + public var body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok) + case ok(Operations.ActionsGetSelfHostedRunnerForOrg.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.ActionsListSelfHostedRunnersForOrg.Output.Ok { + public var ok: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -16399,106 +20448,122 @@ public enum Operations { } } } - /// List runner applications for an organization + /// Delete a self-hosted runner from an organization /// - /// Lists binaries for the runner application that you can download and run. + /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. - public enum ActionsListRunnerApplicationsForOrg { - public static let id: Swift.String = "actions/list-runner-applications-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. + public enum ActionsDeleteSelfHostedRunnerFromOrg { + public static let id: Swift.String = "actions/delete-self-hosted-runner-from-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { self.org = org + self.runnerId = runnerId } } - public var path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/header`. + public var path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{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.ActionsListRunnerApplicationsForOrg.Input.Headers + public var headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path, - headers: Operations.ActionsListRunnerApplicationsForOrg.Input.Headers = .init() + path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path, + headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.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/runners/downloads/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content/application\/json`. - case json([Components.Schemas.RunnerApplication]) - /// 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.RunnerApplication] { - 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}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsDeleteSelfHostedRunnerFromOrg.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.ActionsListRunnerApplicationsForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRunnerApplicationsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// 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.ActionsListRunnerApplicationsForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .ok(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "unprocessableContent", response: self ) } @@ -16535,130 +20600,87 @@ public enum Operations { } } } - /// Create configuration for a just-in-time runner for an organization + /// List labels for a self-hosted runner for an organization /// - /// Generates a configuration that can be passed to the runner application at startup. + /// Lists all labels for a self-hosted runner configured in an organization. /// - /// The authenticated user must have admin access to the organization. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. - public enum ActionsGenerateRunnerJitconfigForOrg { - public static let id: Swift.String = "actions/generate-runner-jitconfig-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. + public enum ActionsListLabelsForSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/list-labels-for-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/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.ActionsGenerateRunnerJitconfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/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.ActionsGenerateRunnerJitconfigForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the new runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/name`. - public var name: Swift.String - /// The ID of the runner group to register the runner to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/runner_group_id`. - public var runnerGroupId: Swift.Int - /// The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/labels`. - public var labels: [Swift.String] - /// The working directory to be used for job execution, relative to the runner install directory. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/work_folder`. - public var workFolder: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the new runner. - /// - runnerGroupId: The ID of the runner group to register the runner to. - /// - labels: The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. - /// - workFolder: The working directory to be used for job execution, relative to the runner install directory. - public init( - name: Swift.String, - runnerGroupId: Swift.Int, - labels: [Swift.String], - workFolder: Swift.String? = nil - ) { - self.name = name - self.runnerGroupId = runnerGroupId - self.labels = labels - self.workFolder = workFolder - } - public enum CodingKeys: String, CodingKey { - case name - case runnerGroupId = "runner_group_id" - case labels - case workFolder = "work_folder" - } + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerId = runnerId } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/content/application\/json`. - case json(Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + public var path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/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.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path, - headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers = .init(), - body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Components.Responses.ActionsRunnerJitconfig) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Components.Responses.ActionsRunnerJitconfig { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -16666,7 +20688,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16687,52 +20709,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// 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. @@ -16764,112 +20740,159 @@ public enum Operations { } } } - /// Create a registration token for an organization - /// - /// Returns a token that you can pass to the `config` script. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: + /// Add custom labels to a self-hosted runner for an organization /// - /// ``` - /// ./config.sh --url https://github.com/octo-org --token TOKEN - /// ``` + /// Adds custom labels to a self-hosted runner configured in an organization. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. - public enum ActionsCreateRegistrationTokenForOrg { - public static let id: Swift.String = "actions/create-registration-token-for-org" + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. + public enum ActionsAddCustomLabelsToSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/add-custom-labels-to-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { self.org = org + self.runnerId = runnerId } } - public var path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/header`. + public var path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/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.ActionsCreateRegistrationTokenForOrg.Input.Headers + public var headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The names of the custom labels to add to the runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json/labels`. + public var labels: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - labels: The names of the custom labels to add to the runner. + public init(labels: [Swift.String]) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/content/application\/json`. + case json(Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path, - headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers = .init() + path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.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/runners/registration-token/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content/application\/json`. - case json(Components.Schemas.AuthenticationToken) - /// 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.AuthenticationToken { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body) { - self.body = body - } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/404`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateRegistrationTokenForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/422`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created { + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// 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.ValidationFailedSimple { get throws { switch self { - case let .created(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "unprocessableContent", response: self ) } @@ -16906,112 +20929,160 @@ public enum Operations { } } } - /// Create a remove token for an organization - /// - /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: + /// Set custom labels for a self-hosted runner for an organization /// - /// ``` - /// ./config.sh remove --token TOKEN - /// ``` + /// Remove all previous custom labels and set the new custom labels for a specific + /// self-hosted runner configured in an organization. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. - public enum ActionsCreateRemoveTokenForOrg { - public static let id: Swift.String = "actions/create-remove-token-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. + public enum ActionsSetCustomLabelsForSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/set-custom-labels-for-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { self.org = org + self.runnerId = runnerId } } - public var path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/header`. + public var path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/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.ActionsCreateRemoveTokenForOrg.Input.Headers + public var headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json/labels`. + public var labels: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - labels: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + public init(labels: [Swift.String]) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path, - headers: Operations.ActionsCreateRemoveTokenForOrg.Input.Headers = .init() + path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.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/runners/remove-token/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content/application\/json`. - case json(Components.Schemas.AuthenticationToken) - /// 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.AuthenticationToken { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body) { - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/422`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateRemoveTokenForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateRemoveTokenForOrg.Output.Created { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .created(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "unprocessableContent", response: self ) } @@ -17048,28 +21119,29 @@ public enum Operations { } } } - /// Get a self-hosted runner for an organization + /// Remove all custom labels from a self-hosted runner for an organization /// - /// Gets a specific self-hosted runner configured in an organization. + /// Remove all custom labels from a self-hosted runner configured in an + /// organization. Returns the remaining read-only labels from the runner. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. - public enum ActionsGetSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/get-self-hosted-runner-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. + public enum ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/remove-all-custom-labels-from-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/org`. public var org: Components.Parameters.Org /// Unique identifier of the self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/runner_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/runner_id`. public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// @@ -17084,79 +21156,74 @@ public enum Operations { self.runnerId = runnerId } } - public var path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/header`. + public var path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/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.ActionsGetSelfHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.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/runners/{runner_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.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.Runner { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabelsReadonly) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabelsReadonly { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.ActionsGetSelfHostedRunnerForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -17193,99 +21260,121 @@ public enum Operations { } } } - /// Delete a self-hosted runner from an organization + /// Remove a custom label from a self-hosted runner for an organization /// - /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + /// Remove a custom label from a self-hosted runner configured + /// in an organization. Returns the remaining labels from the runner. + /// + /// This endpoint returns a `404 Not Found` status if the custom label is not + /// present on the runner. /// /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. - public enum ActionsDeleteSelfHostedRunnerFromOrg { - public static let id: Swift.String = "actions/delete-self-hosted-runner-from-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. + public enum ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/remove-custom-label-from-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/org`. public var org: Components.Parameters.Org /// Unique identifier of the self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/runner_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/runner_id`. public var runnerId: Components.Parameters.RunnerId + /// The name of a self-hosted runner's custom label. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/name`. + public var name: Components.Parameters.RunnerLabelName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - runnerId: Unique identifier of the self-hosted runner. + /// - name: The name of a self-hosted runner's custom label. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + runnerId: Components.Parameters.RunnerId, + name: Components.Parameters.RunnerLabelName ) { self.org = org self.runnerId = runnerId + self.name = name } } - public var path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/header`. + public var path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/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.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers + public var headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path, - headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers = .init() + path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.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}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/200`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Resource not found /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { get throws { switch self { - case let .noContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notFound", response: self ) } @@ -17293,7 +21382,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailedSimple) @@ -17345,80 +21434,169 @@ public enum Operations { } } } - /// List labels for a self-hosted runner for an organization + /// List organization secrets /// - /// Lists all labels for a self-hosted runner configured in an organization. + /// Lists all secrets available in an organization without revealing their + /// encrypted values. /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. - public enum ActionsListLabelsForSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/list-labels-for-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. + public enum ActionsListOrgSecrets { + public static let id: Swift.String = "actions/list-org-secrets" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListOrgSecrets.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/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/secrets/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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/secrets/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListOrgSecrets.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/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.ActionsListOrgSecrets.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListOrgSecrets.Input.Path, + query: Operations.ActionsListOrgSecrets.Input.Query = .init(), + headers: Operations.ActionsListOrgSecrets.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/secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/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.ActionsListOrgSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/secrets`. + public var secrets: [Components.Schemas.OrganizationActionsSecret] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - secrets: + public init( + totalCount: Swift.Int, + secrets: [Components.Schemas.OrganizationActionsSecret] + ) { + self.totalCount = totalCount + self.secrets = secrets + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case secrets + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListOrgSecrets.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.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListOrgSecrets.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(), + body: Operations.ActionsListOrgSecrets.Output.Ok.Body ) { - self.org = org - self.runnerId = runnerId - } - } - public var path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/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 + self.headers = headers + self.body = body } } - public var headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) + case ok(Operations.ActionsListOrgSecrets.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: Components.Responses.ActionsRunnerLabels { + public var ok: Operations.ActionsListOrgSecrets.Output.Ok { get throws { switch self { case let .ok(response): @@ -17431,29 +21609,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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. @@ -17485,106 +21640,100 @@ public enum Operations { } } } - /// Add custom labels to a self-hosted runner for an organization + /// Get an organization public key /// - /// Adds custom labels to a self-hosted runner configured in an organization. + /// Gets your public key, which you need to encrypt secrets. You need to + /// encrypt a secret before you can create or update secrets. /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. - public enum ActionsAddCustomLabelsToSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/add-custom-labels-to-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. + public enum ActionsGetOrgPublicKey { + public static let id: Swift.String = "actions/get-org-public-key" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerId = runnerId } } - public var path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/header`. + public var path: Operations.ActionsGetOrgPublicKey.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/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.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of the custom labels to add to the runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json/labels`. - public var labels: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - labels: The names of the custom labels to add to the runner. - public init(labels: [Swift.String]) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/content/application\/json`. - case json(Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + public var headers: Operations.ActionsGetOrgPublicKey.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + path: Operations.ActionsGetOrgPublicKey.Input.Path, + headers: Operations.ActionsGetOrgPublicKey.Input.Headers = .init() ) { 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/secrets/public-key/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsPublicKey) + /// 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.ActionsPublicKey { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) + case ok(Operations.ActionsGetOrgPublicKey.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: Components.Responses.ActionsRunnerLabels { + public var ok: Operations.ActionsGetOrgPublicKey.Output.Ok { get throws { switch self { case let .ok(response): @@ -17597,52 +21746,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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. @@ -17674,107 +21777,108 @@ public enum Operations { } } } - /// Set custom labels for a self-hosted runner for an organization + /// Get an organization secret /// - /// Remove all previous custom labels and set the new custom labels for a specific - /// self-hosted runner configured in an organization. + /// Gets a single organization secret without revealing its encrypted value. /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. - public enum ActionsSetCustomLabelsForSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/set-custom-labels-for-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. + public enum ActionsGetOrgSecret { + public static let id: Swift.String = "actions/get-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. + /// The name of the secret. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/secret_name`. + public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. + /// - secretName: The name of the secret. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + secretName: Components.Parameters.SecretName ) { self.org = org - self.runnerId = runnerId + self.secretName = secretName } } - public var path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/header`. + public var path: Operations.ActionsGetOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/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.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json/labels`. - public var labels: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - labels: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. - public init(labels: [Swift.String]) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + public var headers: Operations.ActionsGetOrgSecret.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + path: Operations.ActionsGetOrgSecret.Input.Path, + headers: Operations.ActionsGetOrgSecret.Input.Headers = .init() ) { 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/secrets/{secret_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationActionsSecret) + /// 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.OrganizationActionsSecret { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgSecret.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) + case ok(Operations.ActionsGetOrgSecret.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: Components.Responses.ActionsRunnerLabels { + public var ok: Operations.ActionsGetOrgSecret.Output.Ok { get throws { switch self { case let .ok(response): @@ -17787,52 +21891,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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. @@ -17864,111 +21922,211 @@ public enum Operations { } } } - /// Remove all custom labels from a self-hosted runner for an organization + /// Create or update an organization secret /// - /// Remove all custom labels from a self-hosted runner configured in an - /// organization. Returns the remaining read-only labels from the runner. + /// Creates or updates an organization 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)." /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. - public enum ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/remove-all-custom-labels-from-self-hosted-runner-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. + public enum ActionsCreateOrUpdateOrgSecret { + public static let id: Swift.String = "actions/create-or-update-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. + /// The name of the secret. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. + /// - secretName: The name of the secret. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + secretName: Components.Parameters.SecretName ) { self.org = org - self.runnerId = runnerId + self.secretName = secretName } } - public var path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/header`. + public var path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/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()) { - self.accept = accept + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// 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 encryptedValue: 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 keyId: 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`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// 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`. + public var visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload + /// 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. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - encryptedValue: 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. + /// - keyId: ID of the key you used to encrypt the secret. + /// - 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. + /// - selectedRepositoryIds: 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( + encryptedValue: Swift.String, + keyId: Swift.String, + visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.encryptedValue = encryptedValue + self.keyId = keyId + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case encryptedValue = "encrypted_value" + case keyId = "key_id" + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path, + headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers = .init(), + body: Operations.ActionsCreateOrUpdateOrgSecret.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/secrets/{secret_name}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) + /// 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.EmptyObject { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body) { + self.body = body } } - public var headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - /// Response + /// Response when creating a secret /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabelsReadonly) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateOrUpdateOrgSecret.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabelsReadonly { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } - /// Resource not found + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response when updating a secret /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent) + /// Response when updating a secret /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsCreateOrUpdateOrgSecret.Output.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } @@ -18005,144 +22163,82 @@ public enum Operations { } } } - /// Remove a custom label from a self-hosted runner for an organization - /// - /// Remove a custom label from a self-hosted runner configured - /// in an organization. Returns the remaining labels from the runner. + /// Delete an organization secret /// - /// This endpoint returns a `404 Not Found` status if the custom label is not - /// present on the runner. + /// Deletes a secret in an organization using the secret name. /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. - public enum ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/remove-custom-label-from-self-hosted-runner-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. + public enum ActionsDeleteOrgSecret { + public static let id: Swift.String = "actions/delete-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId - /// The name of a self-hosted runner's custom label. + /// The name of the secret. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/name`. - public var name: Components.Parameters.RunnerLabelName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/secret_name`. + public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - /// - name: The name of a self-hosted runner's custom label. + /// - secretName: The name of the secret. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId, - name: Components.Parameters.RunnerLabelName + secretName: Components.Parameters.SecretName ) { self.org = org - self.runnerId = runnerId - self.name = name - } - } - public var path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{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 + self.secretName = secretName } } - public var headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers + public var path: Operations.ActionsDeleteOrgSecret.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers = .init() - ) { + public init(path: Operations.ActionsDeleteOrgSecret.Input.Path) { 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}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabels { - 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}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/404`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteOrgSecret.Output.NoContent) + /// Response /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteOrgSecret.Output.NoContent { get throws { switch self { - case let .unprocessableContent(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "noContent", response: self ) } @@ -18153,97 +22249,81 @@ 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 organization secrets + /// List selected repositories for an organization secret /// - /// Lists all secrets available in an organization without revealing their - /// encrypted values. + /// Lists all repositories that have been selected when the `visibility` + /// for repository access to a secret is set to `selected`. /// /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. - public enum ActionsListOrgSecrets { - public static let id: Swift.String = "actions/list-org-secrets" + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. + public enum ActionsListSelectedReposForOrgSecret { + public static let id: Swift.String = "actions/list-selected-repos-for-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/org`. public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/secret_name`. + public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { self.org = org + self.secretName = secretName } } - public var path: Operations.ActionsListOrgSecrets.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query`. + public var path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? /// 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/secrets/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/page`. public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? /// Creates a new `Query`. /// /// - Parameters: - /// - perPage: 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)." + /// - perPage: 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( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.perPage = perPage self.page = page + self.perPage = perPage } } - public var query: Operations.ActionsListOrgSecrets.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/header`. + public var query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/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.ActionsListOrgSecrets.Input.Headers + public var headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -18251,9 +22331,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListOrgSecrets.Input.Path, - query: Operations.ActionsListOrgSecrets.Input.Query = .init(), - headers: Operations.ActionsListOrgSecrets.Input.Headers = .init() + path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path, + query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query = .init(), + headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers = .init() ) { self.path = path self.query = query @@ -18262,52 +22342,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/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.ActionsListOrgSecrets.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/secrets`. - public var secrets: [Components.Schemas.OrganizationActionsSecret] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - secrets: + /// - repositories: public init( totalCount: Swift.Int, - secrets: [Components.Schemas.OrganizationActionsSecret] + repositories: [Components.Schemas.MinimalRepository] ) { self.totalCount = totalCount - self.secrets = secrets + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case secrets + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedReposForOrgSecret.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.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -18317,31 +22383,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListOrgSecrets.Output.Ok.Body + public var body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(), - body: Operations.ActionsListOrgSecrets.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListOrgSecrets.Output.Ok) + case ok(Operations.ActionsListSelectedReposForOrgSecret.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.ActionsListOrgSecrets.Output.Ok { + public var ok: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok { get throws { switch self { case let .ok(response): @@ -18385,107 +22446,241 @@ public enum Operations { } } } - /// Get an organization public key + /// Set selected repositories for an organization secret /// - /// Gets your public key, which you need to encrypt secrets. You need to - /// encrypt a secret before you can create or update secrets. + /// Replaces all repositories for an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. - public enum ActionsGetOrgPublicKey { - public static let id: Swift.String = "actions/get-org-public-key" + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. + public enum ActionsSetSelectedReposForOrgSecret { + public static let id: Swift.String = "actions/set-selected-repos-for-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/org`. public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { self.org = org + self.secretName = secretName } } - public var path: Operations.ActionsGetOrgPublicKey.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + public var path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-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. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-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(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedReposForOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path, + body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelectedReposForOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add selected repository to an organization secret + /// + /// Adds a repository to an organization secret when the `visibility` for + /// repository access is set to `selected`. For more information about setting the visibility, see [Create or + /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. + public enum ActionsAddSelectedRepoToOrgSecret { + public static let id: Swift.String = "actions/add-selected-repo-to-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName, + repositoryId: Swift.Int + ) { + self.org = org + self.secretName = secretName + self.repositoryId = repositoryId } } - public var headers: Operations.ActionsGetOrgPublicKey.Input.Headers + public var path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsGetOrgPublicKey.Input.Path, - headers: Operations.ActionsGetOrgPublicKey.Input.Headers = .init() - ) { + public init(path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsPublicKey) - /// 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.ActionsPublicKey { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No Content when repository was added to the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent) + /// No Content when repository was added to the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsAddSelectedRepoToOrgSecret.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.ActionsGetOrgPublicKey.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body) { - self.body = body - } } - /// Response + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Conflict when visibility type is not set to selected /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgPublicKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict) + /// Conflict when visibility type is not set to selected /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgPublicKey.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", response: self ) } @@ -18496,141 +22691,125 @@ 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 - ] - } - } } - /// Get an organization secret + /// Remove selected repository from an organization secret /// - /// Gets a single organization secret without revealing its encrypted value. + /// Removes a repository from an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. - public enum ActionsGetOrgSecret { - public static let id: Swift.String = "actions/get-org-secret" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. + public enum ActionsRemoveSelectedRepoFromOrgSecret { + public static let id: Swift.String = "actions/remove-selected-repo-from-org-secret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org /// The name of the secret. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/secret_name`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/secret_name`. public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - secretName: The name of the secret. + /// - repositoryId: public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + secretName: Components.Parameters.SecretName, + repositoryId: Swift.Int ) { self.org = org self.secretName = secretName + self.repositoryId = repositoryId } } - public var path: Operations.ActionsGetOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{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.ActionsGetOrgSecret.Input.Headers + public var path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsGetOrgSecret.Input.Path, - headers: Operations.ActionsGetOrgSecret.Input.Headers = .init() - ) { + public init(path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationActionsSecret) - /// 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.OrganizationActionsSecret { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response when repository was removed from the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent) + /// Response when repository was removed from the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsRemoveSelectedRepoFromOrgSecret.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.ActionsGetOrgSecret.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgSecret.Output.Ok.Body) { - self.body = body - } } - /// Response + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Conflict when visibility type not set to selected /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgSecret.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict) + /// Conflict when visibility type not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgSecret.Output.Ok { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", response: self ) } @@ -18641,237 +22820,176 @@ 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 - ] - } - } } - /// Create or update an organization secret + /// List organization variables /// - /// Creates or updates an organization 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)." + /// Lists all organization variables. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. - public enum ActionsCreateOrUpdateOrgSecret { - public static let id: Swift.String = "actions/create-or-update-org-secret" + /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. + public enum ActionsListOrgVariables { + public static let id: Swift.String = "actions/list-org-variables" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListOrgVariables.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 30). 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/variables/GET/query/per_page`. + public var perPage: Components.Parameters.VariablesPerPage? + /// 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/variables/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 30). 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, - secretName: Components.Parameters.SecretName + perPage: Components.Parameters.VariablesPerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.secretName = secretName + self.perPage = perPage + self.page = page } } - public var path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/header`. + public var query: Operations.ActionsListOrgVariables.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/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.ActionsCreateOrUpdateOrgSecret.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// 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 encryptedValue: 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 keyId: 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`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// 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`. - public var visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload - /// 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. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - encryptedValue: 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. - /// - keyId: ID of the key you used to encrypt the secret. - /// - 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. - /// - selectedRepositoryIds: 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( - encryptedValue: Swift.String, - keyId: Swift.String, - visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.encryptedValue = encryptedValue - self.keyId = keyId - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case encryptedValue = "encrypted_value" - case keyId = "key_id" - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload) - } - public var body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body + public var headers: Operations.ActionsListOrgVariables.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path, - headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers = .init(), - body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body + path: Operations.ActionsListOrgVariables.Input.Path, + query: Operations.ActionsListOrgVariables.Input.Query = .init(), + headers: Operations.ActionsListOrgVariables.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) - /// The associated value of the enum case if `self` is `.json`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.EmptyObject { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } - /// Received HTTP response body - public var body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body) { - self.body = body - } - } - /// Response when creating a secret - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateOrUpdateOrgSecret.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.ActionsCreateOrUpdateOrgSecret.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) + /// Received HTTP response headers + public var headers: Operations.ActionsListOrgVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/variables`. + public var variables: [Components.Schemas.OrganizationActionsVariable] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - variables: + public init( + totalCount: Swift.Int, + variables: [Components.Schemas.OrganizationActionsVariable] + ) { + self.totalCount = totalCount + self.variables = variables + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case variables + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListOrgVariables.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.ActionsListOrgVariables.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ActionsListOrgVariables.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(), + body: Operations.ActionsListOrgVariables.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response when updating a secret - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent) - /// Response when updating a secret + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListOrgVariables.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.ActionsCreateOrUpdateOrgSecret.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListOrgVariables.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 ) } @@ -18908,217 +23026,130 @@ public enum Operations { } } } - /// Delete an organization secret + /// Create an organization variable /// - /// Deletes a secret in an organization using the secret name. + /// Creates an organization variable that you can reference in a GitHub Actions workflow. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. - public enum ActionsDeleteOrgSecret { - public static let id: Swift.String = "actions/delete-org-secret" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The name of the secret. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/secret_name`. - public var secretName: Components.Parameters.SecretName - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - public init( - org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName - ) { - self.org = org - self.secretName = secretName - } - } - public var path: Operations.ActionsDeleteOrgSecret.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsDeleteOrgSecret.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteOrgSecret.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ActionsDeleteOrgSecret.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List selected repositories for an organization secret - /// - /// Lists all repositories that have been selected when the `visibility` - /// for repository access to a secret is set to `selected`. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. - public enum ActionsListSelectedReposForOrgSecret { - public static let id: Swift.String = "actions/list-selected-repos-for-org-secret" + /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. + public enum ActionsCreateOrgVariable { + public static let id: Swift.String = "actions/create-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/secret_name`. - public var secretName: Components.Parameters.SecretName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - public init( - org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.secretName = secretName - } - } - public var path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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)." - /// - perPage: 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, - perPage: Components.Parameters.PerPage? = nil - ) { - self.page = page - self.perPage = perPage } } - public var query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/header`. + public var path: Operations.ActionsCreateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/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.ActionsListSelectedReposForOrgSecret.Input.Headers + public var headers: Operations.ActionsCreateOrgVariable.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/value`. + public var value: Swift.String + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. + public var visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload + /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + public init( + name: Swift.String, + value: Swift.String, + visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.name = name + self.value = value + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case name + case value + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/content/application\/json`. + case json(Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateOrgVariable.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path, - query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query = .init(), - headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers = .init() + path: Operations.ActionsCreateOrgVariable.Input.Path, + headers: Operations.ActionsCreateOrgVariable.Input.Headers = .init(), + body: Operations.ActionsCreateOrgVariable.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Int, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) /// 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.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.EmptyObject { get throws { switch self { case let .json(body): @@ -19128,33 +23159,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsCreateOrgVariable.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body) { + public init(body: Operations.ActionsCreateOrgVariable.Output.Created.Body) { self.body = body } } - /// Response + /// Response when creating a variable /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateOrgVariable.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateOrgVariable.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -19191,112 +23222,115 @@ public enum Operations { } } } - /// Set selected repositories for an organization secret + /// Get an organization variable /// - /// Replaces all repositories for an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Gets a specific variable in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// The authenticated user must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. - public enum ActionsSetSelectedReposForOrgSecret { - public static let id: Swift.String = "actions/set-selected-repos-for-org-secret" + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. + public enum ActionsGetOrgVariable { + public static let id: Swift.String = "actions/get-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// The name of the variable. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/name`. + public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - name: The name of the variable. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + name: Components.Parameters.VariableName ) { self.org = org - self.secretName = secretName + self.name = name } } - public var path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-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. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-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(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } + public var path: Operations.ActionsGetOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{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 } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedReposForOrgSecret.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + public var headers: Operations.ActionsGetOrgVariable.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path, - body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + path: Operations.ActionsGetOrgVariable.Input.Path, + headers: Operations.ActionsGetOrgVariable.Input.Headers = .init() ) { self.path = path - self.body = body + 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}/actions/variables/{name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationActionsVariable) + /// 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.OrganizationActionsVariable { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgVariable.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetOrgVariable.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.ActionsSetSelectedReposForOrgSecret.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetOrgVariable.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 ) } @@ -19307,57 +23341,137 @@ 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 + ] + } + } } - /// Add selected repository to an organization secret + /// Update an organization variable /// - /// Adds a repository to an organization secret when the `visibility` for - /// repository access is set to `selected`. For more information about setting the visibility, see [Create or - /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Updates an organization variable that you can reference in a GitHub Actions workflow. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. - public enum ActionsAddSelectedRepoToOrgSecret { - public static let id: Swift.String = "actions/add-selected-repo-to-org-secret" + /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. + public enum ActionsUpdateOrgVariable { + public static let id: Swift.String = "actions/update-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// The name of the variable. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/name`. + public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - /// - repositoryId: + /// - name: The name of the variable. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName, - repositoryId: Swift.Int + name: Components.Parameters.VariableName ) { self.org = org - self.secretName = secretName - self.repositoryId = repositoryId + self.name = name } } - public var path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path + public var path: Operations.ActionsUpdateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/value`. + public var value: Swift.String? + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? + /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + public init( + name: Swift.String? = nil, + value: Swift.String? = nil, + visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? = nil, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.name = name + self.value = value + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case name + case value + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.ActionsUpdateOrgVariable.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path) { + /// - body: + public init( + path: Operations.ActionsUpdateOrgVariable.Input.Path, + body: Operations.ActionsUpdateOrgVariable.Input.Body + ) { self.path = path + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -19365,15 +23479,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// No Content when repository was added to the selected list + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent) - /// No Content when repository was added to the selected list + case noContent(Operations.ActionsUpdateOrgVariable.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -19383,7 +23497,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsUpdateOrgVariable.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -19396,96 +23510,54 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Conflict when visibility type is not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict) - /// Conflict when visibility type is not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsAddSelectedRepoToOrgSecret.Output.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) } } - /// Remove selected repository from an organization secret + /// Delete an organization variable /// - /// Removes a repository from an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Deletes an organization variable using the variable name. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. - public enum ActionsRemoveSelectedRepoFromOrgSecret { - public static let id: Swift.String = "actions/remove-selected-repo-from-org-secret" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. + public enum ActionsDeleteOrgVariable { + public static let id: Swift.String = "actions/delete-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// The name of the variable. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/secret_name`. - public var secretName: Components.Parameters.SecretName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/name`. + public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - /// - repositoryId: + /// - name: The name of the variable. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName, - repositoryId: Swift.Int + name: Components.Parameters.VariableName ) { self.org = org - self.secretName = secretName - self.repositoryId = repositoryId + self.name = name } } - public var path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path + public var path: Operations.ActionsDeleteOrgVariable.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path) { + public init(path: Operations.ActionsDeleteOrgVariable.Input.Path) { self.path = path } } @@ -19494,15 +23566,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response when repository was removed from the selected list + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent) - /// Response when repository was removed from the selected list + case noContent(Operations.ActionsDeleteOrgVariable.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -19512,7 +23584,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsDeleteOrgVariable.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -19525,111 +23597,86 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Conflict when visibility type not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict) - /// Conflict when visibility type not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.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) } } - /// List organization variables + /// List selected repositories for an organization variable /// - /// Lists all organization variables. + /// Lists all repositories that can access an organization variable + /// that is available to selected repositories. /// /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. - public enum ActionsListOrgVariables { - public static let id: Swift.String = "actions/list-org-variables" + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. + public enum ActionsListSelectedReposForOrgVariable { + public static let id: Swift.String = "actions/list-selected-repos-for-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/org`. public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/name`. + public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { self.org = org + self.name = name } } - public var path: Operations.ActionsListOrgVariables.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 30). 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/variables/GET/query/per_page`. - public var perPage: Components.Parameters.VariablesPerPage? + public var path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query`. + public struct Query: Sendable, Hashable { /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/page`. public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? /// Creates a new `Query`. /// /// - Parameters: - /// - perPage: The number of results per page (max 30). 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)." + /// - perPage: 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( - perPage: Components.Parameters.VariablesPerPage? = nil, - page: Components.Parameters.Page? = nil + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.perPage = perPage self.page = page + self.perPage = perPage } } - public var query: Operations.ActionsListOrgVariables.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/header`. + public var query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/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.ActionsListOrgVariables.Input.Headers + public var headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -19637,9 +23684,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListOrgVariables.Input.Path, - query: Operations.ActionsListOrgVariables.Input.Query = .init(), - headers: Operations.ActionsListOrgVariables.Input.Headers = .init() + path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path, + query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query = .init(), + headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers = .init() ) { self.path = path self.query = query @@ -19648,52 +23695,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/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.ActionsListOrgVariables.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/variables`. - public var variables: [Components.Schemas.OrganizationActionsVariable] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - variables: + /// - repositories: public init( totalCount: Swift.Int, - variables: [Components.Schemas.OrganizationActionsVariable] + repositories: [Components.Schemas.MinimalRepository] ) { self.totalCount = totalCount - self.variables = variables + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case variables + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedReposForOrgVariable.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.ActionsListOrgVariables.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -19703,31 +23736,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListOrgVariables.Output.Ok.Body + public var body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(), - body: Operations.ActionsListOrgVariables.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListOrgVariables.Output.Ok) + case ok(Operations.ActionsListSelectedReposForOrgVariable.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.ActionsListOrgVariables.Output.Ok { + public var ok: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok { get throws { switch self { case let .ok(response): @@ -19740,197 +23768,36 @@ public enum Operations { } } } - /// 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 variable - /// - /// Creates an organization variable that you can reference in a GitHub Actions workflow. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. - /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. - public enum ActionsCreateOrgVariable { - public static let id: Swift.String = "actions/create-org-variable" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/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.ActionsCreateOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/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.ActionsCreateOrgVariable.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/name`. - public var name: Swift.String - /// The value of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/value`. - public var value: Swift.String - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. - public var visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload - /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the variable. - /// - value: The value of the variable. - /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - public init( - name: Swift.String, - value: Swift.String, - visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.name = name - self.value = value - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case name - case value - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/content/application\/json`. - case json(Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload) - } - public var body: Operations.ActionsCreateOrgVariable.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ActionsCreateOrgVariable.Input.Path, - headers: Operations.ActionsCreateOrgVariable.Input.Headers = .init(), - body: Operations.ActionsCreateOrgVariable.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/variables/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) - /// 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.EmptyObject { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsCreateOrgVariable.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateOrgVariable.Output.Created.Body) { - self.body = body - } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} } - /// Response when creating a variable + /// Response when the visibility of the variable is not set to `selected` /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateOrgVariable.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateOrgVariable.Output.Created { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict { get throws { switch self { - case let .created(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "conflict", response: self ) } @@ -19967,28 +23834,30 @@ public enum Operations { } } } - /// Get an organization variable + /// Set selected repositories for an organization variable /// - /// Gets a specific variable in an organization. + /// Replaces all repositories for an organization variable that is available + /// to selected repositories. Organization variables that are available to selected + /// repositories have their `visibility` field set to `selected`. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. - public enum ActionsGetOrgVariable { - public static let id: Swift.String = "actions/get-org-variable" + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. + public enum ActionsSetSelectedReposForOrgVariable { + public static let id: Swift.String = "actions/set-selected-repos-for-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// The name of the variable. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/name`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/name`. public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// @@ -20003,79 +23872,237 @@ public enum Operations { self.name = name } } - public var path: Operations.ActionsGetOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{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 path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The IDs of the repositories that can access the organization variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: The IDs of the repositories that can access the organization variable. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedReposForOrgVariable.Input.Body.JsonPayload) } - public var headers: Operations.ActionsGetOrgVariable.Input.Headers + public var body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.ActionsGetOrgVariable.Input.Path, - headers: Operations.ActionsGetOrgVariable.Input.Headers = .init() + path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path, + body: Operations.ActionsSetSelectedReposForOrgVariable.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/variables/{name}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationActionsVariable) - /// 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.OrganizationActionsVariable { - 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}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetSelectedReposForOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsSetSelectedReposForOrgVariable.Output.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) + } + } + /// Add selected repository to an organization variable + /// + /// Adds a repository to an organization variable that is available to selected repositories. + /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. + public enum ActionsAddSelectedRepoToOrgVariable { + public static let id: Swift.String = "actions/add-selected-repo-to-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/name`. + public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName, + repositoryId: Swift.Int + ) { + self.org = org + self.name = name + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsAddSelectedRepoToOrgVariable.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.ActionsGetOrgVariable.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgVariable.Output.Ok.Body) { - self.body = body - } } - /// Response + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgVariable.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgVariable.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict { get throws { switch self { - case let .ok(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "conflict", response: self ) } @@ -20086,137 +24113,57 @@ 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 - ] - } - } } - /// Update an organization variable + /// Remove selected repository from an organization variable /// - /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// Removes a repository from an organization variable that is + /// available to selected repositories. Organization variables that are available to + /// selected repositories have their `visibility` field set to `selected`. /// /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. - public enum ActionsUpdateOrgVariable { - public static let id: Swift.String = "actions/update-org-variable" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. + public enum ActionsRemoveSelectedRepoFromOrgVariable { + public static let id: Swift.String = "actions/remove-selected-repo-from-org-variable" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org /// The name of the variable. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/name`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/name`. public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - name: The name of the variable. + /// - repositoryId: public init( org: Components.Parameters.Org, - name: Components.Parameters.VariableName + name: Components.Parameters.VariableName, + repositoryId: Swift.Int ) { self.org = org self.name = name + self.repositoryId = repositoryId } } - public var path: Operations.ActionsUpdateOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// The value of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/value`. - public var value: Swift.String? - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. - public var visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? - /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the variable. - /// - value: The value of the variable. - /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - public init( - name: Swift.String? = nil, - value: Swift.String? = nil, - visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? = nil, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.name = name - self.value = value - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case name - case value - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload) - } - public var body: Operations.ActionsUpdateOrgVariable.Input.Body + public var path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: - public init( - path: Operations.ActionsUpdateOrgVariable.Input.Path, - body: Operations.ActionsUpdateOrgVariable.Input.Body - ) { + public init(path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path) { self.path = path - self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -20226,13 +24173,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsUpdateOrgVariable.Output.NoContent) + case noContent(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -20242,7 +24189,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsUpdateOrgVariable.Output.NoContent { + public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -20255,88 +24202,232 @@ public enum Operations { } } } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.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) } } - /// Delete an organization variable + /// List artifacts for a repository /// - /// Deletes an organization variable using the variable name. + /// Lists all artifacts for a repository. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth 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 with a private repository. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. - public enum ActionsDeleteOrgVariable { - public static let id: Swift.String = "actions/delete-org-variable" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. + public enum ActionsListArtifactsForRepo { + public static let id: Swift.String = "actions/list-artifacts-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/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}/actions/artifacts/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// 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. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsListArtifactsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/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/variables/{name}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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/variables/{name}/DELETE/path/name`. - public var name: Components.Parameters.VariableName - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/page`. + public var page: Components.Parameters.Page? + /// The name field of an artifact. When specified, only artifacts with this name will be returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/name`. + public var name: Components.Parameters.ArtifactName? + /// Creates a new `Query`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. + /// - perPage: 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)." + /// - name: The name field of an artifact. When specified, only artifacts with this name will be returned. public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + name: Components.Parameters.ArtifactName? = nil ) { - self.org = org + self.perPage = perPage + self.page = page self.name = name } } - public var path: Operations.ActionsDeleteOrgVariable.Input.Path + public var query: Operations.ActionsListArtifactsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/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.ActionsListArtifactsForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteOrgVariable.Input.Path) { + /// - query: + /// - headers: + public init( + path: Operations.ActionsListArtifactsForRepo.Input.Path, + query: Operations.ActionsListArtifactsForRepo.Input.Query = .init(), + headers: Operations.ActionsListArtifactsForRepo.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}/actions/artifacts/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/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.ActionsListArtifactsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/artifacts`. + public var artifacts: [Components.Schemas.Artifact] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - artifacts: + public init( + totalCount: Swift.Int, + artifacts: [Components.Schemas.Artifact] + ) { + self.totalCount = totalCount + self.artifacts = artifacts + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case artifacts + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListArtifactsForRepo.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.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(), + body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteOrgVariable.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListArtifactsForRepo.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.ActionsDeleteOrgVariable.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListArtifactsForRepo.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 ) } @@ -20347,131 +24438,112 @@ 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 selected repositories for an organization variable + /// Get an artifact /// - /// Lists all repositories that can access an organization variable - /// that is available to selected repositories. + /// Gets a specific artifact for a workflow run. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. - public enum ActionsListSelectedReposForOrgVariable { - public static let id: Swift.String = "actions/list-selected-repos-for-org-variable" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. + public enum ActionsGetArtifact { + public static let id: Swift.String = "actions/get-artifact" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/name`. - public var name: Components.Parameters.VariableName - /// Creates a new `Path`. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName - ) { - self.org = org - self.name = name - } - } - public var path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_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/orgs/{org}/actions/variables/{name}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId + /// Creates a new `Path`. /// /// - 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)." - /// - perPage: 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)." + /// - 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. + /// - artifactId: The unique identifier of the artifact. public init( - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId ) { - self.page = page - self.perPage = perPage + self.owner = owner + self.repo = repo + self.artifactId = artifactId } } - public var query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/header`. + public var path: Operations.ActionsGetArtifact.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_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.ActionsListSelectedReposForOrgVariable.Input.Headers + public var headers: Operations.ActionsGetArtifact.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path, - query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query = .init(), - headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers = .init() + path: Operations.ActionsGetArtifact.Input.Path, + headers: Operations.ActionsGetArtifact.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/variables/{name}/repositories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Int, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Artifact) /// 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.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.Artifact { get throws { switch self { case let .json(body): @@ -20481,26 +24553,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + public var body: Operations.ActionsGetArtifact.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body) { + public init(body: Operations.ActionsGetArtifact.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok) + case ok(Operations.ActionsGetArtifact.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.ActionsListSelectedReposForOrgVariable.Output.Ok { + public var ok: Operations.ActionsGetArtifact.Output.Ok { get throws { switch self { case let .ok(response): @@ -20513,41 +24585,6 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsListSelectedReposForOrgVariable.Output.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. @@ -20579,79 +24616,53 @@ public enum Operations { } } } - /// Set selected repositories for an organization variable - /// - /// Replaces all repositories for an organization variable that is available - /// to selected repositories. Organization variables that are available to selected - /// repositories have their `visibility` field set to `selected`. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Delete an artifact /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// Deletes an artifact for a workflow run. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. - public enum ActionsSetSelectedReposForOrgVariable { - public static let id: Swift.String = "actions/set-selected-repos-for-org-variable" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. + public enum ActionsDeleteArtifact { + public static let id: Swift.String = "actions/delete-artifact" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_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/orgs/{org}/actions/variables/{name}/repositories/PUT/path/name`. - public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. + /// - 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. + /// - artifactId: The unique identifier of the artifact. public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId ) { - self.org = org - self.name = name - } - } - public var path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The IDs of the repositories that can access the organization variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: The IDs of the repositories that can access the organization variable. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } + self.owner = owner + self.repo = repo + self.artifactId = artifactId } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedReposForOrgVariable.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body + public var path: Operations.ActionsDeleteArtifact.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: - public init( - path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path, - body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body - ) { + public init(path: Operations.ActionsDeleteArtifact.Input.Path) { self.path = path - self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -20661,13 +24672,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent) + case noContent(Operations.ActionsDeleteArtifact.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -20677,7 +24688,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent { + public var noContent: Operations.ActionsDeleteArtifact.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -20690,164 +24701,150 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsSetSelectedReposForOrgVariable.Output.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) } } - /// Add selected repository to an organization variable - /// - /// Adds a repository to an organization variable that is available to selected repositories. - /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// Download an artifact /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + /// the response header to find the URL for the download. The `:archive_format` must be `zip`. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. - public enum ActionsAddSelectedRepoToOrgVariable { - public static let id: Swift.String = "actions/add-selected-repo-to-org-variable" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. + public enum ActionsDownloadArtifact { + public static let id: Swift.String = "actions/download-artifact" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/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/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/name`. - public var name: Components.Parameters.VariableName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/archive_format`. + public var archiveFormat: Swift.String /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - /// - repositoryId: + /// - 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. + /// - artifactId: The unique identifier of the artifact. + /// - archiveFormat: public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName, - repositoryId: Swift.Int + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId, + archiveFormat: Swift.String ) { - self.org = org - self.name = name - self.repositoryId = repositoryId + self.owner = owner + self.repo = repo + self.artifactId = artifactId + self.archiveFormat = archiveFormat } } - public var path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path + public var path: Operations.ActionsDownloadArtifact.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/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.ActionsDownloadArtifact.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsDownloadArtifact.Input.Path, + headers: Operations.ActionsDownloadArtifact.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 Found: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers/Location`. + public var location: Components.Headers.Location? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Components.Headers.Location? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsDownloadArtifact.Output.Found.Headers + /// Creates a new `Found`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + public init(headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init()) { + self.headers = headers + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/302`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `302 found`. + case found(Operations.ActionsDownloadArtifact.Output.Found) + /// The associated value of the enum case if `self` is `.found`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent { + /// - Throws: An error if `self` is not `.found`. + /// - SeeAlso: `.found`. + public var found: Operations.ActionsDownloadArtifact.Output.Found { get throws { switch self { - case let .noContent(response): + case let .found(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "found", response: self ) } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` + /// Gone /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/410`. /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .conflict(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "gone", response: self ) } @@ -20858,125 +24855,142 @@ 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 + ] + } + } } - /// Remove selected repository from an organization variable + /// Get GitHub Actions cache usage for a repository /// - /// Removes a repository from an organization variable that is - /// available to selected repositories. Organization variables that are available to - /// selected repositories have their `visibility` field set to `selected`. + /// Gets GitHub Actions cache usage for a repository. + /// 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. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Anyone with read access to the repository can use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. - public enum ActionsRemoveSelectedRepoFromOrgVariable { - public static let id: Swift.String = "actions/remove-selected-repo-from-org-variable" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. + public enum ActionsGetActionsCacheUsage { + public static let id: Swift.String = "actions/get-actions-cache-usage" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/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/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/name`. - public var name: Components.Parameters.VariableName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path/repo`. + public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - /// - repositoryId: + /// - 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. public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName, - repositoryId: Swift.Int + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { - self.org = org - self.name = name - self.repositoryId = repositoryId + self.owner = owner + self.repo = repo } } - public var path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path + public var path: Operations.ActionsGetActionsCacheUsage.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.ActionsGetActionsCacheUsage.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + /// - headers: + public init( + path: Operations.ActionsGetActionsCacheUsage.Input.Path, + headers: Operations.ActionsGetActionsCacheUsage.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}/actions/cache/usage/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheUsageByRepository) + /// 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.ActionsCacheUsageByRepository { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body) { + self.body = body + } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)/responses/200`. /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheUsage.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetActionsCacheUsage.Output.Ok { get throws { switch self { - case let .conflict(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "ok", response: self ) } @@ -20987,29 +25001,52 @@ 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 artifacts for a repository - /// - /// Lists all artifacts for a repository. + /// List GitHub Actions caches for a repository /// - /// Anyone with read access to the repository can use this endpoint. + /// Lists the GitHub Actions caches for a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. - public enum ActionsListArtifactsForRepo { - public static let id: Swift.String = "actions/list-artifacts-for-repo" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. + public enum ActionsGetActionsCacheList { + public static let id: Swift.String = "actions/get-actions-cache-list" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/artifacts/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/artifacts/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -21024,50 +25061,82 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsListArtifactsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query`. + public var path: Operations.ActionsGetActionsCacheList.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/artifacts/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// 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}/actions/artifacts/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/page`. public var page: Components.Parameters.Page? - /// The name field of an artifact. When specified, only artifacts with this name will be returned. + /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/name`. - public var name: Components.Parameters.ArtifactName? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/ref`. + public var ref: Components.Parameters.ActionsCacheGitRefFull? + /// An explicit key or prefix for identifying the cache + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/key`. + public var key: Components.Parameters.ActionsCacheKey? + /// - Remark: Generated from `#/components/parameters/actions-cache-list-sort`. + @frozen public enum ActionsCacheListSort: String, Codable, Hashable, Sendable, CaseIterable { + case createdAt = "created_at" + case lastAccessedAt = "last_accessed_at" + case sizeInBytes = "size_in_bytes" + } + /// The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/sort`. + public var sort: Components.Parameters.ActionsCacheListSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/direction`. + public var direction: Components.Parameters.Direction? /// Creates a new `Query`. /// /// - Parameters: /// - perPage: 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)." - /// - name: The name field of an artifact. When specified, only artifacts with this name will be returned. + /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// - key: An explicit key or prefix for identifying the cache + /// - sort: The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + /// - direction: The direction to sort the results by. public init( perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - name: Components.Parameters.ArtifactName? = nil + ref: Components.Parameters.ActionsCacheGitRefFull? = nil, + key: Components.Parameters.ActionsCacheKey? = nil, + sort: Components.Parameters.ActionsCacheListSort? = nil, + direction: Components.Parameters.Direction? = nil ) { self.perPage = perPage self.page = page - self.name = name + self.ref = ref + self.key = key + self.sort = sort + self.direction = direction } } - public var query: Operations.ActionsListArtifactsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/header`. + public var query: Operations.ActionsGetActionsCacheList.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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.ActionsListArtifactsForRepo.Input.Headers + public var headers: Operations.ActionsGetActionsCacheList.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -21075,9 +25144,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListArtifactsForRepo.Input.Path, - query: Operations.ActionsListArtifactsForRepo.Input.Query = .init(), - headers: Operations.ActionsListArtifactsForRepo.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheList.Input.Path, + query: Operations.ActionsGetActionsCacheList.Input.Query = .init(), + headers: Operations.ActionsGetActionsCacheList.Input.Headers = .init() ) { self.path = path self.query = query @@ -21086,9 +25155,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -21099,39 +25168,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content`. + public var headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/artifacts`. - public var artifacts: [Components.Schemas.Artifact] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - artifacts: - public init( - totalCount: Swift.Int, - artifacts: [Components.Schemas.Artifact] - ) { - self.totalCount = totalCount - self.artifacts = artifacts - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case artifacts - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheList) /// 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.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsCacheList { get throws { switch self { case let .json(body): @@ -21141,15 +25187,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + public var body: Operations.ActionsGetActionsCacheList.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(), - body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(), + body: Operations.ActionsGetActionsCacheList.Output.Ok.Body ) { self.headers = headers self.body = body @@ -21157,15 +25203,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListArtifactsForRepo.Output.Ok) + case ok(Operations.ActionsGetActionsCacheList.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.ActionsListArtifactsForRepo.Output.Ok { + public var ok: Operations.ActionsGetActionsCacheList.Output.Ok { get throws { switch self { case let .ok(response): @@ -21209,86 +25255,104 @@ public enum Operations { } } } - /// Get an artifact - /// - /// Gets a specific artifact for a workflow run. + /// Delete GitHub Actions caches for a repository (using a cache key) /// - /// Anyone with read access to the repository can use this endpoint. + /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. - public enum ActionsGetArtifact { - public static let id: Swift.String = "actions/get-artifact" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. + public enum ActionsDeleteActionsCacheByKey { + public static let id: Swift.String = "actions/delete-actions-cache-by-key" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/artifacts/{artifact_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/artifacts/{artifact_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId /// 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. - /// - artifactId: The unique identifier of the artifact. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.artifactId = artifactId } } - public var path: Operations.ActionsGetArtifact.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/header`. + public var path: Operations.ActionsDeleteActionsCacheByKey.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query`. + public struct Query: Sendable, Hashable { + /// A key for identifying the cache. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/key`. + public var key: Components.Parameters.ActionsCacheKeyRequired + /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/ref`. + public var ref: Components.Parameters.ActionsCacheGitRefFull? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - key: A key for identifying the cache. + /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + public init( + key: Components.Parameters.ActionsCacheKeyRequired, + ref: Components.Parameters.ActionsCacheGitRefFull? = nil + ) { + self.key = key + self.ref = ref + } + } + public var query: Operations.ActionsDeleteActionsCacheByKey.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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.ActionsGetArtifact.Input.Headers + public var headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetArtifact.Input.Path, - headers: Operations.ActionsGetArtifact.Input.Headers = .init() + path: Operations.ActionsDeleteActionsCacheByKey.Input.Path, + query: Operations.ActionsDeleteActionsCacheByKey.Input.Query, + headers: Operations.ActionsDeleteActionsCacheByKey.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/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Artifact) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheList) /// 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.Artifact { + public var json: Components.Schemas.ActionsCacheList { get throws { switch self { case let .json(body): @@ -21298,26 +25362,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetArtifact.Output.Ok.Body + public var body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetArtifact.Output.Ok.Body) { + public init(body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetArtifact.Output.Ok) + case ok(Operations.ActionsDeleteActionsCacheByKey.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.ActionsGetArtifact.Output.Ok { + public var ok: Operations.ActionsDeleteActionsCacheByKey.Output.Ok { get throws { switch self { case let .ok(response): @@ -21361,52 +25425,53 @@ public enum Operations { } } } - /// Delete an artifact + /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// + /// Deletes a GitHub Actions cache for a repository, using a cache ID. /// - /// Deletes an artifact for a workflow run. /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. - public enum ActionsDeleteArtifact { - public static let id: Swift.String = "actions/delete-artifact" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. + public enum ActionsDeleteActionsCacheById { + public static let id: Swift.String = "actions/delete-actions-cache-by-id" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_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}/actions/artifacts/{artifact_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_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}/actions/artifacts/{artifact_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. + /// The unique identifier of the GitHub Actions cache. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/cache_id`. + public var cacheId: Components.Parameters.CacheId /// 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. - /// - artifactId: The unique identifier of the artifact. + /// - cacheId: The unique identifier of the GitHub Actions cache. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId + cacheId: Components.Parameters.CacheId ) { self.owner = owner self.repo = repo - self.artifactId = artifactId + self.cacheId = cacheId } } - public var path: Operations.ActionsDeleteArtifact.Input.Path + public var path: Operations.ActionsDeleteActionsCacheById.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteArtifact.Input.Path) { + public init(path: Operations.ActionsDeleteActionsCacheById.Input.Path) { self.path = path } } @@ -21417,13 +25482,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteArtifact.Output.NoContent) + case noContent(Operations.ActionsDeleteActionsCacheById.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -21433,163 +25498,14 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteArtifact.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) - } - } - /// Download an artifact - /// - /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in - /// the response header to find the URL for the download. The `:archive_format` must be `zip`. - /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. - public enum ActionsDownloadArtifact { - public static let id: Swift.String = "actions/download-artifact" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/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}/actions/artifacts/{artifact_id}/{archive_format}/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}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/archive_format`. - public var archiveFormat: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - artifactId: The unique identifier of the artifact. - /// - archiveFormat: - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId, - archiveFormat: Swift.String - ) { - self.owner = owner - self.repo = repo - self.artifactId = artifactId - self.archiveFormat = archiveFormat - } - } - public var path: Operations.ActionsDownloadArtifact.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/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.ActionsDownloadArtifact.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ActionsDownloadArtifact.Input.Path, - headers: Operations.ActionsDownloadArtifact.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers/Location`. - public var location: Components.Headers.Location? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Components.Headers.Location? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsDownloadArtifact.Output.Found.Headers - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init()) { - self.headers = headers - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.ActionsDownloadArtifact.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.ActionsDownloadArtifact.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + public var noContent: Operations.ActionsDeleteActionsCacheById.Output.NoContent { get throws { switch self { - case let .gone(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "noContent", response: self ) } @@ -21600,90 +25516,71 @@ 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 - ] - } - } } - /// Get GitHub Actions cache usage for a repository + /// Get a job for a workflow run /// - /// Gets GitHub Actions cache usage for a repository. - /// 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 specific job in a workflow run. /// /// Anyone with read access to the repository can use this endpoint. /// /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. - public enum ActionsGetActionsCacheUsage { - public static let id: Swift.String = "actions/get-actions-cache-usage" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. + public enum ActionsGetJobForWorkflowRun { + public static let id: Swift.String = "actions/get-job-for-workflow-run" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_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}/actions/cache/usage/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_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}/actions/cache/usage/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/job_id`. + public var jobId: Components.Parameters.JobId /// 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. + /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { self.owner = owner self.repo = repo + self.jobId = jobId } } - public var path: Operations.ActionsGetActionsCacheUsage.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/header`. + public var path: Operations.ActionsGetJobForWorkflowRun.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_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.ActionsGetActionsCacheUsage.Input.Headers + public var headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsage.Input.Path, - headers: Operations.ActionsGetActionsCacheUsage.Input.Headers = .init() + path: Operations.ActionsGetJobForWorkflowRun.Input.Path, + headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -21691,15 +25588,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheUsageByRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Job) /// 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.ActionsCacheUsageByRepository { + public var json: Components.Schemas.Job { get throws { switch self { case let .json(body): @@ -21709,26 +25606,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + public var body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body) { + public init(body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsage.Output.Ok) + case ok(Operations.ActionsGetJobForWorkflowRun.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.ActionsGetActionsCacheUsage.Output.Ok { + public var ok: Operations.ActionsGetJobForWorkflowRun.Output.Ok { get throws { switch self { case let .ok(response): @@ -21772,157 +25669,216 @@ public enum Operations { } } } - /// List GitHub Actions caches for a repository + /// Download job logs for a workflow run /// - /// Lists the GitHub Actions caches for a repository. + /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + /// for `Location:` in the response header to find the URL for the download. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Anyone with read access to the repository can use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. - public enum ActionsGetActionsCacheList { - public static let id: Swift.String = "actions/get-actions-cache-list" + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. + public enum ActionsDownloadJobLogsForWorkflowRun { + public static let id: Swift.String = "actions/download-job-logs-for-workflow-run" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/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}/actions/caches/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/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}/actions/caches/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/job_id`. + public var jobId: Components.Parameters.JobId /// 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. + /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { self.owner = owner self.repo = repo + self.jobId = jobId } } - public var path: Operations.ActionsGetActionsCacheList.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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}/actions/caches/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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}/actions/caches/GET/query/page`. - public var page: Components.Parameters.Page? - /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/ref`. - public var ref: Components.Parameters.ActionsCacheGitRefFull? - /// An explicit key or prefix for identifying the cache - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/key`. - public var key: Components.Parameters.ActionsCacheKey? - /// - Remark: Generated from `#/components/parameters/actions-cache-list-sort`. - @frozen public enum ActionsCacheListSort: String, Codable, Hashable, Sendable, CaseIterable { - case createdAt = "created_at" - case lastAccessedAt = "last_accessed_at" - case sizeInBytes = "size_in_bytes" + public var path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Found: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } } - /// The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + /// Received HTTP response headers + public var headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers + /// Creates a new `Found`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/sort`. - public var sort: Components.Parameters.ActionsCacheListSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" + /// - Parameters: + /// - headers: Received HTTP response headers + public init(headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init()) { + self.headers = headers } - /// The direction to sort the results by. + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)/responses/302`. + /// + /// HTTP response code: `302 found`. + case found(Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found) + /// The associated value of the enum case if `self` is `.found`. + /// + /// - Throws: An error if `self` is not `.found`. + /// - SeeAlso: `.found`. + public var found: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found { + get throws { + switch self { + case let .found(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "found", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Re-run a job from a workflow run + /// + /// Re-run a job and its dependent jobs in a workflow run. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. + public enum ActionsReRunJobForWorkflowRun { + public static let id: Swift.String = "actions/re-run-job-for-workflow-run" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/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}/actions/caches/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/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}/actions/jobs/{job_id}/rerun/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/job_id`. + public var jobId: Components.Parameters.JobId + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: 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)." - /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - /// - key: An explicit key or prefix for identifying the cache - /// - sort: The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. - /// - direction: The direction to sort the results by. - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - ref: Components.Parameters.ActionsCacheGitRefFull? = nil, - key: Components.Parameters.ActionsCacheKey? = nil, - sort: Components.Parameters.ActionsCacheListSort? = nil, - direction: Components.Parameters.Direction? = nil + /// - 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. + /// - jobId: The unique identifier of the job. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { - self.perPage = perPage - self.page = page - self.ref = ref - self.key = key - self.sort = sort - self.direction = direction + self.owner = owner + self.repo = repo + self.jobId = jobId } } - public var query: Operations.ActionsGetActionsCacheList.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/header`. + public var path: Operations.ActionsReRunJobForWorkflowRun.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/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.ActionsGetActionsCacheList.Input.Headers + public var headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether to enable debug logging for the re-run. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debug_logging`. + public var enableDebugLogging: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enableDebugLogging: Whether to enable debug logging for the re-run. + public init(enableDebugLogging: Swift.Bool? = nil) { + self.enableDebugLogging = enableDebugLogging + } + public enum CodingKeys: String, CodingKey { + case enableDebugLogging = "enable_debug_logging" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/content/application\/json`. + case json(Operations.ActionsReRunJobForWorkflowRun.Input.Body.JsonPayload) + } + public var body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ActionsGetActionsCacheList.Input.Path, - query: Operations.ActionsGetActionsCacheList.Input.Query = .init(), - headers: Operations.ActionsGetActionsCacheList.Input.Headers = .init() + path: Operations.ActionsReRunJobForWorkflowRun.Input.Path, + headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers = .init(), + body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/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.ActionsGetActionsCacheList.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheList) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) /// 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.ActionsCacheList { + public var json: Components.Schemas.EmptyObject { get throws { switch self { case let .json(body): @@ -21932,38 +25888,56 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheList.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheList.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheList.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsReRunJobForWorkflowRun.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetActionsCacheList.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsReRunJobForWorkflowRun.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/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 ) } @@ -22000,26 +25974,26 @@ public enum Operations { } } } - /// Delete GitHub Actions caches for a repository (using a cache key) + /// Get the customization template for an OIDC subject claim for a repository /// - /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. + /// Gets the customization template for an OpenID Connect (OIDC) subject claim. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. - public enum ActionsDeleteActionsCacheByKey { - public static let id: Swift.String = "actions/delete-actions-cache-by-key" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. + public enum ActionsGetCustomOidcSubClaimForRepo { + public static let id: Swift.String = "actions/get-custom-oidc-sub-claim-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/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}/actions/caches/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/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}/actions/caches/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -22034,70 +26008,43 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsDeleteActionsCacheByKey.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query`. - public struct Query: Sendable, Hashable { - /// A key for identifying the cache. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/key`. - public var key: Components.Parameters.ActionsCacheKeyRequired - /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/ref`. - public var ref: Components.Parameters.ActionsCacheGitRefFull? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - key: A key for identifying the cache. - /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - public init( - key: Components.Parameters.ActionsCacheKeyRequired, - ref: Components.Parameters.ActionsCacheGitRefFull? = nil - ) { - self.key = key - self.ref = ref - } - } - public var query: Operations.ActionsDeleteActionsCacheByKey.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/header`. + public var path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/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.ActionsDeleteActionsCacheByKey.Input.Headers + public var headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsDeleteActionsCacheByKey.Input.Path, - query: Operations.ActionsDeleteActionsCacheByKey.Input.Query, - headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers = .init() + path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path, + headers: Operations.ActionsGetCustomOidcSubClaimForRepo.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/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheList) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OidcCustomSubRepo) /// 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.ActionsCacheList { + public var json: Components.Schemas.OidcCustomSubRepo { get throws { switch self { case let .json(body): @@ -22107,33 +26054,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body + public var body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body) { + public init(body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body) { self.body = body } } - /// Response + /// Status response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsDeleteActionsCacheByKey.Output.Ok) + case ok(Operations.ActionsGetCustomOidcSubClaimForRepo.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.ActionsDeleteActionsCacheByKey.Output.Ok { + public var ok: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok { get throws { switch self { case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.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: Components.Responses.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//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", response: self ) } @@ -22146,11 +26139,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -22161,96 +26157,232 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// Set the customization template for an OIDC subject claim for a repository /// - /// Deletes a GitHub Actions cache for a repository, using a cache ID. + /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. /// - /// OAuth 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. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. - public enum ActionsDeleteActionsCacheById { - public static let id: Swift.String = "actions/delete-actions-cache-by-id" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. + public enum ActionsSetCustomOidcSubClaimForRepo { + public static let id: Swift.String = "actions/set-custom-oidc-sub-claim-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/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}/actions/caches/{cache_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/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}/actions/caches/{cache_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the GitHub Actions cache. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/cache_id`. - public var cacheId: Components.Parameters.CacheId /// 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. - /// - cacheId: The unique identifier of the GitHub Actions cache. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - cacheId: Components.Parameters.CacheId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.cacheId = cacheId } } - public var path: Operations.ActionsDeleteActionsCacheById.Input.Path + public var path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/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.ActionsSetCustomOidcSubClaimForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// Actions OIDC subject customization for a repository + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_default`. + public var useDefault: Swift.Bool + /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. + public var includeClaimKeys: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + public init( + useDefault: Swift.Bool, + includeClaimKeys: [Swift.String]? = nil + ) { + self.useDefault = useDefault + self.includeClaimKeys = includeClaimKeys + } + public enum CodingKeys: String, CodingKey { + case useDefault = "use_default" + case includeClaimKeys = "include_claim_keys" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteActionsCacheById.Input.Path) { + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path, + headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers = .init(), + body: Operations.ActionsSetCustomOidcSubClaimForRepo.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() {} + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) + /// 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.EmptyObject { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body) { + self.body = body + } } - /// Response + /// Empty response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/201`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteActionsCacheById.Output.NoContent) - /// Response + /// HTTP response code: `201 created`. + case created(Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Resource not found /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Bad Request /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteActionsCacheById.Output.NoContent { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.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: Components.Responses.BadRequest { get throws { switch self { - case let .noContent(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// 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.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -22261,87 +26393,176 @@ 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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } } - /// Get a job for a workflow run + /// List repository organization secrets /// - /// Gets a specific job in a workflow run. + /// Lists all organization secrets shared with a repository without revealing their encrypted + /// values. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// If the repository is private, OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. - public enum ActionsGetJobForWorkflowRun { - public static let id: Swift.String = "actions/get-job-for-workflow-run" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. + public enum ActionsListRepoOrganizationSecrets { + public static let id: Swift.String = "actions/list-repo-organization-secrets" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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}/actions/jobs/{job_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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}/actions/jobs/{job_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the job. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/job_id`. - public var jobId: Components.Parameters.JobId /// 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. - /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.jobId = jobId } } - public var path: Operations.ActionsGetJobForWorkflowRun.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/header`. + public var path: Operations.ActionsListRepoOrganizationSecrets.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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}/actions/organization-secrets/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/actions/organization-secrets/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListRepoOrganizationSecrets.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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.ActionsGetJobForWorkflowRun.Input.Headers + public var headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetJobForWorkflowRun.Input.Path, - headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers = .init() + path: Operations.ActionsListRepoOrganizationSecrets.Input.Path, + query: Operations.ActionsListRepoOrganizationSecrets.Input.Query = .init(), + headers: Operations.ActionsListRepoOrganizationSecrets.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/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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.ActionsListRepoOrganizationSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Job) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/secrets`. + public var secrets: [Components.Schemas.ActionsSecret] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - secrets: + public init( + totalCount: Swift.Int, + secrets: [Components.Schemas.ActionsSecret] + ) { + self.totalCount = totalCount + self.secrets = secrets + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case secrets + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoOrganizationSecrets.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: Components.Schemas.Job { + public var json: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -22351,26 +26572,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body + public var body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body) { + public init( + headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(), + body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetJobForWorkflowRun.Output.Ok) + case ok(Operations.ActionsListRepoOrganizationSecrets.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.ActionsGetJobForWorkflowRun.Output.Ok { + public var ok: Operations.ActionsListRepoOrganizationSecrets.Output.Ok { get throws { switch self { case let .ok(response): @@ -22414,216 +26640,143 @@ public enum Operations { } } } - /// Download job logs for a workflow run + /// List repository organization variables /// - /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look - /// for `Location:` in the response header to find the URL for the download. + /// Lists all organization variables shared with a repository. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// If the repository is private, OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. - public enum ActionsDownloadJobLogsForWorkflowRun { - public static let id: Swift.String = "actions/download-job-logs-for-workflow-run" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. + public enum ActionsListRepoOrganizationVariables { + public static let id: Swift.String = "actions/list-repo-organization-variables" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/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}/actions/jobs/{job_id}/logs/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/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}/actions/jobs/{job_id}/logs/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the job. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/job_id`. - public var jobId: Components.Parameters.JobId /// 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. - /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.jobId = jobId - } - } - public var path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init()) { - self.headers = headers - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Re-run a job from a workflow run - /// - /// Re-run a job and its dependent jobs in a workflow run. - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. - public enum ActionsReRunJobForWorkflowRun { - public static let id: Swift.String = "actions/re-run-job-for-workflow-run" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/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}/actions/jobs/{job_id}/rerun/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + public var path: Operations.ActionsListRepoOrganizationVariables.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 30). 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}/actions/jobs/{job_id}/rerun/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the job. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/per_page`. + public var perPage: Components.Parameters.VariablesPerPage? + /// 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}/actions/jobs/{job_id}/rerun/POST/path/job_id`. - public var jobId: Components.Parameters.JobId - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. /// /// - 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. - /// - jobId: The unique identifier of the job. + /// - perPage: The number of results per page (max 30). 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( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId + perPage: Components.Parameters.VariablesPerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.owner = owner - self.repo = repo - self.jobId = jobId + self.perPage = perPage + self.page = page } } - public var path: Operations.ActionsReRunJobForWorkflowRun.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/header`. + public var query: Operations.ActionsListRepoOrganizationVariables.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/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.ActionsReRunJobForWorkflowRun.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Whether to enable debug logging for the re-run. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debug_logging`. - public var enableDebugLogging: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enableDebugLogging: Whether to enable debug logging for the re-run. - public init(enableDebugLogging: Swift.Bool? = nil) { - self.enableDebugLogging = enableDebugLogging - } - public enum CodingKeys: String, CodingKey { - case enableDebugLogging = "enable_debug_logging" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/content/application\/json`. - case json(Operations.ActionsReRunJobForWorkflowRun.Input.Body.JsonPayload) - } - public var body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? + public var headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ActionsReRunJobForWorkflowRun.Input.Path, - headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers = .init(), - body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? = nil + path: Operations.ActionsListRepoOrganizationVariables.Input.Path, + query: Operations.ActionsListRepoOrganizationVariables.Input.Query = .init(), + headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/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.ActionsListRepoOrganizationVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/variables`. + public var variables: [Components.Schemas.ActionsVariable] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - variables: + public init( + totalCount: Swift.Int, + variables: [Components.Schemas.ActionsVariable] + ) { + self.totalCount = totalCount + self.variables = variables + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case variables + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoOrganizationVariables.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: Components.Schemas.EmptyObject { + public var json: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -22633,56 +26786,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body) { + public init( + headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(), + body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsReRunJobForWorkflowRun.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.ActionsReRunJobForWorkflowRun.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListRepoOrganizationVariables.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListRepoOrganizationVariables.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } @@ -22719,26 +26854,26 @@ public enum Operations { } } } - /// Get the customization template for an OIDC subject claim for a repository + /// Get GitHub Actions permissions for a repository /// - /// Gets the customization template for an OpenID Connect (OIDC) subject claim. + /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. - public enum ActionsGetCustomOidcSubClaimForRepo { - public static let id: Swift.String = "actions/get-custom-oidc-sub-claim-for-repo" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. + public enum ActionsGetGithubActionsPermissionsRepository { + public static let id: Swift.String = "actions/get-github-actions-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/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}/actions/oidc/customization/sub/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/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}/actions/oidc/customization/sub/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -22753,27 +26888,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/header`. + public var path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/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.ActionsGetCustomOidcSubClaimForRepo.Input.Headers + public var headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path, - headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers = .init() + path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path, + headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -22781,15 +26916,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OidcCustomSubRepo) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsRepositoryPermissions) /// 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.OidcCustomSubRepo { + public var json: Components.Schemas.ActionsRepositoryPermissions { get throws { switch self { case let .json(body): @@ -22799,26 +26934,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body) { + public init(body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body) { self.body = body } } - /// Status response + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok) + case ok(Operations.ActionsGetGithubActionsPermissionsRepository.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.ActionsGetCustomOidcSubClaimForRepo.Output.Ok { + public var ok: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -22831,52 +26966,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.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: Components.Responses.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//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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. @@ -22884,14 +26973,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -22902,38 +26988,35 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Set the customization template for an OIDC subject claim for a repository + /// Set GitHub Actions permissions for a repository /// - /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. + /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. - public enum ActionsSetCustomOidcSubClaimForRepo { - public static let id: Swift.String = "actions/set-custom-oidc-sub-claim-for-repo" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. + public enum ActionsSetGithubActionsPermissionsRepository { + public static let id: Swift.String = "actions/set-github-actions-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/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}/actions/oidc/customization/sub/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/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}/actions/oidc/customization/sub/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -22948,186 +27031,200 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/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.ActionsSetCustomOidcSubClaimForRepo.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody`. + public var path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// Actions OIDC subject customization for a repository - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_default`. - public var useDefault: Swift.Bool - /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. - public var includeClaimKeys: [Swift.String]? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/enabled`. + public var enabled: Components.Schemas.ActionsEnabled + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/allowed_actions`. + public var allowedActions: Components.Schemas.AllowedActions? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. - /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// - enabled: + /// - allowedActions: public init( - useDefault: Swift.Bool, - includeClaimKeys: [Swift.String]? = nil + enabled: Components.Schemas.ActionsEnabled, + allowedActions: Components.Schemas.AllowedActions? = nil ) { - self.useDefault = useDefault - self.includeClaimKeys = includeClaimKeys + self.enabled = enabled + self.allowedActions = allowedActions } public enum CodingKeys: String, CodingKey { - case useDefault = "use_default" - case includeClaimKeys = "include_claim_keys" + case enabled + case allowedActions = "allowed_actions" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body + public var body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: /// - body: public init( - path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path, - headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers = .init(), - body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body + path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path, + body: Operations.ActionsSetGithubActionsPermissionsRepository.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/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) - /// 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.EmptyObject { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Empty response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/201`. + /// Response /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Resource not found + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/400`. + /// Undocumented response. /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get the level of access for workflows outside of the repository + /// + /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. + public enum ActionsGetWorkflowAccessToRepository { + public static let id: Swift.String = "actions/get-workflow-access-to-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/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}/actions/permissions/access/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}/actions/permissions/access/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// 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. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/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.ActionsGetWorkflowAccessToRepository.Input.Headers + /// Creates a new `Input`. /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path, + headers: Operations.ActionsGetWorkflowAccessToRepository.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}/actions/permissions/access/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsWorkflowAccessToRepository) + /// 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.ActionsWorkflowAccessToRepository { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body) { + self.body = body + } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetWorkflowAccessToRepository.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.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetWorkflowAccessToRepository.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 ) } @@ -23140,14 +27237,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -23158,41 +27252,37 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// List repository organization secrets - /// - /// Lists all organization secrets shared with a repository without revealing their encrypted - /// values. + /// Set the level of access for workflows outside of the repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. - public enum ActionsListRepoOrganizationSecrets { - public static let id: Swift.String = "actions/list-repo-organization-secrets" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. + public enum ActionsSetWorkflowAccessToRepository { + public static let id: Swift.String = "actions/set-workflow-access-to-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/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}/actions/organization-secrets/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/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}/actions/organization-secrets/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23207,107 +27297,139 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsListRepoOrganizationSecrets.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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.ActionsSetWorkflowAccessToRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsWorkflowAccessToRepository) + } + public var body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path, + body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetWorkflowAccessToRepository.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 artifact and log retention settings for a repository + /// + /// Gets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public enum ActionsGetArtifactAndLogRetentionSettingsRepository { + public static let id: Swift.String = "actions/get-artifact-and-log-retention-settings-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/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}/actions/organization-secrets/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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}/actions/permissions/artifact-and-log-retention/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}/actions/organization-secrets/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: 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)." + /// - 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. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { - self.perPage = perPage - self.page = page + self.owner = owner + self.repo = repo } } - public var query: Operations.ActionsListRepoOrganizationSecrets.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/header`. + public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/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.ActionsListRepoOrganizationSecrets.Input.Headers + public var headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListRepoOrganizationSecrets.Input.Path, - query: Operations.ActionsListRepoOrganizationSecrets.Input.Query = .init(), - headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers = .init() + path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.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/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/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.ActionsListRepoOrganizationSecrets.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/secrets`. - public var secrets: [Components.Schemas.ActionsSecret] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - secrets: - public init( - totalCount: Swift.Int, - secrets: [Components.Schemas.ActionsSecret] - ) { - self.totalCount = totalCount - self.secrets = secrets - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case secrets - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetentionResponse) /// 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.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsArtifactAndLogRetentionResponse { get throws { switch self { case let .json(body): @@ -23317,31 +27439,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + public var body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(), - body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoOrganizationSecrets.Output.Ok) + case ok(Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.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.ActionsListRepoOrganizationSecrets.Output.Ok { + public var ok: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23354,6 +27471,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -23385,28 +27525,26 @@ public enum Operations { } } } - /// List repository organization variables - /// - /// Lists all organization variables shared with a repository. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Set artifact and log retention settings for a repository /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Sets artifact and log retention settings for a repository. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. - public enum ActionsListRepoOrganizationVariables { - public static let id: Swift.String = "actions/list-repo-organization-variables" + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public enum ActionsSetArtifactAndLogRetentionSettingsRepository { + public static let id: Swift.String = "actions/set-artifact-and-log-retention-settings-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/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}/actions/organization-variables/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/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}/actions/organization-variables/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23421,148 +27559,118 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsListRepoOrganizationVariables.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 30). 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}/actions/organization-variables/GET/query/per_page`. - public var perPage: Components.Parameters.VariablesPerPage? - /// 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}/actions/organization-variables/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 30). 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( - perPage: Components.Parameters.VariablesPerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ActionsListRepoOrganizationVariables.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/header`. + public var path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/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.ActionsListRepoOrganizationVariables.Input.Headers + public var headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetention) + } + public var body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ActionsListRepoOrganizationVariables.Input.Path, - query: Operations.ActionsListRepoOrganizationVariables.Input.Query = .init(), - headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers = .init() + path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/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 + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output.NoContent) + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// 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.ActionsSetArtifactAndLogRetentionSettingsRepository.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response headers - public var headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/variables`. - public var variables: [Components.Schemas.ActionsVariable] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - variables: - public init( - totalCount: Swift.Int, - variables: [Components.Schemas.ActionsVariable] - ) { - self.totalCount = totalCount - self.variables = variables - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case variables - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoOrganizationVariables.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.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(), - body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoOrganizationVariables.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ActionsListRepoOrganizationVariables.Output.Ok { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .ok(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "unprocessableContent", response: self ) } @@ -23599,26 +27707,26 @@ public enum Operations { } } } - /// Get GitHub Actions permissions for a repository + /// Get fork PR contributor approval permissions for a repository /// - /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. + /// Gets the fork PR contributor approval policy for a repository. /// - /// OAuth 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. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. - public enum ActionsGetGithubActionsPermissionsRepository { - public static let id: Swift.String = "actions/get-github-actions-permissions-repository" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public enum ActionsGetForkPrContributorApprovalPermissionsRepository { + public static let id: Swift.String = "actions/get-fork-pr-contributor-approval-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/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}/actions/permissions/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/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}/actions/permissions/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23633,27 +27741,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/header`. + public var path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/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.ActionsGetGithubActionsPermissionsRepository.Input.Headers + public var headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path, - headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers = .init() + path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -23661,15 +27769,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsRepositoryPermissions) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) /// 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.ActionsRepositoryPermissions { + public var json: Components.Schemas.ActionsForkPrContributorApproval { get throws { switch self { case let .json(body): @@ -23679,26 +27787,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body + public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body) { + public init(body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok) + case ok(Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.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.ActionsGetGithubActionsPermissionsRepository.Output.Ok { + public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23711,6 +27819,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -23742,26 +27873,26 @@ public enum Operations { } } } - /// Set GitHub Actions permissions for a repository + /// Set fork PR contributor approval permissions for a repository /// - /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. + /// Sets the fork PR contributor approval policy for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. - public enum ActionsSetGithubActionsPermissionsRepository { - public static let id: Swift.String = "actions/set-github-actions-permissions-repository" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public enum ActionsSetForkPrContributorApprovalPermissionsRepository { + public static let id: Swift.String = "actions/set-fork-pr-contributor-approval-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/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}/actions/permissions/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/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}/actions/permissions/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23776,46 +27907,38 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/enabled`. - public var enabled: Components.Schemas.ActionsEnabled - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/allowed_actions`. - public var allowedActions: Components.Schemas.AllowedActions? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enabled: - /// - allowedActions: - public init( - enabled: Components.Schemas.ActionsEnabled, - allowedActions: Components.Schemas.AllowedActions? = nil - ) { - self.enabled = enabled - self.allowedActions = allowedActions - } - public enum CodingKeys: String, CodingKey { - case enabled - case allowedActions = "allowed_actions" - } + public var path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/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 } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + public var headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) + } + public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path, - body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -23826,13 +27949,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent) + case noContent(Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -23842,7 +27965,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent { + public var noContent: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -23855,34 +27978,103 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + 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 the level of access for workflows outside of the repository + /// Get private repo fork PR workflow settings for a repository /// - /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. - public enum ActionsGetWorkflowAccessToRepository { - public static let id: Swift.String = "actions/get-workflow-access-to-repository" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public enum ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository { + public static let id: Swift.String = "actions/get-private-repo-fork-pr-workflows-settings-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/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}/actions/permissions/access/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/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}/actions/permissions/access/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23897,27 +28089,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/header`. + public var path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/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.ActionsGetWorkflowAccessToRepository.Input.Headers + public var headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path, - headers: Operations.ActionsGetWorkflowAccessToRepository.Input.Headers = .init() + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -23925,15 +28117,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsWorkflowAccessToRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateRepos) /// 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.ActionsWorkflowAccessToRepository { + public var json: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { get throws { switch self { case let .json(body): @@ -23943,26 +28135,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body + public var body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body) { + public init(body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetWorkflowAccessToRepository.Output.Ok) + case ok(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.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.ActionsGetWorkflowAccessToRepository.Output.Ok { + public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23975,6 +28167,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/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//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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. @@ -24006,28 +28244,26 @@ public enum Operations { } } } - /// Set the level of access for workflows outside of the repository + /// Set private repo fork PR workflow settings for a repository /// - /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. - public enum ActionsSetWorkflowAccessToRepository { - public static let id: Swift.String = "actions/set-workflow-access-to-repository" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public enum ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository { + public static let id: Swift.String = "actions/set-private-repo-fork-pr-workflows-settings-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/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}/actions/permissions/access/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/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}/actions/permissions/access/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -24042,23 +28278,38 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody`. + public var path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/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.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.ActionsWorkflowAccessToRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateReposRequest) } - public var body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path, - body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -24067,15 +28318,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// Empty response for successful settings update /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent) - /// Response + case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output.NoContent) + /// Empty response for successful settings update /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24085,7 +28336,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent { + public var noContent: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -24098,11 +28349,82 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + 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 allowed actions and reusable workflows for a repository /// diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index cae57fef464..5db6761171a 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -2872,6 +2872,41 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -3104,6 +3139,8 @@ public enum Components { public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// Creates a new `Issue`. /// /// - Parameters: @@ -3143,6 +3180,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - issueDependenciesSummary: public init( id: Swift.Int64, nodeId: Swift.String, @@ -3179,7 +3217,8 @@ public enum Components { performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, authorAssociation: Components.Schemas.AuthorAssociation, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil ) { self.id = id self.nodeId = nodeId @@ -3217,6 +3256,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.issueDependenciesSummary = issueDependenciesSummary } public enum CodingKeys: String, CodingKey { case id @@ -3255,6 +3295,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case issueDependenciesSummary = "issue_dependencies_summary" } } /// Comments provide a way for people to collaborate on an issue. diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 14777b85615..f7fa07cea96 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -210,7 +210,7 @@ public struct Client: APIProtocol { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -1282,7 +1282,7 @@ public struct Client: APIProtocol { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 5d8b339a1e3..cac0e7f0e5d 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -36,7 +36,7 @@ public protocol APIProtocol: Sendable { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -144,7 +144,7 @@ public protocol APIProtocol: Sendable { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -209,7 +209,7 @@ extension APIProtocol { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -377,7 +377,7 @@ extension APIProtocol { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -1365,6 +1365,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. public var lastActivityEditor: Swift.String? + /// Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_authenticated_at`. + public var lastAuthenticatedAt: Foundation.Date? /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. @@ -1395,6 +1399,7 @@ public enum Components { /// - pendingCancellationDate: 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. /// - lastActivityAt: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. /// - lastActivityEditor: Last editor that was used by the user for a GitHub Copilot completion. + /// - lastAuthenticatedAt: Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. /// - createdAt: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// - updatedAt: **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. /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. @@ -1405,6 +1410,7 @@ public enum Components { pendingCancellationDate: Swift.String? = nil, lastActivityAt: Foundation.Date? = nil, lastActivityEditor: Swift.String? = nil, + lastAuthenticatedAt: Foundation.Date? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date? = nil, planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? = nil @@ -1415,6 +1421,7 @@ public enum Components { self.pendingCancellationDate = pendingCancellationDate self.lastActivityAt = lastActivityAt self.lastActivityEditor = lastActivityEditor + self.lastAuthenticatedAt = lastAuthenticatedAt self.createdAt = createdAt self.updatedAt = updatedAt self.planType = planType @@ -1426,6 +1433,7 @@ public enum Components { case pendingCancellationDate = "pending_cancellation_date" case lastActivityAt = "last_activity_at" case lastActivityEditor = "last_activity_editor" + case lastAuthenticatedAt = "last_authenticated_at" case createdAt = "created_at" case updatedAt = "updated_at" case planType = "plan_type" @@ -1456,6 +1464,10 @@ public enum Components { Swift.String.self, forKey: .lastActivityEditor ) + self.lastAuthenticatedAt = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .lastAuthenticatedAt + ) self.createdAt = try container.decode( Foundation.Date.self, forKey: .createdAt @@ -1475,6 +1487,7 @@ public enum Components { "pending_cancellation_date", "last_activity_at", "last_activity_editor", + "last_authenticated_at", "created_at", "updated_at", "plan_type" @@ -2819,7 +2832,7 @@ public enum Operations { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -4653,7 +4666,7 @@ public enum Operations { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 55c32bf47b6..2f5ad782cb6 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -2630,6 +2630,750 @@ public struct Client: APIProtocol { } ) } + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListDependenciesBlockedBy.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + 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.perPage + ) + 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.IssuesListDependenciesBlockedBy.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.IssuesListDependenciesBlockedBy.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].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesAddBlockedByDependency.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + 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 headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesAddBlockedByDependency.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.Issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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 + ) + ) + } + } + ) + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesRemoveDependencyBlockedBy.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber, + input.path.issueId + ] + ) + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesRemoveDependencyBlockedBy.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.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListDependenciesBlocking.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocking", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + 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.perPage + ) + 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.IssuesListDependenciesBlocking.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.IssuesListDependenciesBlocking.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].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List issue events /// /// Lists all events for an issue. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 1a4b16a7344..894cc8eb1bf 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -260,6 +260,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/comments`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. func issuesCreateComment(_ input: Operations.IssuesCreateComment.Input) async throws -> Operations.IssuesCreateComment.Output + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output /// List issue events /// /// Lists all events for an issue. @@ -896,6 +959,107 @@ extension APIProtocol { body: body )) } + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public func issuesListDependenciesBlockedBy( + path: Operations.IssuesListDependenciesBlockedBy.Input.Path, + query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers = .init() + ) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { + try await issuesListDependenciesBlockedBy(Operations.IssuesListDependenciesBlockedBy.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public func issuesAddBlockedByDependency( + path: Operations.IssuesAddBlockedByDependency.Input.Path, + headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Input.Body + ) async throws -> Operations.IssuesAddBlockedByDependency.Output { + try await issuesAddBlockedByDependency(Operations.IssuesAddBlockedByDependency.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public func issuesRemoveDependencyBlockedBy( + path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, + headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers = .init() + ) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { + try await issuesRemoveDependencyBlockedBy(Operations.IssuesRemoveDependencyBlockedBy.Input( + path: path, + headers: headers + )) + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public func issuesListDependenciesBlocking( + path: Operations.IssuesListDependenciesBlocking.Input.Path, + query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlocking.Input.Headers = .init() + ) async throws -> Operations.IssuesListDependenciesBlocking.Output { + try await issuesListDependenciesBlocking(Operations.IssuesListDependenciesBlocking.Input( + path: path, + query: query, + headers: headers + )) + } /// List issue events /// /// Lists all events for an issue. @@ -3616,6 +3780,41 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -3848,6 +4047,8 @@ public enum Components { public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// Creates a new `Issue`. /// /// - Parameters: @@ -3887,6 +4088,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - issueDependenciesSummary: public init( id: Swift.Int64, nodeId: Swift.String, @@ -3923,7 +4125,8 @@ public enum Components { performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, authorAssociation: Components.Schemas.AuthorAssociation, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil ) { self.id = id self.nodeId = nodeId @@ -3961,6 +4164,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.issueDependenciesSummary = issueDependenciesSummary } public enum CodingKeys: String, CodingKey { case id @@ -3999,6 +4203,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case issueDependenciesSummary = "issue_dependencies_summary" } } /// Comments provide a way for people to collaborate on an issue. @@ -4678,6 +4883,8 @@ public enum Components { public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/nullable-issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// Creates a new `NullableIssue`. /// /// - Parameters: @@ -4717,6 +4924,7 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - issueDependenciesSummary: public init( id: Swift.Int64, nodeId: Swift.String, @@ -4753,7 +4961,8 @@ public enum Components { performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, authorAssociation: Components.Schemas.AuthorAssociation, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil ) { self.id = id self.nodeId = nodeId @@ -4791,6 +5000,7 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.issueDependenciesSummary = issueDependenciesSummary } public enum CodingKeys: String, CodingKey { case id @@ -4829,6 +5039,7 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case issueDependenciesSummary = "issue_dependencies_summary" } } /// Issue Event Label @@ -8669,6 +8880,34 @@ public enum Components { /// Creates a new `NotModified`. public init() {} } + public struct RequiresAuthentication: 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.BasicError) + /// 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.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -13800,6 +14039,1174 @@ public enum Operations { } } } + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public enum IssuesListDependenciesBlockedBy { + public static let id: Swift.String = "issues/list-dependencies-blocked-by" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/issues/{issue_number}/dependencies/blocked_by/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}/issues/{issue_number}/dependencies/blocked_by/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// 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. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListDependenciesBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/issues/{issue_number}/dependencies/blocked_by/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/issues/{issue_number}/dependencies/blocked_by/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListDependenciesBlockedBy.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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.IssuesListDependenciesBlockedBy.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListDependenciesBlockedBy.Input.Path, + query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlockedBy.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/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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.IssuesListDependenciesBlockedBy.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// 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] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlockedBy.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.IssuesListDependenciesBlockedBy.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + 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 + ] + } + } + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public enum IssuesAddBlockedByDependency { + public static let id: Swift.String = "issues/add-blocked-by-dependency" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/issues/{issue_number}/dependencies/blocked_by/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}/issues/{issue_number}/dependencies/blocked_by/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// 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. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesAddBlockedByDependency.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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.IssuesAddBlockedByDependency.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The id of the issue that blocks the current issue + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json/issue_id`. + public var issueId: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueId: The id of the issue that blocks the current issue + public init(issueId: Swift.Int) { + self.issueId = issueId + } + public enum CodingKeys: String, CodingKey { + case issueId = "issue_id" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddBlockedByDependency.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddBlockedByDependency.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesAddBlockedByDependency.Input.Path, + headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.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/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Issue) + /// 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 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.IssuesAddBlockedByDependency.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.IssuesAddBlockedByDependency.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/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 + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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 + ] + } + } + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing 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). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public enum IssuesRemoveDependencyBlockedBy { + public static let id: Swift.String = "issues/remove-dependency-blocked-by" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_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}/issues/{issue_number}/dependencies/blocked_by/{issue_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}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// The id of the blocking issue to remove as a dependency + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_id`. + public var issueId: 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. + /// - issueNumber: The number that identifies the issue. + /// - issueId: The id of the blocking issue to remove as a dependency + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + issueId: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + self.issueId = issueId + } + } + public var path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_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.IssuesRemoveDependencyBlockedBy.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, + headers: Operations.IssuesRemoveDependencyBlockedBy.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}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// 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 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesRemoveDependencyBlockedBy.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.IssuesRemoveDependencyBlockedBy.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.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: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// 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.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/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//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + 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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public enum IssuesListDependenciesBlocking { + public static let id: Swift.String = "issues/list-dependencies-blocking" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/issues/{issue_number}/dependencies/blocking/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}/issues/{issue_number}/dependencies/blocking/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// 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. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListDependenciesBlocking.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/issues/{issue_number}/dependencies/blocking/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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}/issues/{issue_number}/dependencies/blocking/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: 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( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListDependenciesBlocking.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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.IssuesListDependenciesBlocking.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListDependenciesBlocking.Input.Path, + query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlocking.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/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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.IssuesListDependenciesBlocking.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// 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] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlocking.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.IssuesListDependenciesBlocking.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + 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 issue events /// /// Lists all events for an issue. diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index 2d3ace7c90b..87202523ac7 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -38,3678 +38,4 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// List organization 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}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) - public func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/projects", - 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: "state", - value: input.query.state - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - 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.ProjectsListForOrg.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.ProjectsListForOrg.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.Project].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 - ) - ) - } - } - ) - } - /// Create an organization 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 `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - public func projectsCreateForOrg(_ input: Operations.ProjectsCreateForOrg.Input) async throws -> Operations.ProjectsCreateForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/projects", - 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.ProjectsCreateForOrg.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.Project.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.BasicError.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 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 projectsGetCard(_ input: Operations.ProjectsGetCard.Input) async throws -> Operations.ProjectsGetCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGetCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - 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.ProjectsGetCard.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.ProjectCard.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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 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 projectsUpdateCard(_ input: Operations.ProjectsUpdateCard.Input) async throws -> Operations.ProjectsUpdateCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsUpdateCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - 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 .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 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdateCard.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.ProjectCard.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 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 projectsDeleteCard(_ input: Operations.ProjectsDeleteCard.Input) async throws -> Operations.ProjectsDeleteCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsDeleteCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - 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 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsDeleteCard.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsDeleteCard.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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 - ) - ) - } - } - ) - } - /// 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 projectsMoveCard(_ input: Operations.ProjectsMoveCard.Input) async throws -> Operations.ProjectsMoveCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsMoveCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}/moves", - parameters: [ - input.path.cardId - ] - ) - 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.ProjectsMoveCard.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.Created.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveCard.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 503: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.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 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 projectsGetColumn(_ input: Operations.ProjectsGetColumn.Input) async throws -> Operations.ProjectsGetColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGetColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - 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.ProjectsGetColumn.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.ProjectColumn.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.BasicError.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// 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 projectsUpdateColumn(_ input: Operations.ProjectsUpdateColumn.Input) async throws -> Operations.ProjectsUpdateColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsUpdateColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - 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.ProjectsUpdateColumn.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.ProjectColumn.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete 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 projectsDeleteColumn(_ input: Operations.ProjectsDeleteColumn.Input) async throws -> Operations.ProjectsDeleteColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsDeleteColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - 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 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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List project cards - /// - /// > [!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 projectsListCards(_ input: Operations.ProjectsListCards.Input) async throws -> Operations.ProjectsListCards.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListCards.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}/cards", - parameters: [ - input.path.columnId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "archived_state", - value: input.query.archivedState - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - 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.ProjectsListCards.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.ProjectsListCards.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.ProjectCard].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - 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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// 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 projectsCreateCard(_ input: Operations.ProjectsCreateCard.Input) async throws -> Operations.ProjectsCreateCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}/cards", - parameters: [ - input.path.columnId - ] - ) - 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.ProjectsCreateCard.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.ProjectCard.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsCreateCard.Output.UnprocessableContent.Body.JsonPayload.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: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsCreateCard.Output.ServiceUnavailable.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 - ) - ) - } - } - ) - } - /// 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 projectsMoveColumn(_ input: Operations.ProjectsMoveColumn.Input) async throws -> Operations.ProjectsMoveColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsMoveColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}/moves", - parameters: [ - input.path.columnId - ] - ) - 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.ProjectsMoveColumn.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveColumn.Output.Created.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get 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}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - public func projectsGet(_ input: Operations.ProjectsGet.Input) async throws -> Operations.ProjectsGet.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGet.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}", - parameters: [ - input.path.projectId - ] - ) - 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.ProjectsGet.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.Project.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update 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 `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - public func projectsUpdate(_ input: Operations.ProjectsUpdate.Input) async throws -> Operations.ProjectsUpdate.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsUpdate.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}", - parameters: [ - input.path.projectId - ] - ) - 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 .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 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdate.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.Project.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - return .notFound(.init()) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdate.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsUpdate.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 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 `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - public func projectsDelete(_ input: Operations.ProjectsDelete.Input) async throws -> Operations.ProjectsDelete.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsDelete.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}", - parameters: [ - input.path.projectId - ] - ) - 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 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsDelete.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsDelete.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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 project 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 projectsListCollaborators(_ input: Operations.ProjectsListCollaborators.Input) async throws -> Operations.ProjectsListCollaborators.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListCollaborators.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/collaborators", - parameters: [ - input.path.projectId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "affiliation", - value: input.query.affiliation - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - 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.ProjectsListCollaborators.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.ProjectsListCollaborators.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.SimpleUser].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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Add project 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 projectsAddCollaborator(_ input: Operations.ProjectsAddCollaborator.Input) async throws -> Operations.ProjectsAddCollaborator.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsAddCollaborator.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}", - parameters: [ - input.path.projectId, - input.path.username - ] - ) - 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 .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 204: - return .noContent(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Remove user as 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 projectsRemoveCollaborator(_ input: Operations.ProjectsRemoveCollaborator.Input) async throws -> Operations.ProjectsRemoveCollaborator.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsRemoveCollaborator.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}", - parameters: [ - input.path.projectId, - input.path.username - ] - ) - 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 304: - return .notModified(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get project permission 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 /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 projectsGetPermissionForUser(_ input: Operations.ProjectsGetPermissionForUser.Input) async throws -> Operations.ProjectsGetPermissionForUser.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGetPermissionForUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}/permission", - parameters: [ - input.path.projectId, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsGetPermissionForUser.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.ProjectCollaboratorPermission.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List project columns - /// - /// > [!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 projectsListColumns(_ input: Operations.ProjectsListColumns.Input) async throws -> Operations.ProjectsListColumns.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListColumns.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/columns", - parameters: [ - input.path.projectId - ] - ) - 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.perPage - ) - 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.ProjectsListColumns.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.ProjectsListColumns.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.ProjectColumn].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - 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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create 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/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - public func projectsCreateColumn(_ input: Operations.ProjectsCreateColumn.Input) async throws -> Operations.ProjectsCreateColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/{}/columns", - parameters: [ - input.path.projectId - ] - ) - 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.ProjectsCreateColumn.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.ProjectColumn.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List repository 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 /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - public func projectsListForRepo(_ input: Operations.ProjectsListForRepo.Input) async throws -> Operations.ProjectsListForRepo.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListForRepo.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/projects", - parameters: [ - input.path.owner, - input.path.repo - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - 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: "per_page", - value: input.query.perPage - ) - 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.ProjectsListForRepo.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.ProjectsListForRepo.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.Project].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.BasicError.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 - ) - ) - } - } - ) - } - /// Create a repository 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 `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - public func projectsCreateForRepo(_ input: Operations.ProjectsCreateForRepo.Input) async throws -> Operations.ProjectsCreateForRepo.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateForRepo.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/projects", - parameters: [ - input.path.owner, - input.path.repo - ] - ) - 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.ProjectsCreateForRepo.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.Project.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.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.BasicError.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.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 - ) - ) - } - } - ) - } - /// Create a user 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 `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - public func projectsCreateForAuthenticatedUser(_ input: Operations.ProjectsCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateForAuthenticatedUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/user/projects", - parameters: [] - ) - 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.ProjectsCreateForAuthenticatedUser.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.Project.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.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.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.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 - ) - ) - } - } - ) - } - /// List user 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 /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListForUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/users/{}/projects", - parameters: [ - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - 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: "per_page", - value: input.query.perPage - ) - 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.ProjectsListForUser.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.ProjectsListForUser.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.Project].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.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 - ) - ) - } - } - ) - } } diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 161fe318c32..c3d1209ecf5 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -10,743 +10,10 @@ 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 organization 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}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) - func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output - /// Create an organization 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 `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - func projectsCreateForOrg(_ input: Operations.ProjectsCreateForOrg.Input) async throws -> Operations.ProjectsCreateForOrg.Output - /// Get 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 projectsGetCard(_ input: Operations.ProjectsGetCard.Input) async throws -> Operations.ProjectsGetCard.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 projectsUpdateCard(_ input: Operations.ProjectsUpdateCard.Input) async throws -> Operations.ProjectsUpdateCard.Output - /// Delete 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 projectsDeleteCard(_ input: Operations.ProjectsDeleteCard.Input) async throws -> Operations.ProjectsDeleteCard.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 projectsMoveCard(_ input: Operations.ProjectsMoveCard.Input) async throws -> Operations.ProjectsMoveCard.Output - /// Get 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 projectsGetColumn(_ input: Operations.ProjectsGetColumn.Input) async throws -> Operations.ProjectsGetColumn.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 projectsUpdateColumn(_ input: Operations.ProjectsUpdateColumn.Input) async throws -> Operations.ProjectsUpdateColumn.Output - /// Delete 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 projectsDeleteColumn(_ input: Operations.ProjectsDeleteColumn.Input) async throws -> Operations.ProjectsDeleteColumn.Output - /// List project cards - /// - /// > [!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 projectsListCards(_ input: Operations.ProjectsListCards.Input) async throws -> Operations.ProjectsListCards.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 projectsCreateCard(_ input: Operations.ProjectsCreateCard.Input) async throws -> Operations.ProjectsCreateCard.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 projectsMoveColumn(_ input: Operations.ProjectsMoveColumn.Input) async throws -> Operations.ProjectsMoveColumn.Output - /// Get 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}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - func projectsGet(_ input: Operations.ProjectsGet.Input) async throws -> Operations.ProjectsGet.Output - /// Update 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 `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - func projectsUpdate(_ input: Operations.ProjectsUpdate.Input) async throws -> Operations.ProjectsUpdate.Output - /// Delete 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 `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - func projectsDelete(_ input: Operations.ProjectsDelete.Input) async throws -> Operations.ProjectsDelete.Output - /// List project 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 projectsListCollaborators(_ input: Operations.ProjectsListCollaborators.Input) async throws -> Operations.ProjectsListCollaborators.Output - /// Add project 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 projectsAddCollaborator(_ input: Operations.ProjectsAddCollaborator.Input) async throws -> Operations.ProjectsAddCollaborator.Output - /// Remove user as 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 projectsRemoveCollaborator(_ input: Operations.ProjectsRemoveCollaborator.Input) async throws -> Operations.ProjectsRemoveCollaborator.Output - /// Get project permission 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 /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 projectsGetPermissionForUser(_ input: Operations.ProjectsGetPermissionForUser.Input) async throws -> Operations.ProjectsGetPermissionForUser.Output - /// List project columns - /// - /// > [!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 projectsListColumns(_ input: Operations.ProjectsListColumns.Input) async throws -> Operations.ProjectsListColumns.Output - /// Create 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/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - func projectsCreateColumn(_ input: Operations.ProjectsCreateColumn.Input) async throws -> Operations.ProjectsCreateColumn.Output - /// List repository 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 /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - func projectsListForRepo(_ input: Operations.ProjectsListForRepo.Input) async throws -> Operations.ProjectsListForRepo.Output - /// Create a repository 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 `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - func projectsCreateForRepo(_ input: Operations.ProjectsCreateForRepo.Input) async throws -> Operations.ProjectsCreateForRepo.Output - /// Create a user 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 `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - func projectsCreateForAuthenticatedUser(_ input: Operations.ProjectsCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output - /// List user 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 /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output -} +public protocol APIProtocol: Sendable {} /// Convenience overloads for operation inputs. extension APIProtocol { - /// List organization 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}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) - public func projectsListForOrg( - path: Operations.ProjectsListForOrg.Input.Path, - query: Operations.ProjectsListForOrg.Input.Query = .init(), - headers: Operations.ProjectsListForOrg.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForOrg.Output { - try await projectsListForOrg(Operations.ProjectsListForOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create an organization 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 `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - public func projectsCreateForOrg( - path: Operations.ProjectsCreateForOrg.Input.Path, - headers: Operations.ProjectsCreateForOrg.Input.Headers = .init(), - body: Operations.ProjectsCreateForOrg.Input.Body - ) async throws -> Operations.ProjectsCreateForOrg.Output { - try await projectsCreateForOrg(Operations.ProjectsCreateForOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get 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 projectsGetCard( - path: Operations.ProjectsGetCard.Input.Path, - headers: Operations.ProjectsGetCard.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetCard.Output { - try await projectsGetCard(Operations.ProjectsGetCard.Input( - path: path, - headers: headers - )) - } - /// 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 projectsUpdateCard( - path: Operations.ProjectsUpdateCard.Input.Path, - headers: Operations.ProjectsUpdateCard.Input.Headers = .init(), - body: Operations.ProjectsUpdateCard.Input.Body? = nil - ) async throws -> Operations.ProjectsUpdateCard.Output { - try await projectsUpdateCard(Operations.ProjectsUpdateCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete 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 projectsDeleteCard( - path: Operations.ProjectsDeleteCard.Input.Path, - headers: Operations.ProjectsDeleteCard.Input.Headers = .init() - ) async throws -> Operations.ProjectsDeleteCard.Output { - try await projectsDeleteCard(Operations.ProjectsDeleteCard.Input( - path: path, - headers: headers - )) - } - /// 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 projectsMoveCard( - path: Operations.ProjectsMoveCard.Input.Path, - headers: Operations.ProjectsMoveCard.Input.Headers = .init(), - body: Operations.ProjectsMoveCard.Input.Body - ) async throws -> Operations.ProjectsMoveCard.Output { - try await projectsMoveCard(Operations.ProjectsMoveCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get 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 projectsGetColumn( - path: Operations.ProjectsGetColumn.Input.Path, - headers: Operations.ProjectsGetColumn.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetColumn.Output { - try await projectsGetColumn(Operations.ProjectsGetColumn.Input( - path: path, - headers: headers - )) - } - /// 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 projectsUpdateColumn( - path: Operations.ProjectsUpdateColumn.Input.Path, - headers: Operations.ProjectsUpdateColumn.Input.Headers = .init(), - body: Operations.ProjectsUpdateColumn.Input.Body - ) async throws -> Operations.ProjectsUpdateColumn.Output { - try await projectsUpdateColumn(Operations.ProjectsUpdateColumn.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete 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 projectsDeleteColumn( - path: Operations.ProjectsDeleteColumn.Input.Path, - headers: Operations.ProjectsDeleteColumn.Input.Headers = .init() - ) async throws -> Operations.ProjectsDeleteColumn.Output { - try await projectsDeleteColumn(Operations.ProjectsDeleteColumn.Input( - path: path, - headers: headers - )) - } - /// List project cards - /// - /// > [!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 projectsListCards( - path: Operations.ProjectsListCards.Input.Path, - query: Operations.ProjectsListCards.Input.Query = .init(), - headers: Operations.ProjectsListCards.Input.Headers = .init() - ) async throws -> Operations.ProjectsListCards.Output { - try await projectsListCards(Operations.ProjectsListCards.Input( - path: path, - query: query, - headers: headers - )) - } - /// 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 projectsCreateCard( - path: Operations.ProjectsCreateCard.Input.Path, - headers: Operations.ProjectsCreateCard.Input.Headers = .init(), - body: Operations.ProjectsCreateCard.Input.Body - ) async throws -> Operations.ProjectsCreateCard.Output { - try await projectsCreateCard(Operations.ProjectsCreateCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// 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 projectsMoveColumn( - path: Operations.ProjectsMoveColumn.Input.Path, - headers: Operations.ProjectsMoveColumn.Input.Headers = .init(), - body: Operations.ProjectsMoveColumn.Input.Body - ) async throws -> Operations.ProjectsMoveColumn.Output { - try await projectsMoveColumn(Operations.ProjectsMoveColumn.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get 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}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - public func projectsGet( - path: Operations.ProjectsGet.Input.Path, - headers: Operations.ProjectsGet.Input.Headers = .init() - ) async throws -> Operations.ProjectsGet.Output { - try await projectsGet(Operations.ProjectsGet.Input( - path: path, - headers: headers - )) - } - /// Update 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 `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - public func projectsUpdate( - path: Operations.ProjectsUpdate.Input.Path, - headers: Operations.ProjectsUpdate.Input.Headers = .init(), - body: Operations.ProjectsUpdate.Input.Body? = nil - ) async throws -> Operations.ProjectsUpdate.Output { - try await projectsUpdate(Operations.ProjectsUpdate.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete 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 `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - public func projectsDelete( - path: Operations.ProjectsDelete.Input.Path, - headers: Operations.ProjectsDelete.Input.Headers = .init() - ) async throws -> Operations.ProjectsDelete.Output { - try await projectsDelete(Operations.ProjectsDelete.Input( - path: path, - headers: headers - )) - } - /// List project 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 projectsListCollaborators( - path: Operations.ProjectsListCollaborators.Input.Path, - query: Operations.ProjectsListCollaborators.Input.Query = .init(), - headers: Operations.ProjectsListCollaborators.Input.Headers = .init() - ) async throws -> Operations.ProjectsListCollaborators.Output { - try await projectsListCollaborators(Operations.ProjectsListCollaborators.Input( - path: path, - query: query, - headers: headers - )) - } - /// Add project 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 projectsAddCollaborator( - path: Operations.ProjectsAddCollaborator.Input.Path, - headers: Operations.ProjectsAddCollaborator.Input.Headers = .init(), - body: Operations.ProjectsAddCollaborator.Input.Body? = nil - ) async throws -> Operations.ProjectsAddCollaborator.Output { - try await projectsAddCollaborator(Operations.ProjectsAddCollaborator.Input( - path: path, - headers: headers, - body: body - )) - } - /// Remove user as 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 projectsRemoveCollaborator( - path: Operations.ProjectsRemoveCollaborator.Input.Path, - headers: Operations.ProjectsRemoveCollaborator.Input.Headers = .init() - ) async throws -> Operations.ProjectsRemoveCollaborator.Output { - try await projectsRemoveCollaborator(Operations.ProjectsRemoveCollaborator.Input( - path: path, - headers: headers - )) - } - /// Get project permission 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 /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 projectsGetPermissionForUser( - path: Operations.ProjectsGetPermissionForUser.Input.Path, - headers: Operations.ProjectsGetPermissionForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetPermissionForUser.Output { - try await projectsGetPermissionForUser(Operations.ProjectsGetPermissionForUser.Input( - path: path, - headers: headers - )) - } - /// List project columns - /// - /// > [!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 projectsListColumns( - path: Operations.ProjectsListColumns.Input.Path, - query: Operations.ProjectsListColumns.Input.Query = .init(), - headers: Operations.ProjectsListColumns.Input.Headers = .init() - ) async throws -> Operations.ProjectsListColumns.Output { - try await projectsListColumns(Operations.ProjectsListColumns.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create 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/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - public func projectsCreateColumn( - path: Operations.ProjectsCreateColumn.Input.Path, - headers: Operations.ProjectsCreateColumn.Input.Headers = .init(), - body: Operations.ProjectsCreateColumn.Input.Body - ) async throws -> Operations.ProjectsCreateColumn.Output { - try await projectsCreateColumn(Operations.ProjectsCreateColumn.Input( - path: path, - headers: headers, - body: body - )) - } - /// List repository 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 /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - public func projectsListForRepo( - path: Operations.ProjectsListForRepo.Input.Path, - query: Operations.ProjectsListForRepo.Input.Query = .init(), - headers: Operations.ProjectsListForRepo.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForRepo.Output { - try await projectsListForRepo(Operations.ProjectsListForRepo.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a repository 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 `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - public func projectsCreateForRepo( - path: Operations.ProjectsCreateForRepo.Input.Path, - headers: Operations.ProjectsCreateForRepo.Input.Headers = .init(), - body: Operations.ProjectsCreateForRepo.Input.Body - ) async throws -> Operations.ProjectsCreateForRepo.Output { - try await projectsCreateForRepo(Operations.ProjectsCreateForRepo.Input( - path: path, - headers: headers, - body: body - )) - } - /// Create a user 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 `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - public func projectsCreateForAuthenticatedUser( - headers: Operations.ProjectsCreateForAuthenticatedUser.Input.Headers = .init(), - body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body - ) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output { - try await projectsCreateForAuthenticatedUser(Operations.ProjectsCreateForAuthenticatedUser.Input( - headers: headers, - body: body - )) - } - /// List user 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 /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - public func projectsListForUser( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForUser.Output { - try await projectsListForUser(Operations.ProjectsListForUser.Input( - path: path, - query: query, - headers: headers - )) - } } /// Server URLs defined in the OpenAPI document. @@ -771,8146 +38,16 @@ 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 { - /// A GitHub user. - /// - /// - Remark: Generated from `#/components/schemas/simple-user`. - public struct SimpleUser: 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 nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. - public var gravatarId: 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 htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. - public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. - public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. - public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. - public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. - public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. - public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. - public var receivedEventsUrl: 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 siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. - public var starredAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `SimpleUser`. - /// - /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: - /// - url: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - reposUrl: - /// - eventsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - starredAt: - /// - userViewType: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - nodeId: Swift.String, - avatarUrl: Swift.String, - gravatarId: Swift.String? = nil, - url: Swift.String, - htmlUrl: Swift.String, - followersUrl: Swift.String, - followingUrl: Swift.String, - gistsUrl: Swift.String, - starredUrl: Swift.String, - subscriptionsUrl: Swift.String, - organizationsUrl: Swift.String, - reposUrl: Swift.String, - eventsUrl: Swift.String, - receivedEventsUrl: Swift.String, - _type: Swift.String, - siteAdmin: Swift.Bool, - starredAt: Swift.String? = nil, - userViewType: Swift.String? = nil - ) { - self.name = name - self.email = email - self.login = login - self.id = id - self.nodeId = nodeId - self.avatarUrl = avatarUrl - self.gravatarId = gravatarId - self.url = url - self.htmlUrl = htmlUrl - self.followersUrl = followersUrl - self.followingUrl = followingUrl - self.gistsUrl = gistsUrl - self.starredUrl = starredUrl - self.subscriptionsUrl = subscriptionsUrl - self.organizationsUrl = organizationsUrl - self.reposUrl = reposUrl - self.eventsUrl = eventsUrl - self.receivedEventsUrl = receivedEventsUrl - self._type = _type - self.siteAdmin = siteAdmin - self.starredAt = starredAt - self.userViewType = userViewType - } - public enum CodingKeys: String, CodingKey { - case name - case email - case login - case id - case nodeId = "node_id" - case avatarUrl = "avatar_url" - case gravatarId = "gravatar_id" - case url - case htmlUrl = "html_url" - case followersUrl = "followers_url" - case followingUrl = "following_url" - case gistsUrl = "gists_url" - case starredUrl = "starred_url" - case subscriptionsUrl = "subscriptions_url" - case organizationsUrl = "organizations_url" - case reposUrl = "repos_url" - case eventsUrl = "events_url" - case receivedEventsUrl = "received_events_url" - case _type = "type" - case siteAdmin = "site_admin" - case starredAt = "starred_at" - case userViewType = "user_view_type" - } - } - /// Basic Error - /// - /// - Remark: Generated from `#/components/schemas/basic-error`. - public struct BasicError: 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 documentationUrl: 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 `BasicError`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - url: - /// - status: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - url: Swift.String? = nil, - status: Swift.String? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.url = url - self.status = status - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case url - case status - } - } - /// Validation Error Simple - /// - /// - Remark: Generated from `#/components/schemas/validation-error-simple`. - public struct ValidationErrorSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. - public var documentationUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. - public var errors: [Swift.String]? - /// Creates a new `ValidationErrorSimple`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String, - documentationUrl: Swift.String, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// Validation Error - /// - /// - Remark: Generated from `#/components/schemas/validation-error`. - public struct ValidationError: 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 documentationUrl: 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.ValidationError.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.ValidationError.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.ValidationError.ErrorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/validation-error/errors`. - public var errors: Components.Schemas.ValidationError.ErrorsPayload? - /// Creates a new `ValidationError`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String, - documentationUrl: Swift.String, - errors: Components.Schemas.ValidationError.ErrorsPayload? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// A GitHub user. - /// - /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. - public struct NullableSimpleUser: 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 nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. - public var gravatarId: 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 htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. - public var followersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. - public var followingUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. - public var gistsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. - public var starredUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. - public var subscriptionsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. - public var organizationsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. - public var receivedEventsUrl: 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 siteAdmin: Swift.Bool - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. - public var starredAt: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. - public var userViewType: Swift.String? - /// Creates a new `NullableSimpleUser`. - /// - /// - Parameters: - /// - name: - /// - email: - /// - login: - /// - id: - /// - nodeId: - /// - avatarUrl: - /// - gravatarId: - /// - url: - /// - htmlUrl: - /// - followersUrl: - /// - followingUrl: - /// - gistsUrl: - /// - starredUrl: - /// - subscriptionsUrl: - /// - organizationsUrl: - /// - reposUrl: - /// - eventsUrl: - /// - receivedEventsUrl: - /// - _type: - /// - siteAdmin: - /// - starredAt: - /// - userViewType: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - login: Swift.String, - id: Swift.Int64, - nodeId: Swift.String, - avatarUrl: Swift.String, - gravatarId: Swift.String? = nil, - url: Swift.String, - htmlUrl: Swift.String, - followersUrl: Swift.String, - followingUrl: Swift.String, - gistsUrl: Swift.String, - starredUrl: Swift.String, - subscriptionsUrl: Swift.String, - organizationsUrl: Swift.String, - reposUrl: Swift.String, - eventsUrl: Swift.String, - receivedEventsUrl: Swift.String, - _type: Swift.String, - siteAdmin: Swift.Bool, - starredAt: Swift.String? = nil, - userViewType: Swift.String? = nil - ) { - self.name = name - self.email = email - self.login = login - self.id = id - self.nodeId = nodeId - self.avatarUrl = avatarUrl - self.gravatarId = gravatarId - self.url = url - self.htmlUrl = htmlUrl - self.followersUrl = followersUrl - self.followingUrl = followingUrl - self.gistsUrl = gistsUrl - self.starredUrl = starredUrl - self.subscriptionsUrl = subscriptionsUrl - self.organizationsUrl = organizationsUrl - self.reposUrl = reposUrl - self.eventsUrl = eventsUrl - self.receivedEventsUrl = receivedEventsUrl - self._type = _type - self.siteAdmin = siteAdmin - self.starredAt = starredAt - self.userViewType = userViewType - } - public enum CodingKeys: String, CodingKey { - case name - case email - case login - case id - case nodeId = "node_id" - case avatarUrl = "avatar_url" - case gravatarId = "gravatar_id" - case url - case htmlUrl = "html_url" - case followersUrl = "followers_url" - case followingUrl = "following_url" - case gistsUrl = "gists_url" - case starredUrl = "starred_url" - case subscriptionsUrl = "subscriptions_url" - case organizationsUrl = "organizations_url" - case reposUrl = "repos_url" - case eventsUrl = "events_url" - case receivedEventsUrl = "received_events_url" - case _type = "type" - case siteAdmin = "site_admin" - case starredAt = "starred_at" - case userViewType = "user_view_type" - } - } - /// Projects are a way to organize columns and cards of work. - /// - /// - Remark: Generated from `#/components/schemas/project`. - public struct Project: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project/owner_url`. - public var ownerUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/project/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/columns_url`. - public var columnsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/project/node_id`. - public var nodeId: Swift.String - /// Name of the project - /// - /// - Remark: Generated from `#/components/schemas/project/name`. - public var name: Swift.String - /// Body of the project - /// - /// - Remark: Generated from `#/components/schemas/project/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/project/number`. - public var number: Swift.Int - /// State of the project; either 'open' or 'closed' - /// - /// - Remark: Generated from `#/components/schemas/project/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/project/creator`. - public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/project/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project/updated_at`. - public var updatedAt: Foundation.Date - /// The baseline permission that all organization members have on this project. Only present if owner is an organization. - /// - /// - Remark: Generated from `#/components/schemas/project/organization_permission`. - @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" - } - /// The baseline permission that all organization members have on this project. Only present if owner is an organization. - /// - /// - Remark: Generated from `#/components/schemas/project/organization_permission`. - public var organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? - /// Whether or not this project can be seen by everyone. Only present if owner is an organization. - /// - /// - Remark: Generated from `#/components/schemas/project/private`. - public var _private: Swift.Bool? - /// Creates a new `Project`. - /// - /// - Parameters: - /// - ownerUrl: - /// - url: - /// - htmlUrl: - /// - columnsUrl: - /// - id: - /// - nodeId: - /// - name: Name of the project - /// - body: Body of the project - /// - number: - /// - state: State of the project; either 'open' or 'closed' - /// - creator: - /// - createdAt: - /// - updatedAt: - /// - organizationPermission: The baseline permission that all organization members have on this project. Only present if owner is an organization. - /// - _private: Whether or not this project can be seen by everyone. Only present if owner is an organization. - public init( - ownerUrl: Swift.String, - url: Swift.String, - htmlUrl: Swift.String, - columnsUrl: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - name: Swift.String, - body: Swift.String? = nil, - number: Swift.Int, - state: Swift.String, - creator: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? = nil, - _private: Swift.Bool? = nil - ) { - self.ownerUrl = ownerUrl - self.url = url - self.htmlUrl = htmlUrl - self.columnsUrl = columnsUrl - self.id = id - self.nodeId = nodeId - self.name = name - self.body = body - self.number = number - self.state = state - self.creator = creator - self.createdAt = createdAt - self.updatedAt = updatedAt - self.organizationPermission = organizationPermission - self._private = _private - } - public enum CodingKeys: String, CodingKey { - case ownerUrl = "owner_url" - case url - case htmlUrl = "html_url" - case columnsUrl = "columns_url" - case id - case nodeId = "node_id" - case name - case body - case number - case state - case creator - case createdAt = "created_at" - case updatedAt = "updated_at" - case organizationPermission = "organization_permission" - case _private = "private" - } - } - /// Project cards represent a scope of work. - /// - /// - Remark: Generated from `#/components/schemas/project-card`. - public struct ProjectCard: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-card/url`. - public var url: Swift.String - /// The project card's ID - /// - /// - Remark: Generated from `#/components/schemas/project-card/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/project-card/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/project-card/note`. - public var note: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/creator`. - public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/project-card/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project-card/updated_at`. - public var updatedAt: Foundation.Date - /// Whether or not the card is archived - /// - /// - Remark: Generated from `#/components/schemas/project-card/archived`. - public var archived: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/project-card/column_name`. - public var columnName: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/project_id`. - public var projectId: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/column_url`. - public var columnUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project-card/content_url`. - public var contentUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/project_url`. - public var projectUrl: Swift.String - /// Creates a new `ProjectCard`. - /// - /// - Parameters: - /// - url: - /// - id: The project card's ID - /// - nodeId: - /// - note: - /// - creator: - /// - createdAt: - /// - updatedAt: - /// - archived: Whether or not the card is archived - /// - columnName: - /// - projectId: - /// - columnUrl: - /// - contentUrl: - /// - projectUrl: - public init( - url: Swift.String, - id: Swift.Int64, - nodeId: Swift.String, - note: Swift.String? = nil, - creator: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - archived: Swift.Bool? = nil, - columnName: Swift.String? = nil, - projectId: Swift.String? = nil, - columnUrl: Swift.String, - contentUrl: Swift.String? = nil, - projectUrl: Swift.String - ) { - self.url = url - self.id = id - self.nodeId = nodeId - self.note = note - self.creator = creator - self.createdAt = createdAt - self.updatedAt = updatedAt - self.archived = archived - self.columnName = columnName - self.projectId = projectId - self.columnUrl = columnUrl - self.contentUrl = contentUrl - self.projectUrl = projectUrl - } - public enum CodingKeys: String, CodingKey { - case url - case id - case nodeId = "node_id" - case note - case creator - case createdAt = "created_at" - case updatedAt = "updated_at" - case archived - case columnName = "column_name" - case projectId = "project_id" - case columnUrl = "column_url" - case contentUrl = "content_url" - case projectUrl = "project_url" - } - } - /// Project columns contain cards of work. - /// - /// - Remark: Generated from `#/components/schemas/project-column`. - public struct ProjectColumn: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-column/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/project_url`. - public var projectUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/cards_url`. - public var cardsUrl: Swift.String - /// The unique identifier of the project column - /// - /// - Remark: Generated from `#/components/schemas/project-column/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/project-column/node_id`. - public var nodeId: Swift.String - /// Name of the project column - /// - /// - Remark: Generated from `#/components/schemas/project-column/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project-column/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `ProjectColumn`. - /// - /// - Parameters: - /// - url: - /// - projectUrl: - /// - cardsUrl: - /// - id: The unique identifier of the project column - /// - nodeId: - /// - name: Name of the project column - /// - createdAt: - /// - updatedAt: - public init( - url: Swift.String, - projectUrl: Swift.String, - cardsUrl: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - name: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.url = url - self.projectUrl = projectUrl - self.cardsUrl = cardsUrl - self.id = id - self.nodeId = nodeId - self.name = name - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case url - case projectUrl = "project_url" - case cardsUrl = "cards_url" - case id - case nodeId = "node_id" - case name - case createdAt = "created_at" - case updatedAt = "updated_at" - } - } - /// Project Collaborator Permission - /// - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission`. - public struct ProjectCollaboratorPermission: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `ProjectCollaboratorPermission`. - /// - /// - Parameters: - /// - permission: - /// - user: - public init( - permission: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.permission = permission - self.user = user - } - public enum CodingKeys: String, CodingKey { - case permission - case user - } - } - } + public enum Schemas {} /// 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 PerPage = 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 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 handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/components/parameters/project-id`. - public typealias ProjectId = Swift.Int - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/components/parameters/card-id`. - public typealias CardId = Swift.Int - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/components/parameters/column-id`. - public typealias ColumnId = Swift.Int - } + public enum Parameters {} /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct ValidationFailedSimple: 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.ValidationErrorSimple) - /// 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.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body - /// Creates a new `ValidationFailedSimple`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailedSimple.Body) { - self.body = body - } - } - public struct NotFound: 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.BasicError) - /// 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.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body - } - } - public struct ValidationFailed: 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.ValidationError) - /// 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.ValidationError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailed.Body - /// Creates a new `ValidationFailed`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailed.Body) { - self.body = body - } - } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} - } - public struct RequiresAuthentication: 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.BasicError) - /// 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.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.RequiresAuthentication.Body - /// Creates a new `RequiresAuthentication`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.RequiresAuthentication.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.BasicError) - /// 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.BasicError { - 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 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.BasicError) - /// 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.BasicError { - 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 - } - } - } + 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 - } + public enum Headers {} } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List organization 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}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - public enum ProjectsListForOrg { - public static let id: Swift.String = "projects/list-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/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.ProjectsListForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. - public var state: Operations.ProjectsListForOrg.Input.Query.StatePayload? - /// 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}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: 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( - state: Operations.ProjectsListForOrg.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.state = state - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projects/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.ProjectsListForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListForOrg.Input.Path, - query: Operations.ProjectsListForOrg.Input.Query = .init(), - headers: Operations.ProjectsListForOrg.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}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/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.ProjectsListForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) - /// 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.Project] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForOrg.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.ProjectsListForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 - ] - } - } - } - /// Create an organization 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 `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - public enum ProjectsCreateForOrg { - public static let id: Swift.String = "projects/create-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/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.ProjectsCreateForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projects/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.ProjectsCreateForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// The description of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the project. - /// - body: The description of the project. - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body - } - public enum CodingKeys: String, CodingKey { - case name - case body - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateForOrg.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsCreateForOrg.Input.Path, - headers: Operations.ProjectsCreateForOrg.Input.Headers = .init(), - body: Operations.ProjectsCreateForOrg.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}/projects/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) - /// 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.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForOrg.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForOrg.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.ProjectsCreateForOrg.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-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}/projects/post(projects/create-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 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)`. - public enum ProjectsGetCard { - public static let id: Swift.String = "projects/get-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsGetCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_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.ProjectsGetCard.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsGetCard.Input.Path, - headers: Operations.ProjectsGetCard.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCard) - /// 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.ProjectCard { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGetCard.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetCard.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetCard.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.ProjectsGetCard.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//projects/columns/cards/{card_id}/get(projects/get-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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 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)`. - public enum ProjectsUpdateCard { - public static let id: Swift.String = "projects/update-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsUpdateCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_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.ProjectsUpdateCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The project card's note - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/note`. - public var note: Swift.String? - /// Whether or not the card is archived - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/archived`. - public var archived: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - note: The project card's note - /// - archived: Whether or not the card is archived - public init( - note: Swift.String? = nil, - archived: Swift.Bool? = nil - ) { - self.note = note - self.archived = archived - } - public enum CodingKeys: String, CodingKey { - case note - case archived - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateCard.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateCard.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsUpdateCard.Input.Path, - headers: Operations.ProjectsUpdateCard.Input.Headers = .init(), - body: Operations.ProjectsUpdateCard.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCard) - /// 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.ProjectCard { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdateCard.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateCard.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateCard.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.ProjectsUpdateCard.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//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 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)`. - public enum ProjectsDeleteCard { - public static let id: Swift.String = "projects/delete-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsDeleteCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_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.ProjectsDeleteCard.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDeleteCard.Input.Path, - headers: Operations.ProjectsDeleteCard.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//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteCard.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ProjectsDeleteCard.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/application\/json`. - case json(Operations.ProjectsDeleteCard.Output.Forbidden.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.ProjectsDeleteCard.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsDeleteCard.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsDeleteCard.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsDeleteCard.Output.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: Operations.ProjectsDeleteCard.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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 - ] - } - } - } - /// 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)`. - public enum ProjectsMoveCard { - public static let id: Swift.String = "projects/move-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsMoveCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/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.ProjectsMoveCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/position`. - public var position: Swift.String - /// The unique identifier of the column the card should be moved to - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/column_id`. - public var columnId: Swift.Int? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - position: The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. - /// - columnId: The unique identifier of the column the card should be moved to - public init( - position: Swift.String, - columnId: Swift.Int? = nil - ) { - self.position = position - self.columnId = columnId - } - public enum CodingKeys: String, CodingKey { - case position - case columnId = "column_id" - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsMoveCard.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsMoveCard.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsMoveCard.Input.Path, - headers: Operations.ProjectsMoveCard.Input.Headers = .init(), - body: Operations.ProjectsMoveCard.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/projects/columns/cards/{card_id}/moves/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Creates a new `JsonPayload`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.Created.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.ProjectsMoveCard.Output.Created.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsMoveCard.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.ProjectsMoveCard.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/field`. - public var field: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - resource: - /// - field: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - resource: Swift.String? = nil, - field: Swift.String? = nil - ) { - self.code = code - self.message = message - self.resource = resource - self.field = field - } - public enum CodingKeys: String, CodingKey { - case code - case message - case resource - case field - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. - public var errors: Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.Forbidden.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.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsMoveCard.Output.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: Operations.ProjectsMoveCard.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil - ) { - self.code = code - self.message = message - } - public enum CodingKeys: String, CodingKey { - case code - case message - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. - public var errors: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.ServiceUnavailable.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.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ProjectsMoveCard.Output.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ProjectsMoveCard.Output.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - 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 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)`. - public enum ProjectsGetColumn { - public static let id: Swift.String = "projects/get-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsGetColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_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.ProjectsGetColumn.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsGetColumn.Input.Path, - headers: Operations.ProjectsGetColumn.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectColumn) - /// 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.ProjectColumn { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGetColumn.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetColumn.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetColumn.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.ProjectsGetColumn.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//projects/columns/{column_id}/get(projects/get-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/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//projects/columns/{column_id}/get(projects/get-column)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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)`. - public enum ProjectsUpdateColumn { - public static let id: Swift.String = "projects/update-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsUpdateColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_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.ProjectsUpdateColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project column - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project column - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateColumn.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsUpdateColumn.Input.Path, - headers: Operations.ProjectsUpdateColumn.Input.Headers = .init(), - body: Operations.ProjectsUpdateColumn.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/projects/columns/{column_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectColumn) - /// 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.ProjectColumn { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdateColumn.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateColumn.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateColumn.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.ProjectsUpdateColumn.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//projects/columns/{column_id}/patch(projects/update-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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)`. - public enum ProjectsDeleteColumn { - public static let id: Swift.String = "projects/delete-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsDeleteColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_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.ProjectsDeleteColumn.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDeleteColumn.Input.Path, - headers: Operations.ProjectsDeleteColumn.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//projects/columns/{column_id}/delete(projects/delete-column)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteColumn.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ProjectsDeleteColumn.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 project cards - /// - /// > [!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)`. - public enum ProjectsListCards { - public static let id: Swift.String = "projects/list-cards" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsListCards.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. - @frozen public enum ArchivedStatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case archived = "archived" - case notArchived = "not_archived" - } - /// Filters the project cards that are returned by the card's state. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. - public var archivedState: Operations.ProjectsListCards.Input.Query.ArchivedStatePayload? - /// 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/projects/columns/{column_id}/cards/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/projects/columns/{column_id}/cards/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - archivedState: Filters the project cards that are returned by the card's state. - /// - perPage: 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( - archivedState: Operations.ProjectsListCards.Input.Query.ArchivedStatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.archivedState = archivedState - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListCards.Input.Query - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/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.ProjectsListCards.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListCards.Input.Path, - query: Operations.ProjectsListCards.Input.Query = .init(), - headers: Operations.ProjectsListCards.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/projects/columns/{column_id}/cards/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/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.ProjectsListCards.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectCard]) - /// 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.ProjectCard] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListCards.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListCards.Output.Ok.Headers = .init(), - body: Operations.ProjectsListCards.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListCards.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.ProjectsListCards.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//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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)`. - public enum ProjectsCreateCard { - public static let id: Swift.String = "projects/create-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsCreateCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/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.ProjectsCreateCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The project card's note - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1/note`. - public var note: Swift.String? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - note: The project card's note - public init(note: Swift.String? = nil) { - self.note = note - } - public enum CodingKeys: String, CodingKey { - case note - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. - case case1(Operations.ProjectsCreateCard.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// The unique identifier of the content associated with the card - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_id`. - public var contentId: Swift.Int - /// The piece of content associated with the card - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_type`. - public var contentType: Swift.String - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - contentId: The unique identifier of the content associated with the card - /// - contentType: The piece of content associated with the card - public init( - contentId: Swift.Int, - contentType: Swift.String - ) { - self.contentId = contentId - self.contentType = contentType - } - public enum CodingKeys: String, CodingKey { - case contentId = "content_id" - case contentType = "content_type" - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. - case case2(Operations.ProjectsCreateCard.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateCard.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateCard.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsCreateCard.Input.Path, - headers: Operations.ProjectsCreateCard.Input.Headers = .init(), - body: Operations.ProjectsCreateCard.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/projects/columns/{column_id}/cards/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectCard) - /// 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.ProjectCard { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateCard.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.ProjectsCreateCard.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - public struct UnprocessableContent: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case1`. - case ValidationError(Components.Schemas.ValidationError) - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case2`. - case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .ValidationError(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .ValidationErrorSimple(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 .ValidationError(value): - try value.encode(to: encoder) - case let .ValidationErrorSimple(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/application\/json`. - case json(Operations.ProjectsCreateCard.Output.UnprocessableContent.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.ProjectsCreateCard.Output.UnprocessableContent.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body - /// Creates a new `UnprocessableContent`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body) { - self.body = body - } - } - /// Validation failed - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.ProjectsCreateCard.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.ProjectsCreateCard.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil - ) { - self.code = code - self.message = message - } - public enum CodingKeys: String, CodingKey { - case code - case message - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. - public var errors: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/application\/json`. - case json(Operations.ProjectsCreateCard.Output.ServiceUnavailable.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.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ProjectsCreateCard.Output.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ProjectsCreateCard.Output.ServiceUnavailable { - 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 - ] - } - } - } - /// 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)`. - public enum ProjectsMoveColumn { - public static let id: Swift.String = "projects/move-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsMoveColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/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.ProjectsMoveColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json/position`. - public var position: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - position: The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. - public init(position: Swift.String) { - self.position = position - } - public enum CodingKeys: String, CodingKey { - case position - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsMoveColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsMoveColumn.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsMoveColumn.Input.Path, - headers: Operations.ProjectsMoveColumn.Input.Headers = .init(), - body: Operations.ProjectsMoveColumn.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/projects/columns/{column_id}/moves/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Creates a new `JsonPayload`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/application\/json`. - case json(Operations.ProjectsMoveColumn.Output.Created.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.ProjectsMoveColumn.Output.Created.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveColumn.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveColumn.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsMoveColumn.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.ProjectsMoveColumn.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/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 - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - public enum ProjectsGet { - public static let id: Swift.String = "projects/get" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsGet.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_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.ProjectsGet.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsGet.Input.Path, - headers: Operations.ProjectsGet.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Project) - /// 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.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGet.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGet.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGet.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.ProjectsGet.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//projects/{project_id}/get(projects/get)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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 `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - public enum ProjectsUpdate { - public static let id: Swift.String = "projects/update" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsUpdate.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_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.ProjectsUpdate.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// Body of the project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/body`. - public var body: Swift.String? - /// State of the project; either 'open' or 'closed' - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/state`. - public var state: Swift.String? - /// The baseline permission that all organization members have on this project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. - @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" - } - /// The baseline permission that all organization members have on this project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. - public var organizationPermission: Operations.ProjectsUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? - /// Whether or not this project can be seen by everyone. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/private`. - public var _private: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project - /// - body: Body of the project - /// - state: State of the project; either 'open' or 'closed' - /// - organizationPermission: The baseline permission that all organization members have on this project - /// - _private: Whether or not this project can be seen by everyone. - public init( - name: Swift.String? = nil, - body: Swift.String? = nil, - state: Swift.String? = nil, - organizationPermission: Operations.ProjectsUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? = nil, - _private: Swift.Bool? = nil - ) { - self.name = name - self.body = body - self.state = state - self.organizationPermission = organizationPermission - self._private = _private - } - public enum CodingKeys: String, CodingKey { - case name - case body - case state - case organizationPermission = "organization_permission" - case _private = "private" - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdate.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdate.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsUpdate.Input.Path, - headers: Operations.ProjectsUpdate.Input.Headers = .init(), - body: Operations.ProjectsUpdate.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.Project) - /// 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.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdate.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdate.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdate.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.ProjectsUpdate.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if the authenticated user does not have access to the project - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.ProjectsUpdate.Output.NotFound) - /// Not Found if the authenticated user does not have access to the project - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.ProjectsUpdate.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/application\/json`. - case json(Operations.ProjectsUpdate.Output.Forbidden.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.ProjectsUpdate.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdate.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdate.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsUpdate.Output.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: Operations.ProjectsUpdate.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 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 `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - public enum ProjectsDelete { - public static let id: Swift.String = "projects/delete" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsDelete.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_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.ProjectsDelete.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDelete.Input.Path, - headers: Operations.ProjectsDelete.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() {} - } - /// Delete Success - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDelete.Output.NoContent) - /// Delete Success - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ProjectsDelete.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/application\/json`. - case json(Operations.ProjectsDelete.Output.Forbidden.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.ProjectsDelete.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsDelete.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsDelete.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsDelete.Output.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: Operations.ProjectsDelete.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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 - ] - } - } - } - /// List project 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)`. - public enum ProjectsListCollaborators { - public static let id: Swift.String = "projects/list-collaborators" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsListCollaborators.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. - @frozen public enum AffiliationPayload: String, Codable, Hashable, Sendable, CaseIterable { - case outside = "outside" - case direct = "direct" - case all = "all" - } - /// Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. - public var affiliation: Operations.ProjectsListCollaborators.Input.Query.AffiliationPayload? - /// 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/projects/{project_id}/collaborators/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/projects/{project_id}/collaborators/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - affiliation: Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. - /// - perPage: 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( - affiliation: Operations.ProjectsListCollaborators.Input.Query.AffiliationPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.affiliation = affiliation - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListCollaborators.Input.Query - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/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.ProjectsListCollaborators.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListCollaborators.Input.Path, - query: Operations.ProjectsListCollaborators.Input.Query = .init(), - headers: Operations.ProjectsListCollaborators.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/projects/{project_id}/collaborators/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/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.ProjectsListCollaborators.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) - /// 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.SimpleUser] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListCollaborators.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListCollaborators.Output.Ok.Headers = .init(), - body: Operations.ProjectsListCollaborators.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListCollaborators.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.ProjectsListCollaborators.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//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 - ] - } - } - } - /// Add project 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)`. - public enum ProjectsAddCollaborator { - public static let id: Swift.String = "projects/add-collaborator" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - /// - username: The handle for the GitHub user account. - public init( - projectId: Components.Parameters.ProjectId, - username: Components.Parameters.Username - ) { - self.projectId = projectId - self.username = username - } - } - public var path: Operations.ProjectsAddCollaborator.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{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.ProjectsAddCollaborator.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The permission to grant the collaborator. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. - @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - } - /// The permission to grant the collaborator. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. - public var permission: Operations.ProjectsAddCollaborator.Input.Body.JsonPayload.PermissionPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - permission: The permission to grant the collaborator. - public init(permission: Operations.ProjectsAddCollaborator.Input.Body.JsonPayload.PermissionPayload? = nil) { - self.permission = permission - } - public enum CodingKeys: String, CodingKey { - case permission - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.ProjectsAddCollaborator.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsAddCollaborator.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsAddCollaborator.Input.Path, - headers: Operations.ProjectsAddCollaborator.Input.Headers = .init(), - body: Operations.ProjectsAddCollaborator.Input.Body? = nil - ) { - 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//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsAddCollaborator.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ProjectsAddCollaborator.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//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 user as 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)`. - public enum ProjectsRemoveCollaborator { - public static let id: Swift.String = "projects/remove-collaborator" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - /// - username: The handle for the GitHub user account. - public init( - projectId: Components.Parameters.ProjectId, - username: Components.Parameters.Username - ) { - self.projectId = projectId - self.username = username - } - } - public var path: Operations.ProjectsRemoveCollaborator.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/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.ProjectsRemoveCollaborator.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsRemoveCollaborator.Input.Path, - headers: Operations.ProjectsRemoveCollaborator.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//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsRemoveCollaborator.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// 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.ProjectsRemoveCollaborator.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/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 - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 project permission 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 /projects/{project_id}/collaborators/{username}/permission`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. - public enum ProjectsGetPermissionForUser { - public static let id: Swift.String = "projects/get-permission-for-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - /// - username: The handle for the GitHub user account. - public init( - projectId: Components.Parameters.ProjectId, - username: Components.Parameters.Username - ) { - self.projectId = projectId - self.username = username - } - } - public var path: Operations.ProjectsGetPermissionForUser.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/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.ProjectsGetPermissionForUser.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsGetPermissionForUser.Input.Path, - headers: Operations.ProjectsGetPermissionForUser.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCollaboratorPermission) - /// 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.ProjectCollaboratorPermission { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGetPermissionForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetPermissionForUser.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetPermissionForUser.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.ProjectsGetPermissionForUser.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//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - 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//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 project columns - /// - /// > [!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)`. - public enum ProjectsListColumns { - public static let id: Swift.String = "projects/list-columns" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsListColumns.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/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/projects/{project_id}/columns/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/projects/{project_id}/columns/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: 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( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListColumns.Input.Query - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/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.ProjectsListColumns.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListColumns.Input.Path, - query: Operations.ProjectsListColumns.Input.Query = .init(), - headers: Operations.ProjectsListColumns.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/projects/{project_id}/columns/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/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.ProjectsListColumns.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectColumn]) - /// 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.ProjectColumn] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListColumns.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListColumns.Output.Ok.Headers = .init(), - body: Operations.ProjectsListColumns.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListColumns.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.ProjectsListColumns.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//projects/{project_id}/columns/get(projects/list-columns)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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)`. - public enum ProjectsCreateColumn { - public static let id: Swift.String = "projects/create-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsCreateColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/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.ProjectsCreateColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project column - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project column - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateColumn.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsCreateColumn.Input.Path, - headers: Operations.ProjectsCreateColumn.Input.Headers = .init(), - body: Operations.ProjectsCreateColumn.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/projects/{project_id}/columns/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectColumn) - /// 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.ProjectColumn { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateColumn.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateColumn.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateColumn.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.ProjectsCreateColumn.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/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 - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - 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 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 /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - public enum ProjectsListForRepo { - public static let id: Swift.String = "projects/list-for-repo" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/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}/projects/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}/projects/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// 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. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.owner = owner - self.repo = repo - } - } - public var path: Operations.ProjectsListForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. - public var state: Operations.ProjectsListForRepo.Input.Query.StatePayload? - /// 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}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: 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( - state: Operations.ProjectsListForRepo.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.state = state - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/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.ProjectsListForRepo.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListForRepo.Input.Path, - query: Operations.ProjectsListForRepo.Input.Query = .init(), - headers: Operations.ProjectsListForRepo.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/repos/{owner}/{repo}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/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.ProjectsListForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) - /// 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.Project] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForRepo.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForRepo.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForRepo.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForRepo.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.ProjectsListForRepo.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/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//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 - ] - } - } - } - /// Create a repository 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 `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - public enum ProjectsCreateForRepo { - public static let id: Swift.String = "projects/create-for-repo" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/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}/projects/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}/projects/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// 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. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.owner = owner - self.repo = repo - } - } - public var path: Operations.ProjectsCreateForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/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.ProjectsCreateForRepo.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the project. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// The description of the project. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the project. - /// - body: The description of the project. - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body - } - public enum CodingKeys: String, CodingKey { - case name - case body - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForRepo.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateForRepo.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsCreateForRepo.Input.Path, - headers: Operations.ProjectsCreateForRepo.Input.Headers = .init(), - body: Operations.ProjectsCreateForRepo.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/repos/{owner}/{repo}/projects/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) - /// 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.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateForRepo.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForRepo.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForRepo.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.ProjectsCreateForRepo.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/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//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// 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.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 - ] - } - } - } - /// Create a user 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 `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - public enum ProjectsCreateForAuthenticatedUser { - public static let id: Swift.String = "projects/create-for-authenticated-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/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.ProjectsCreateForAuthenticatedUser.Input.Headers - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project - /// - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// Body of the project - /// - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project - /// - body: Body of the project - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body - } - public enum CodingKeys: String, CodingKey { - case name - case body - } - } - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForAuthenticatedUser.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - /// - body: - public init( - headers: Operations.ProjectsCreateForAuthenticatedUser.Input.Headers = .init(), - body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body - ) { - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) - /// 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.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateForAuthenticatedUser.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForAuthenticatedUser.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForAuthenticatedUser.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.ProjectsCreateForAuthenticatedUser.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// 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.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-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 - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// 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.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// 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.ValidationFailedSimple { - 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 - ] - } - } - } - /// List user 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 /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - public enum ProjectsListForUser { - public static let id: Swift.String = "projects/list-for-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path`. - public struct Path: Sendable, Hashable { - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username - } - } - public var path: Operations.ProjectsListForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. - public var state: Operations.ProjectsListForUser.Input.Query.StatePayload? - /// 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/users/{username}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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/users/{username}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: 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( - state: Operations.ProjectsListForUser.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.state = state - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ProjectsListForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projects/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.ProjectsListForUser.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.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/users/{username}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/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.ProjectsListForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) - /// 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.Project] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForUser.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForUser.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.ProjectsListForUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// 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.ValidationFailed { - 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 - ] - } - } - } -} +public enum Operations {} diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 4436fe2a884..1938d9d2eef 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -2291,6 +2291,41 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { /// Enable or disable GitHub Advanced Security for the repository. @@ -3692,6 +3727,8 @@ public enum Components { public var labels: Components.Schemas.IssueSearchResultItem.LabelsPayload /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state`. public var state: Swift.String /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state_reason`. @@ -3794,6 +3831,7 @@ public enum Components { /// - user: /// - labels: /// - subIssuesSummary: + /// - issueDependenciesSummary: /// - state: /// - stateReason: /// - assignee: @@ -3832,6 +3870,7 @@ public enum Components { user: Components.Schemas.NullableSimpleUser? = nil, labels: Components.Schemas.IssueSearchResultItem.LabelsPayload, subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, state: Swift.String, stateReason: Swift.String? = nil, assignee: Components.Schemas.NullableSimpleUser? = nil, @@ -3870,6 +3909,7 @@ public enum Components { self.user = user self.labels = labels self.subIssuesSummary = subIssuesSummary + self.issueDependenciesSummary = issueDependenciesSummary self.state = state self.stateReason = stateReason self.assignee = assignee @@ -3909,6 +3949,7 @@ public enum Components { case user case labels case subIssuesSummary = "sub_issues_summary" + case issueDependenciesSummary = "issue_dependencies_summary" case state case stateReason = "state_reason" case assignee diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index 1426ab854f5..5deb998490d 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -455,6 +455,310 @@ public struct Client: APIProtocol { } ) } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningListOrgPatternConfigs.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/pattern-configurations", + 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.SecretScanningListOrgPatternConfigs.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.SecretScanningPatternConfiguration.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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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 organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningUpdateOrgPatternConfigs.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/pattern-configurations", + parameters: [ + input.path.org + ] + ) + 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.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.SecretScanningUpdateOrgPatternConfigs.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 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(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.BasicError.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.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.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.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.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 + ) + ) + } + } + ) + } /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 2028f41043e..5316f43b1ff 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -35,6 +35,24 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. func secretScanningListAlertsForOrg(_ input: Operations.SecretScanningListAlertsForOrg.Input) async throws -> Operations.SecretScanningListAlertsForOrg.Output + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. @@ -147,6 +165,42 @@ extension APIProtocol { headers: headers )) } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public func secretScanningListOrgPatternConfigs( + path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers = .init() + ) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { + try await secretScanningListOrgPatternConfigs(Operations.SecretScanningListOrgPatternConfigs.Input( + path: path, + headers: headers + )) + } + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public func secretScanningUpdateOrgPatternConfigs( + path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + ) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + try await secretScanningUpdateOrgPatternConfigs(Operations.SecretScanningUpdateOrgPatternConfigs.Input( + path: path, + headers: headers, + body: body + )) + } /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. @@ -476,6 +530,180 @@ public enum Components { case status } } + /// Scim Error + /// + /// - Remark: Generated from `#/components/schemas/scim-error`. + public struct ScimError: 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 documentationUrl: 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 `ScimError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - detail: + /// - status: + /// - scimType: + /// - schemas: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + detail: Swift.String? = nil, + status: Swift.Int? = nil, + scimType: Swift.String? = nil, + schemas: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.detail = detail + self.status = status + self.scimType = scimType + self.schemas = schemas + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case detail + case status + case scimType + case schemas + } + } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: 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 documentationUrl: 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.ValidationError.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.ValidationError.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.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -1783,6 +2011,175 @@ public enum Components { case hasMoreLocations = "has_more_locations" } } + /// The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-row-version`. + public typealias SecretScanningRowVersion = Swift.String + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override`. + public struct SecretScanningPatternOverride: Codable, Hashable, Sendable { + /// The ID of the pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/token_type`. + public var tokenType: Swift.String? + /// The version of this pattern if it's a custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/custom_pattern_version`. + public var customPatternVersion: Swift.String? + /// The slug of the pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/slug`. + public var slug: Swift.String? + /// The user-friendly name for the pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/display_name`. + public var displayName: Swift.String? + /// The total number of alerts generated by this pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/alert_total`. + public var alertTotal: Swift.Int? + /// The percentage of all alerts that this pattern represents, rounded to the nearest integer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/alert_total_percentage`. + public var alertTotalPercentage: Swift.Int? + /// The number of false positive alerts generated by this pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/false_positives`. + public var falsePositives: Swift.Int? + /// The percentage of alerts from this pattern that are false positives, rounded to the nearest integer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/false_positive_rate`. + public var falsePositiveRate: Swift.Int? + /// The percentage of blocks for this pattern that were bypassed, rounded to the nearest integer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/bypass_rate`. + public var bypassRate: Swift.Int? + /// The default push protection setting for this pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/default_setting`. + @frozen public enum DefaultSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case enabled = "enabled" + } + /// The default push protection setting for this pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/default_setting`. + public var defaultSetting: Components.Schemas.SecretScanningPatternOverride.DefaultSettingPayload? + /// The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/enterprise_setting`. + @frozen public enum EnterpriseSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" + } + /// The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/enterprise_setting`. + public var enterpriseSetting: Components.Schemas.SecretScanningPatternOverride.EnterpriseSettingPayload? + /// The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/setting`. + @frozen public enum SettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" + } + /// The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/setting`. + public var setting: Components.Schemas.SecretScanningPatternOverride.SettingPayload? + /// Creates a new `SecretScanningPatternOverride`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern. + /// - customPatternVersion: The version of this pattern if it's a custom pattern. + /// - slug: The slug of the pattern. + /// - displayName: The user-friendly name for the pattern. + /// - alertTotal: The total number of alerts generated by this pattern. + /// - alertTotalPercentage: The percentage of all alerts that this pattern represents, rounded to the nearest integer. + /// - falsePositives: The number of false positive alerts generated by this pattern. + /// - falsePositiveRate: The percentage of alerts from this pattern that are false positives, rounded to the nearest integer. + /// - bypassRate: The percentage of blocks for this pattern that were bypassed, rounded to the nearest integer. + /// - defaultSetting: The default push protection setting for this pattern. + /// - enterpriseSetting: The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. + /// - setting: The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. + public init( + tokenType: Swift.String? = nil, + customPatternVersion: Swift.String? = nil, + slug: Swift.String? = nil, + displayName: Swift.String? = nil, + alertTotal: Swift.Int? = nil, + alertTotalPercentage: Swift.Int? = nil, + falsePositives: Swift.Int? = nil, + falsePositiveRate: Swift.Int? = nil, + bypassRate: Swift.Int? = nil, + defaultSetting: Components.Schemas.SecretScanningPatternOverride.DefaultSettingPayload? = nil, + enterpriseSetting: Components.Schemas.SecretScanningPatternOverride.EnterpriseSettingPayload? = nil, + setting: Components.Schemas.SecretScanningPatternOverride.SettingPayload? = nil + ) { + self.tokenType = tokenType + self.customPatternVersion = customPatternVersion + self.slug = slug + self.displayName = displayName + self.alertTotal = alertTotal + self.alertTotalPercentage = alertTotalPercentage + self.falsePositives = falsePositives + self.falsePositiveRate = falsePositiveRate + self.bypassRate = bypassRate + self.defaultSetting = defaultSetting + self.enterpriseSetting = enterpriseSetting + self.setting = setting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case customPatternVersion = "custom_pattern_version" + case slug + case displayName = "display_name" + case alertTotal = "alert_total" + case alertTotalPercentage = "alert_total_percentage" + case falsePositives = "false_positives" + case falsePositiveRate = "false_positive_rate" + case bypassRate = "bypass_rate" + case defaultSetting = "default_setting" + case enterpriseSetting = "enterprise_setting" + case setting + } + } + /// A collection of secret scanning patterns and their settings related to push protection. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration`. + public struct SecretScanningPatternConfiguration: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/pattern_config_version`. + public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? + /// Overrides for partner patterns. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/provider_pattern_overrides`. + public var providerPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? + /// Overrides for custom patterns defined by the organization. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/custom_pattern_overrides`. + public var customPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? + /// Creates a new `SecretScanningPatternConfiguration`. + /// + /// - Parameters: + /// - patternConfigVersion: + /// - providerPatternOverrides: Overrides for partner patterns. + /// - customPatternOverrides: Overrides for custom patterns defined by the organization. + public init( + patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, + providerPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? = nil, + customPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? = nil + ) { + self.patternConfigVersion = patternConfigVersion + self.providerPatternOverrides = providerPatternOverrides + self.customPatternOverrides = customPatternOverrides + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + case providerPatternOverrides = "provider_pattern_overrides" + case customPatternOverrides = "custom_pattern_overrides" + } + } /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. /// /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`. @@ -2495,10 +2892,146 @@ public enum Components { self.body = body } } + public struct BadRequest: 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.BasicError) + /// 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.BasicError { + 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 applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body + } + } + public struct ValidationFailed: 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.ValidationError) + /// 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.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } public struct NotModified: Sendable, Hashable { /// Creates a new `NotModified`. 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.BasicError) + /// 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.BasicError { + 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.BasicError) + /// 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.BasicError { + 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 ServiceUnavailable: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/service_unavailable/content`. @frozen public enum Body: Sendable, Hashable { @@ -3201,6 +3734,583 @@ public enum Operations { } } } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public enum SecretScanningListOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/list-org-pattern-configs" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-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.SecretScanningListOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-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.SecretScanningListOrgPatternConfigs.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningListOrgPatternConfigs.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}/secret-scanning/pattern-configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningPatternConfiguration) + /// 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.SecretScanningPatternConfiguration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListOrgPatternConfigs.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.SecretScanningListOrgPatternConfigs.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/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}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + 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 organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public enum SecretScanningUpdateOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/update-org-pattern-configs" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/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.SecretScanningUpdateOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/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.SecretScanningUpdateOrgPatternConfigs.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/pattern_config_version`. + public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload`. + public struct ProviderPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `ProviderPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public typealias ProviderPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload] + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public var providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload`. + public struct CustomPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/custom_pattern_version`. + public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `CustomPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - customPatternVersion: + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.customPatternVersion = customPatternVersion + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case customPatternVersion = "custom_pattern_version" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public typealias CustomPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload] + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public var customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: + /// - providerPatternSettings: Pattern settings for provider patterns. + /// - customPatternSettings: Pattern settings for custom patterns. + public init( + patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, + providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? = nil, + customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? = nil + ) { + self.patternConfigVersion = patternConfigVersion + self.providerPatternSettings = providerPatternSettings + self.customPatternSettings = customPatternSettings + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + case providerPatternSettings = "provider_pattern_settings" + case customPatternSettings = "custom_pattern_settings" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload) + } + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgPatternConfigs.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}/secret-scanning/pattern-configurations/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The updated pattern configuration version. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json/pattern_config_version`. + public var patternConfigVersion: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: The updated pattern configuration version. + public init(patternConfigVersion: Swift.String? = nil) { + self.patternConfigVersion = patternConfigVersion + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.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.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningUpdateOrgPatternConfigs.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.SecretScanningUpdateOrgPatternConfigs.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}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.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: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/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}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// 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.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/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 + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// 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.ValidationFailed { + 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 applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 389c5166eda..7187214c51f 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 389c5166eda781b7e2ce7e5d6f44ceabf895a5bb +Subproject commit 7187214c51f81537dd0b72ccc8c1af762d73f2c6