diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index 0f0bdd0424..bfeb01673d 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -38,21 +38,22 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// Get artifact and log retention settings for an organization + /// Get GitHub Actions cache usage for an organization /// - /// Gets 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope 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(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.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.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, + forOperation: Operations.ActionsGetActionsCacheUsageForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/artifact-and-log-retention", + template: "/orgs/{}/actions/cache/usage", parameters: [ input.path.org ] @@ -71,8 +72,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.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body + let body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -82,7 +88,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, + Components.Schemas.ActionsCacheUsageOrgEnterprise.self, from: responseBody, transforming: { value in .json(value) @@ -91,10 +97,77 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 403: + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repositories with GitHub Actions cache usage for an organization + /// + /// Lists repositories and their GitHub Actions cache usage for an organization. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. + public func actionsGetActionsCacheUsageByRepoForOrg(_ input: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetActionsCacheUsageByRepoForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/cache/usage-by-repository", + 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.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: Components.Responses.Forbidden.Body + let body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -104,7 +177,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -113,10 +186,76 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List GitHub-hosted runners for an organization + /// + /// Lists all GitHub-hosted runners configured in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. + public func actionsListHostedRunnersForOrg(_ input: Operations.ActionsListHostedRunnersForOrg.Input) async throws -> Operations.ActionsListHostedRunnersForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListHostedRunnersForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.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.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: Components.Responses.NotFound.Body + let body: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -126,7 +265,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -135,7 +274,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -148,28 +290,27 @@ public struct Client: APIProtocol { } ) } - /// Set artifact and log retention settings for an organization - /// - /// Sets artifact and log retention settings for an organization. + /// Create a GitHub-hosted runner 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. + /// 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 /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 { + /// - 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.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, + forOperation: Operations.ActionsCreateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/artifact-and-log-retention", + 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( @@ -189,11 +330,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -203,7 +342,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -212,10 +351,52 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public func actionsGetHostedRunnersGithubOwnedImagesForOrg(_ input: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/github-owned", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -225,7 +406,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -234,51 +415,7 @@ public struct Client: APIProtocol { 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)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -291,21 +428,19 @@ public struct Client: APIProtocol { } ) } - /// Get fork PR contributor approval permissions for an organization - /// - /// Gets the fork PR contributor approval policy for an organization. + /// Get partner images for GitHub-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. + /// Get the list of partner images available for GitHub-hosted runners for an organization. /// - /// - 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 { + /// - 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.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/fork-pr-contributor-approval", + template: "/orgs/{}/actions/hosted-runners/images/partner", parameters: [ input.path.org ] @@ -325,7 +460,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -335,7 +470,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsForkPrContributorApproval.self, + Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -345,28 +480,6 @@ 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, @@ -379,74 +492,39 @@ public struct Client: APIProtocol { } ) } - /// Set fork PR contributor approval permissions for an organization - /// - /// Sets the fork PR contributor approval policy 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 /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 { + /// - 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.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/fork-pr-contributor-approval", + template: "/orgs/{}/actions/hosted-runners/limits", parameters: [ 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 ) - 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 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: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -456,7 +534,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.ActionsHostedRunnerLimits.self, from: responseBody, transforming: { value in .json(value) @@ -465,7 +543,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, @@ -478,19 +556,19 @@ public struct Client: APIProtocol { } ) } - /// Get private repo fork PR workflow settings for an organization + /// Get GitHub-hosted runners machine specs for an organization /// - /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Get the list of machine specs available for GitHub-hosted runners for 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(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/fork-pr-workflows-private-repos", + template: "/orgs/{}/actions/hosted-runners/machine-sizes", parameters: [ input.path.org ] @@ -510,7 +588,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -520,7 +598,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, + Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -530,50 +608,6 @@ 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, @@ -586,50 +620,39 @@ public struct Client: APIProtocol { } ) } - /// Set private repo fork PR workflow settings for an organization + /// Get platforms for GitHub-hosted runners in an organization /// - /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Get the list of platforms available for GitHub-hosted runners for 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(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.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.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/fork-pr-workflows-private-repos", + template: "/orgs/{}/actions/hosted-runners/platforms", parameters: [ 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 ) - 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 204: - return .noContent(.init()) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body + let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -639,7 +662,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -648,80 +671,37 @@ public struct Client: APIProtocol { 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 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 + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) ) } } ) } - /// Get self-hosted runners settings for an organization + /// Get a GitHub-hosted runner for an organization /// - /// Gets the settings for self-hosted runners for an organization. + /// Gets a GitHub-hosted runner configured 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. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope 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 { + /// - 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.ActionsGetSelfHostedRunnersPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ - input.path.org + input.path.org, + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -738,52 +718,13 @@ 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.ActionsGetSelfHostedRunnersPermissionsOrganization.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.SelfHostedRunnersSettings.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 body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -793,7 +734,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -802,7 +743,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -815,28 +759,28 @@ public struct Client: APIProtocol { } ) } - /// Set self-hosted runners settings for an organization - /// - /// Sets the settings for self-hosted runners for an organization. + /// Update a GitHub-hosted runner 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. + /// 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 `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 { + /// - 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.ActionsSetSelfHostedRunnersPermissionsOrganization.id, + forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ - input.path.org + input.path.org, + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -856,11 +800,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -870,7 +812,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -879,54 +821,53 @@ public struct Client: APIProtocol { 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) - } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - 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: + } + } + ) + } + /// 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: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -936,7 +877,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -945,7 +886,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .accepted(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -958,21 +899,21 @@ public struct Client: APIProtocol { } ) } - /// List repositories allowed to use self-hosted runners in an organization + /// Get GitHub Actions permissions for an organization /// - /// Lists repositories that are 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope 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(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -982,20 +923,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 @@ -1006,7 +933,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1016,7 +943,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsOrganizationPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -1026,50 +953,6 @@ 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, @@ -1082,21 +965,21 @@ public struct Client: APIProtocol { } ) } - /// Set repositories allowed to use self-hosted runners in an organization + /// Set GitHub Actions permissions for an organization /// - /// Sets repositories that are 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope 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 { + /// - 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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -1106,10 +989,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): @@ -1125,9 +1004,53 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 403: + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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 /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", + 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: Components.Responses.Forbidden.Body + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1137,7 +1060,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, from: responseBody, transforming: { value in .json(value) @@ -1146,10 +1069,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .ok(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1168,10 +1091,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1181,7 +1104,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1190,7 +1113,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1203,24 +1126,23 @@ public struct Client: APIProtocol { } ) } - /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization + /// Set artifact and log retention settings for an organization /// - /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in 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/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 { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories/{}", + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1232,7 +1154,16 @@ public struct Client: APIProtocol { 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 { @@ -1338,29 +1269,28 @@ public struct Client: APIProtocol { } ) } - /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in 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 `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 { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/organizations/{}/actions/permissions/self-hosted-runners/repositories/{}", + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1371,11 +1301,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1385,7 +1313,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -1394,7 +1322,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .ok(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -1417,9 +1345,64 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 409: + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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 /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", + parameters: [ + input.path.org + ] + ) + 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 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1438,7 +1421,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .conflict(.init(body: body)) + return .notFound(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -1473,22 +1456,19 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions cache usage for an organization - /// - /// Gets the total GitHub Actions cache usage for an organization. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// Get private repo fork PR workflow settings for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an 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 func actionsGetActionsCacheUsageForOrg(_ input: Operations.ActionsGetActionsCacheUsageForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetActionsCacheUsageForOrg.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/cache/usage", + template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.org ] @@ -1507,13 +1487,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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1523,7 +1498,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheUsageOrgEnterprise.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -1532,12 +1507,53 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( + 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, @@ -1548,61 +1564,50 @@ public struct Client: APIProtocol { } ) } - /// 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. + /// Set private repo fork PR workflow settings for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an 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 func actionsGetActionsCacheUsageByRepoForOrg(_ input: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetActionsCacheUsageByRepoForOrg.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/cache/usage-by-repository", + template: "/orgs/{}/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) - 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: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1612,7 +1617,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) @@ -1621,10 +1626,51 @@ 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 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, @@ -1637,21 +1683,21 @@ public struct Client: APIProtocol { } ) } - /// List GitHub-hosted runners for an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Lists all GitHub-hosted runners configured in 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 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 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 /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.ActionsListHostedRunnersForOrg.id, + forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ input.path.org ] @@ -1684,13 +1730,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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1700,7 +1741,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1709,10 +1750,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, @@ -1725,33 +1763,31 @@ public struct Client: APIProtocol { } ) } - /// Create a GitHub-hosted runner for an organization + /// Set selected repositories enabled for GitHub Actions in 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. + /// 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)." /// - /// - 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 /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.ActionsCreateHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ input.path.org ] ) 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): @@ -1765,28 +1801,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.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)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1799,58 +1815,37 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for 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)." /// - /// - 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 { + /// 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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, + forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/github-owned", + template: "/orgs/{}/actions/permissions/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( - 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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1863,58 +1858,37 @@ public struct Client: APIProtocol { } ) } - /// Get partner images for GitHub-hosted runners in an organization + /// Disable a selected repository for GitHub Actions in an organization /// - /// Get the list of partner images available for GitHub-hosted runners 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)." /// - /// - 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 { + /// 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.ActionsGetHostedRunnersPartnerImagesForOrg.id, + forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/partner", + template: "/orgs/{}/actions/permissions/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - 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)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1927,19 +1901,21 @@ public struct Client: APIProtocol { } ) } - /// Get limits on GitHub-hosted runners for an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Get the GitHub-hosted runners limits 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)." /// - /// - 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 { + /// 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.ActionsGetHostedRunnersLimitsForOrg.id, + forOperation: Operations.ActionsGetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/limits", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ input.path.org ] @@ -1959,7 +1935,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + let body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1969,7 +1945,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerLimits.self, + Components.Schemas.SelectedActions.self, from: responseBody, transforming: { value in .json(value) @@ -1991,58 +1967,47 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-hosted runners machine specs for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Get the list of machine specs available for GitHub-hosted runners 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)." /// - /// - 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 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 { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, + forOperation: Operations.ActionsSetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/machine-sizes", + template: "/orgs/{}/actions/permissions/selected-actions", 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 .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.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -2055,19 +2020,21 @@ public struct Client: APIProtocol { } ) } - /// Get platforms for GitHub-hosted runners in an organization + /// Get self-hosted runners settings for an organization /// - /// Get the list of platforms 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/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 `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetHostedRunnersPlatformsForOrg.id, + forOperation: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/platforms", + template: "/orgs/{}/actions/permissions/self-hosted-runners", parameters: [ input.path.org ] @@ -2087,7 +2054,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + let body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2097,7 +2064,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.SelfHostedRunnersSettings.self, from: responseBody, transforming: { value in .json(value) @@ -2107,6 +2074,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, @@ -2119,47 +2130,52 @@ public struct Client: APIProtocol { } ) } - /// Get a GitHub-hosted runner for an organization + /// Set self-hosted runners settings for an organization /// - /// Gets a GitHub-hosted runner configured in an organization. + /// Sets the settings for self-hosted runners for 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 `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetHostedRunnerForOrg.id, + forOperation: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners", parameters: [ - input.path.org, - input.path.hostedRunnerId + 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: - let headers: Operations.ActionsGetHostedRunnerForOrg.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.ActionsGetHostedRunnerForOrg.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2169,7 +2185,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) @@ -2178,66 +2194,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a GitHub-hosted runner for an organization - /// - /// Updates a GitHub-hosted runner for an organization. - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. - public func actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsUpdateHostedRunnerForOrg.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: .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: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2247,7 +2207,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) @@ -2256,53 +2216,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 .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" + ] ) - } - } - ) - } - /// 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 .conflict(.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: [ @@ -2312,7 +2251,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) @@ -2321,7 +2260,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, @@ -2334,21 +2273,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for an organization + /// List 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. + /// Lists 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 `GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ input.path.org ] @@ -2358,6 +2297,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 @@ -2368,7 +2321,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2378,7 +2331,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsOrganizationPermissions.self, + Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2388,6 +2341,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, @@ -2400,21 +2397,21 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for an organization + /// Set 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. + /// 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 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 `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsSetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ input.path.org ] @@ -2424,6 +2421,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): @@ -2439,67 +2440,31 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - 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" + ] ) - } - } - ) - } - /// List selected repositories enabled for GitHub Actions in 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 app tokens and personal access tokens (classic) need the `admin: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 { - try await client.send( - input: input, - forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", - 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: + 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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2509,7 +2474,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2518,59 +2483,29 @@ 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 - ) - ) - } - } - ) - } - /// 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)." - /// - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin: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 { - try await client.send( - input: input, - forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", - parameters: [ - input.path.org - ] - ) - 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 .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" + ] ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + 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, @@ -2583,21 +2518,21 @@ public struct Client: APIProtocol { } ) } - /// Enable a selected repository for GitHub Actions in an organization + /// Add a repository to the list of repositories allowed to use self-hosted runners 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)." + /// 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 `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 { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, + forOperation: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ input.path.org, input.path.repositoryId @@ -2608,12 +2543,104 @@ public struct Client: APIProtocol { 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 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, @@ -2626,21 +2653,21 @@ public struct Client: APIProtocol { } ) } - /// Disable a selected repository for GitHub Actions in an organization + /// Remove a repository from the list of repositories allowed to use self-hosted runners 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)." + /// Removes a repository from 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 `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 { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, + forOperation: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ input.path.org, input.path.repositoryId @@ -2651,48 +2678,6 @@ public struct Client: APIProtocol { 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 @@ -2701,9 +2686,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.ActionsGetAllowedActionsOrganization.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2713,7 +2700,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SelectedActions.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2722,60 +2709,73 @@ 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" + ] + ) + 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" + ] ) - } - } - ) - } - /// 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 func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsSetAllowedActionsOrganization.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: .put - ) - 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" + 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" + ] ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + 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 d7e30c4cf5..93141bb87d 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -11,110 +11,6 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// 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. @@ -229,6 +125,56 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output + /// 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 /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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 /// List selected repositories enabled for GitHub Actions in 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)." @@ -284,6 +230,60 @@ public protocol APIProtocol: Sendable { /// - 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)`. func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.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 /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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 default workflow permissions for an organization /// /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, @@ -1760,296 +1760,84 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { - /// Get artifact and log retention settings for an organization + /// Get GitHub Actions cache usage for an organization /// - /// Gets 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope 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( + /// - 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( + path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, + headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { + try await actionsGetActionsCacheUsageForOrg(Operations.ActionsGetActionsCacheUsageForOrg.Input( path: path, headers: headers )) } - /// Set artifact and log retention settings for an organization + /// List repositories with GitHub Actions cache usage for an organization /// - /// Sets 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope 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( + /// - 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( + path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, + query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), + headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { + try await actionsGetActionsCacheUsageByRepoForOrg(Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input( path: path, - headers: headers, - body: body + query: query, + headers: headers )) } - /// Get fork PR contributor approval permissions for an organization + /// List GitHub-hosted runners for an organization /// - /// Gets the fork PR contributor approval policy 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 or the "Actions policies" fine-grained permission 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 /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( + /// - 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( + path: Operations.ActionsListHostedRunnersForOrg.Input.Path, + query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), + headers: Operations.ActionsListHostedRunnersForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsListHostedRunnersForOrg.Output { + try await actionsListHostedRunnersForOrg(Operations.ActionsListHostedRunnersForOrg.Input( path: path, + query: query, headers: headers )) } - /// Set fork PR contributor approval permissions for an organization - /// - /// Sets the fork PR contributor approval policy 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 /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( + /// - 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( + path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsCreateHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body + ) async throws -> Operations.ActionsCreateHostedRunnerForOrg.Output { + try await actionsCreateHostedRunnerForOrg(Operations.ActionsCreateHostedRunnerForOrg.Input( path: path, headers: headers, body: body )) } - /// Get private repo fork PR workflow settings for an organization + /// Get GitHub-owned images for GitHub-hosted runners in 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. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. - /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage/get(actions/get-actions-cache-usage-for-org)`. - public func actionsGetActionsCacheUsageForOrg( - path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, - headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() - ) async throws -> Operations.ActionsGetActionsCacheUsageForOrg.Output { - try await actionsGetActionsCacheUsageForOrg(Operations.ActionsGetActionsCacheUsageForOrg.Input( - path: path, - headers: headers - )) - } - /// List repositories with GitHub Actions cache usage for an organization - /// - /// Lists repositories and their GitHub Actions cache usage for an organization. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. - /// - /// OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/cache/usage-by-repository`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/cache/usage-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)`. - public func actionsGetActionsCacheUsageByRepoForOrg( - path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, - query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), - headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() - ) async throws -> Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output { - try await actionsGetActionsCacheUsageByRepoForOrg(Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// List GitHub-hosted runners for an organization - /// - /// Lists all GitHub-hosted runners configured in an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)`. - public func actionsListHostedRunnersForOrg( - path: Operations.ActionsListHostedRunnersForOrg.Input.Path, - query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), - headers: Operations.ActionsListHostedRunnersForOrg.Input.Headers = .init() - ) async throws -> Operations.ActionsListHostedRunnersForOrg.Output { - try await actionsListHostedRunnersForOrg(Operations.ActionsListHostedRunnersForOrg.Input( - path: path, - query: query, - headers: headers - )) - } - /// Create a GitHub-hosted runner for an organization - /// - /// Creates a GitHub-hosted runner for an organization. - /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. - public func actionsCreateHostedRunnerForOrg( - path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsCreateHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body - ) async throws -> Operations.ActionsCreateHostedRunnerForOrg.Output { - try await actionsCreateHostedRunnerForOrg(Operations.ActionsCreateHostedRunnerForOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get GitHub-owned images for GitHub-hosted runners in an organization - /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. /// /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. @@ -2206,59 +1994,163 @@ extension APIProtocol { body: body )) } - /// List selected repositories enabled for GitHub Actions in an organization + /// Get artifact and log retention settings 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 artifact and log retention settings for 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 `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( - path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), - headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() - ) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { - try await actionsListSelectedRepositoriesEnabledGithubActionsOrganization(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input( + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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, - query: query, headers: headers )) } - /// 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)." + /// 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 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/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization( - path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body - ) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { - try await actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input( + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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 )) } - /// Enable a selected repository for GitHub Actions in an organization + /// Get fork PR contributor approval permissions for 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)." + /// Gets the fork PR contributor approval policy 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 or the "Actions policies" fine-grained permission 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(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { - try await actionsEnableSelectedRepositoryGithubActionsOrganization(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input(path: path)) + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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 + )) } - /// Disable a selected repository for GitHub Actions in an organization + /// Set fork PR contributor approval permissions 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)." + /// 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 /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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 + )) + } + /// List selected repositories enabled for GitHub Actions in 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 app tokens and personal access tokens (classic) need the `admin: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( + path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { + try await actionsListSelectedRepositoriesEnabledGithubActionsOrganization(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input( + path: path, + query: query, + headers: headers + )) + } + /// 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)." /// - /// 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/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization( + path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + ) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { + try await actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input( + path: path, + body: body + )) + } + /// 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(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { + try await actionsEnableSelectedRepositoryGithubActionsOrganization(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input(path: path)) + } + /// 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)`. @@ -2299,6 +2191,114 @@ extension APIProtocol { 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 /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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 /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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 default workflow permissions for an organization /// /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, @@ -7412,236 +7412,46 @@ 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-cache-usage-org-enterprise`. + public struct ActionsCacheUsageOrgEnterprise: Codable, Hashable, Sendable { + /// The count of active caches across all repositories of an enterprise or an organization. /// - /// - 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-cache-usage-org-enterprise/total_active_caches_count`. + public var totalActiveCachesCount: Swift.Int + /// The total size in bytes of all active cache items across all repositories of an enterprise or an organization. /// - /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/maximum_allowed_days`. - public var maximumAllowedDays: Swift.Int - /// Creates a new `ActionsArtifactAndLogRetentionResponse`. + /// - Remark: Generated from `#/components/schemas/actions-cache-usage-org-enterprise/total_active_caches_size_in_bytes`. + public var totalActiveCachesSizeInBytes: Swift.Int + /// Creates a new `ActionsCacheUsageOrgEnterprise`. /// /// - Parameters: - /// - days: The number of days artifacts and logs are retained - /// - maximumAllowedDays: The maximum number of days that can be configured + /// - totalActiveCachesCount: The count of active caches across all repositories of an enterprise or an organization. + /// - totalActiveCachesSizeInBytes: The total size in bytes of all active cache items across all repositories of an enterprise or an organization. public init( - days: Swift.Int, - maximumAllowedDays: Swift.Int + totalActiveCachesCount: Swift.Int, + totalActiveCachesSizeInBytes: Swift.Int ) { - self.days = days - self.maximumAllowedDays = maximumAllowedDays + self.totalActiveCachesCount = totalActiveCachesCount + self.totalActiveCachesSizeInBytes = totalActiveCachesSizeInBytes } public enum CodingKeys: String, CodingKey { - case days - case maximumAllowedDays = "maximum_allowed_days" + case totalActiveCachesCount = "total_active_caches_count" + case totalActiveCachesSizeInBytes = "total_active_caches_size_in_bytes" } } - /// - 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 + /// GitHub Actions Cache Usage by repository. + /// + /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository`. + public struct ActionsCacheUsageByRepository: Codable, Hashable, Sendable { + /// The repository owner and name for the cache usage being shown. /// - /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention/days`. - public var days: Swift.Int - /// Creates a new `ActionsArtifactAndLogRetention`. + /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository/full_name`. + public var fullName: Swift.String + /// The sum of the size in bytes of all the active cache items in the repository. /// - /// - 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. - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-usage-org-enterprise/total_active_caches_count`. - public var totalActiveCachesCount: Swift.Int - /// The total size in bytes of all active cache items across all repositories of an enterprise or an organization. - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-usage-org-enterprise/total_active_caches_size_in_bytes`. - public var totalActiveCachesSizeInBytes: Swift.Int - /// Creates a new `ActionsCacheUsageOrgEnterprise`. - /// - /// - Parameters: - /// - totalActiveCachesCount: The count of active caches across all repositories of an enterprise or an organization. - /// - totalActiveCachesSizeInBytes: The total size in bytes of all active cache items across all repositories of an enterprise or an organization. - public init( - totalActiveCachesCount: Swift.Int, - totalActiveCachesSizeInBytes: Swift.Int - ) { - self.totalActiveCachesCount = totalActiveCachesCount - self.totalActiveCachesSizeInBytes = totalActiveCachesSizeInBytes - } - public enum CodingKeys: String, CodingKey { - case totalActiveCachesCount = "total_active_caches_count" - case totalActiveCachesSizeInBytes = "total_active_caches_size_in_bytes" - } - } - /// GitHub Actions Cache Usage by repository. - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository`. - public struct ActionsCacheUsageByRepository: Codable, Hashable, Sendable { - /// The repository owner and name for the cache usage being shown. - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository/full_name`. - public var fullName: Swift.String - /// The sum of the size in bytes of all the active cache items in the repository. - /// - /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository/active_caches_size_in_bytes`. - public var activeCachesSizeInBytes: Swift.Int - /// The number of active caches in the repository. + /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository/active_caches_size_in_bytes`. + public var activeCachesSizeInBytes: Swift.Int + /// The number of active caches in the repository. /// /// - Remark: Generated from `#/components/schemas/actions-cache-usage-by-repository/active_caches_count`. public var activeCachesCount: Swift.Int @@ -8082,70 +7892,260 @@ public enum Components { case selectedActionsUrl = "selected_actions_url" } } - /// - Remark: Generated from `#/components/schemas/selected-actions`. - public struct SelectedActions: Codable, Hashable, Sendable { - /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. - /// - /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. - public var githubOwnedAllowed: Swift.Bool? - /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. - /// - /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. - public var verifiedAllowed: Swift.Bool? - /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response`. + public struct ActionsArtifactAndLogRetentionResponse: Codable, Hashable, Sendable { + /// The number of days artifacts and logs are retained /// - /// > [!NOTE] - /// > The `patterns_allowed` setting only applies to public repositories. + /// - 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/selected-actions/patterns_allowed`. - public var patternsAllowed: [Swift.String]? - /// Creates a new `SelectedActions`. + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/maximum_allowed_days`. + public var maximumAllowedDays: Swift.Int + /// Creates a new `ActionsArtifactAndLogRetentionResponse`. /// /// - Parameters: - /// - githubOwnedAllowed: Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. - /// - verifiedAllowed: Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. - /// - patternsAllowed: Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// - days: The number of days artifacts and logs are retained + /// - maximumAllowedDays: The maximum number of days that can be configured public init( - githubOwnedAllowed: Swift.Bool? = nil, - verifiedAllowed: Swift.Bool? = nil, - patternsAllowed: [Swift.String]? = nil + days: Swift.Int, + maximumAllowedDays: Swift.Int ) { - self.githubOwnedAllowed = githubOwnedAllowed - self.verifiedAllowed = verifiedAllowed - self.patternsAllowed = patternsAllowed + self.days = days + self.maximumAllowedDays = maximumAllowedDays } public enum CodingKeys: String, CodingKey { - case githubOwnedAllowed = "github_owned_allowed" - case verifiedAllowed = "verified_allowed" - case patternsAllowed = "patterns_allowed" + case days + case maximumAllowedDays = "maximum_allowed_days" } } - /// The default workflow permissions granted to the GITHUB_TOKEN when running workflows. - /// - /// - Remark: Generated from `#/components/schemas/actions-default-workflow-permissions`. - @frozen public enum ActionsDefaultWorkflowPermissions: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - } - /// Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. - /// - /// - Remark: Generated from `#/components/schemas/actions-can-approve-pull-request-reviews`. - public typealias ActionsCanApprovePullRequestReviews = Swift.Bool - /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions`. - public struct ActionsGetDefaultWorkflowPermissions: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions/default_workflow_permissions`. - public var defaultWorkflowPermissions: Components.Schemas.ActionsDefaultWorkflowPermissions - /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions/can_approve_pull_request_reviews`. - public var canApprovePullRequestReviews: Components.Schemas.ActionsCanApprovePullRequestReviews - /// Creates a new `ActionsGetDefaultWorkflowPermissions`. + /// - 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: - /// - defaultWorkflowPermissions: - /// - canApprovePullRequestReviews: - public init( - defaultWorkflowPermissions: Components.Schemas.ActionsDefaultWorkflowPermissions, - canApprovePullRequestReviews: Components.Schemas.ActionsCanApprovePullRequestReviews - ) { + /// - 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/selected-actions`. + public struct SelectedActions: Codable, Hashable, Sendable { + /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. + public var githubOwnedAllowed: Swift.Bool? + /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. + public var verifiedAllowed: Swift.Bool? + /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// + /// > [!NOTE] + /// > The `patterns_allowed` setting only applies to public repositories. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/patterns_allowed`. + public var patternsAllowed: [Swift.String]? + /// Creates a new `SelectedActions`. + /// + /// - Parameters: + /// - githubOwnedAllowed: Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// - verifiedAllowed: Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// - patternsAllowed: Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + public init( + githubOwnedAllowed: Swift.Bool? = nil, + verifiedAllowed: Swift.Bool? = nil, + patternsAllowed: [Swift.String]? = nil + ) { + self.githubOwnedAllowed = githubOwnedAllowed + self.verifiedAllowed = verifiedAllowed + self.patternsAllowed = patternsAllowed + } + public enum CodingKeys: String, CodingKey { + case githubOwnedAllowed = "github_owned_allowed" + case verifiedAllowed = "verified_allowed" + case patternsAllowed = "patterns_allowed" + } + } + /// - 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" + } + } + /// The default workflow permissions granted to the GITHUB_TOKEN when running workflows. + /// + /// - Remark: Generated from `#/components/schemas/actions-default-workflow-permissions`. + @frozen public enum ActionsDefaultWorkflowPermissions: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. + /// + /// - Remark: Generated from `#/components/schemas/actions-can-approve-pull-request-reviews`. + public typealias ActionsCanApprovePullRequestReviews = Swift.Bool + /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions`. + public struct ActionsGetDefaultWorkflowPermissions: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions/default_workflow_permissions`. + public var defaultWorkflowPermissions: Components.Schemas.ActionsDefaultWorkflowPermissions + /// - Remark: Generated from `#/components/schemas/actions-get-default-workflow-permissions/can_approve_pull_request_reviews`. + public var canApprovePullRequestReviews: Components.Schemas.ActionsCanApprovePullRequestReviews + /// Creates a new `ActionsGetDefaultWorkflowPermissions`. + /// + /// - Parameters: + /// - defaultWorkflowPermissions: + /// - canApprovePullRequestReviews: + public init( + defaultWorkflowPermissions: Components.Schemas.ActionsDefaultWorkflowPermissions, + canApprovePullRequestReviews: Components.Schemas.ActionsCanApprovePullRequestReviews + ) { self.defaultWorkflowPermissions = defaultWorkflowPermissions self.canApprovePullRequestReviews = canApprovePullRequestReviews } @@ -11148,14 +11148,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// 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 + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int /// Only return runner groups that are allowed to be used by this repository. /// /// - Remark: Generated from `#/components/parameters/visible-to-repository`. @@ -11736,22 +11736,23 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get artifact and log retention settings for an organization + /// Get GitHub Actions cache usage for an organization /// - /// Gets 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope 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 enum ActionsGetArtifactAndLogRetentionSettingsOrganization { - public static let id: Swift.String = "actions/get-artifact-and-log-retention-settings-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/organizations/{org}/actions/permissions/artifact-and-log-retention/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/organizations/{org}/actions/permissions/artifact-and-log-retention/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`. /// @@ -11761,27 +11762,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/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.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers + public var headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, - headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, + headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11789,15 +11790,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - 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/organizations/{org}/actions/permissions/artifact-and-log-retention/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsArtifactAndLogRetentionResponse) + /// - 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/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.ActionsArtifactAndLogRetentionResponse { + public var json: Components.Schemas.ActionsCacheUsageOrgEnterprise { get throws { switch self { case let .json(body): @@ -11807,26 +11822,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.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.ActionsGetArtifactAndLogRetentionSettingsOrganization.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//organizations/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-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.ActionsGetArtifactAndLogRetentionSettingsOrganization.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.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok { + public var ok: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -11839,52 +11859,6 @@ 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. @@ -11916,22 +11890,23 @@ public enum Operations { } } } - /// Set artifact and log retention settings for an organization + /// List repositories with GitHub Actions cache usage for an organization /// - /// Sets 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. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `read:org` scope 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 enum ActionsSetArtifactAndLogRetentionSettingsOrganization { - public static let id: Swift.String = "actions/set-artifact-and-log-retention-settings-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/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/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/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/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`. /// @@ -11941,164 +11916,148 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/artifact-and-log-retention/PUT/header`. + 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 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.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 + public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path, - headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init(), - body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body + path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, + query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), + headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - 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 - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.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 + } + } } } + /// 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 + } } - /// Forbidden + /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/403`. + /// - 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: `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.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(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/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 - ) - } - } - } - /// Conflict - /// - /// - 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: `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/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", + expectedStatus: "ok", response: self ) } @@ -12135,22 +12094,22 @@ public enum Operations { } } } - /// Get fork PR contributor approval permissions for an organization + /// List GitHub-hosted runners for an organization /// - /// Gets the fork PR contributor approval policy 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 or the "Actions policies" fine-grained permission 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 /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" + /// - 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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12160,43 +12119,107 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/header`. + 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 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.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsListHostedRunnersForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsListHostedRunnersForOrg.Input.Path, + query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), + headers: Operations.ActionsListHostedRunnersForOrg.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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content`. + /// - 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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsForkPrContributorApproval) + /// - 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: Components.Schemas.ActionsForkPrContributorApproval { + public var json: Operations.ActionsListHostedRunnersForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12206,26 +12229,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.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(body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.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//organizations/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.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 `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsListHostedRunnersForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12238,29 +12266,6 @@ 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. @@ -12292,22 +12297,21 @@ public enum Operations { } } } - /// Set fork PR contributor approval permissions for an organization - /// - /// Sets the fork PR contributor approval policy 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 /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" + /// - 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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12317,118 +12321,184 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/header`. + 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] + 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.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody`. + 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/organizations/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.ActionsForkPrContributorApproval) - } - public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, - headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), - body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//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 - ) + /// - 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) } - /// 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`. + public var body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body + /// Creates a new `Input`. /// - /// - 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 - ) + /// - Parameters: + /// - 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 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 + } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)/responses/201`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateHostedRunnerForOrg.Output.Created { get throws { switch self { - case let .unprocessableContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "created", response: self ) } @@ -12465,20 +12535,20 @@ public enum Operations { } } } - /// Get private repo fork PR workflow settings for an organization + /// Get GitHub-owned images for GitHub-hosted runners in an organization /// - /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Get the list of GitHub-owned images available for GitHub-hosted runners for 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 enum ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization { - public static let id: Swift.String = "actions/get-private-repo-fork-pr-workflows-settings-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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12488,27 +12558,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/header`. + 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] + 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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, - headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12516,15 +12586,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content`. + /// - 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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsForkPrWorkflowsPrivateRepos) + /// - 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: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { + public var json: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12534,26 +12627,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - 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`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.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 `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12566,52 +12659,6 @@ 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. @@ -12643,20 +12690,20 @@ public enum Operations { } } } - /// Set private repo fork PR workflow settings for an organization + /// Get partner images for GitHub-hosted runners in an organization /// - /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// Get the list of partner images available for GitHub-hosted runners for 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 enum ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization { - public static let id: Swift.String = "actions/set-private-repo-fork-pr-workflows-settings-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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/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`. /// @@ -12666,87 +12713,66 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/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.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 + public var headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, - headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init(), - body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body + path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() ) { 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() {} - } - /// Empty response for successful settings update - /// - /// - 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`. - case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent) - /// Empty response for successful settings update - /// - /// - 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 .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - 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`. + 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/organizations/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/content/application\/json`. - case json(Components.Schemas.BasicError) + /// - 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.BasicError { + public var json: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12756,79 +12782,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body - /// Creates a new `Forbidden`. + public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body) { + public init(body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.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. + /// Response /// - /// - 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`. + /// - 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: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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 ) } @@ -12865,22 +12845,20 @@ public enum Operations { } } } - /// Get self-hosted runners settings for an organization - /// - /// Gets the settings for self-hosted runners 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 or the "Actions policies" fine-grained permission to use this endpoint. + /// Get the GitHub-hosted runners limits for an organization. /// - /// - 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" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/GET/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/organizations/{org}/actions/permissions/self-hosted-runners/GET/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`. /// @@ -12890,27 +12868,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/GET/header`. + 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] + 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.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12918,15 +12896,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/GET/responses/200/content/application\/json`. - case json(Components.Schemas.SelfHostedRunnersSettings) + /// - 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.SelfHostedRunnersSettings { + public var json: Components.Schemas.ActionsHostedRunnerLimits { get throws { switch self { case let .json(body): @@ -12936,26 +12914,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.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 `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12968,53 +12946,7 @@ 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. + /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) @@ -13045,22 +12977,20 @@ public enum Operations { } } } - /// Set self-hosted runners settings for an organization - /// - /// Sets the settings for self-hosted runners for an organization. + /// Get GitHub-hosted runners machine specs 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. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - 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" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/PUT/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/organizations/{org}/actions/permissions/self-hosted-runners/PUT/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`. /// @@ -13070,189 +13000,102 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/PUT/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.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 + public var headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path, - headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init(), - body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body + path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers = .init() ) { 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() {} - } - /// 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 - ) - } - } - } - /// 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 - ) + 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" + } } - } - } - /// 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 - ) + /// - 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 + } + } } } - } - /// Conflict - /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-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 - ) - } + /// 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 } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/422`. + /// - 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: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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 ) } @@ -13289,22 +13132,20 @@ public enum Operations { } } } - /// List repositories allowed to use self-hosted runners in an organization - /// - /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// Get platforms for GitHub-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. + /// Get the list of platforms available for GitHub-hosted runners for an organization. /// - /// - 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" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/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`. /// @@ -13314,93 +13155,66 @@ public enum Operations { self.org = org } } - 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 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] + 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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, - query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), - headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json`. + /// - 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/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]? + /// - 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: - /// - repositories: + /// - platforms: public init( - totalCount: Swift.Int? = nil, - repositories: [Components.Schemas.Repository]? = nil + totalCount: Swift.Int, + platforms: [Swift.String] ) { self.totalCount = totalCount - self.repositories = repositories + self.platforms = platforms } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case repositories + case platforms } } - /// - 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) + /// - 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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -13410,26 +13224,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.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 `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13442,52 +13256,6 @@ 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. @@ -13519,183 +13287,132 @@ public enum Operations { } } } - /// Set repositories allowed to use self-hosted runners in an organization + /// Get a GitHub-hosted runner for an organization /// - /// Sets repositories that are allowed to use self-hosted runners 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 or the "Actions policies" fine-grained permission to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope 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 enum ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization { - public static let id: Swift.String = "actions/set-selected-repositories-self-hosted-runners-organization" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/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) { + /// - 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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/PUT/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.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 + public var headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, - headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init(), - body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body + path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() ) { 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 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 + } + } + /// 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 + } + } + } + } + /// 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 + } } - /// 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 + /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-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.ActionsGetHostedRunnerForOrg.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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// 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 - ) - } - } - } - /// 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 - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - 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: `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 { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnerForOrg.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 ) } @@ -13732,195 +13449,170 @@ public enum Operations { } } } - /// 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. + /// Update a GitHub-hosted runner 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. + /// 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 `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" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. + /// Unique identifier of the GitHub-hosted runner. /// - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId + /// - 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. - /// - repositoryId: The unique identifier of the repository. + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId + hostedRunnerId: Components.Parameters.HostedRunnerId ) { self.org = org - self.repositoryId = repositoryId + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/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.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers + 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 /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, - headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsUpdateHostedRunnerForOrg.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() {} - } - /// No content - /// - /// - 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`. - case noContent(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) - /// No content - /// - /// - 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 .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + 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 + } } - /// Forbidden + /// Response /// - /// - 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`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/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.ActionsUpdateHostedRunnerForOrg.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.ActionsUpdateHostedRunnerForOrg.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 ) } } } - /// 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. + /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) @@ -13951,189 +13643,111 @@ public enum Operations { } } } - /// 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. + /// Delete a GitHub-hosted runner 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. + /// Deletes a GitHub-hosted runner for an organization. /// - /// - 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" + /// - 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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/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/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. + /// Unique identifier of the GitHub-hosted runner. /// - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId + /// - 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. - /// - repositoryId: The unique identifier of the repository. + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId + hostedRunnerId: Components.Parameters.HostedRunnerId ) { self.org = org - self.repositoryId = repositoryId + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers + public var headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, - headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.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 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 - ) - } - } - } - /// 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 - ) - } - } - } - /// Resource not found - /// - /// - 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: `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 - ) + 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 + } + } } } - } - /// 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 - ) - } + /// 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 } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - 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`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)/responses/202`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted { get throws { switch self { - case let .unprocessableContent(response): + case let .accepted(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "accepted", response: self ) } @@ -14170,23 +13784,22 @@ public enum Operations { } } } - /// Get GitHub Actions cache usage for an organization + /// Get 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. + /// Gets 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 `read: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/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 /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/cache/usage/GET/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/cache/usage/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14196,27 +13809,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.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.ActionsGetActionsCacheUsageForOrg.Input.Headers + public var headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsageForOrg.Input.Path, - headers: Operations.ActionsGetActionsCacheUsageForOrg.Input.Headers = .init() + path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -14224,29 +13837,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/orgs/{org}/actions/permissions/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/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`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsCacheUsageOrgEnterprise { + public var json: Components.Schemas.ActionsOrganizationPermissions { get throws { switch self { case let .json(body): @@ -14256,31 +13855,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsageForOrg.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.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.ActionsGetGithubActionsPermissionsOrganization.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//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsageForOrg.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.ActionsGetActionsCacheUsageForOrg.Output.Ok { + public var ok: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -14324,23 +13918,22 @@ public enum Operations { } } } - /// List repositories with GitHub Actions cache usage 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. + /// 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 `read: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 `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 /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/cache/usage-by-repository/GET/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/cache/usage-by-repository/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14350,107 +13943,153 @@ 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)." + 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) + } + } + /// 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 /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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/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-by-repository/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/path/org`. + public var org: Components.Parameters.Org + /// 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/header`. + public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers + public var headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Path, - query: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Query = .init(), - headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Input.Headers = .init() + path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/cache/usage-by-repository/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{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-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) + /// - Remark: Generated from `#/paths/orgs/{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: Operations.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsArtifactAndLogRetentionResponse { get throws { switch self { case let .json(body): @@ -14460,31 +14099,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheUsageByRepoForOrg.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-by-repository/get(actions/get-actions-cache-usage-by-repo-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetActionsCacheUsageByRepoForOrg.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.ActionsGetActionsCacheUsageByRepoForOrg.Output.Ok { + public var ok: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -14497,11 +14131,57 @@ public enum Operations { } } } - /// 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//orgs/{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//orgs/{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. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } @frozen public enum AcceptableContentType: AcceptableProtocol { case json case other(Swift.String) @@ -14528,22 +14208,22 @@ public enum Operations { } } } - /// List GitHub-hosted runners for an organization + /// Set artifact and log retention settings for an organization /// - /// Lists all GitHub-hosted runners configured in an organization. + /// Sets artifact and log retention settings 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 `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{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/hosted-runners/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{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/hosted-runners/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14553,167 +14233,183 @@ 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.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsListHostedRunnersForOrg.Input.Headers + public var headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{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.ActionsListHostedRunnersForOrg.Input.Path, - query: Operations.ActionsListHostedRunnersForOrg.Input.Query = .init(), - headers: Operations.ActionsListHostedRunnersForOrg.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/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 - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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 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 + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/get(actions/list-hosted-runners-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/403`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListHostedRunnersForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListHostedRunnersForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", response: self ) } } } - /// Undocumented response. + /// Resource not found /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-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//orgs/{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 + 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 { @@ -14731,21 +14427,22 @@ public enum Operations { } } } - /// Create a GitHub-hosted runner for an organization + /// Get 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. + /// Gets 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 or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{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/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14755,148 +14452,43 @@ 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.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.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 + public var headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsCreateHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsCreateHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsCreateHostedRunnerForOrg.Input.Body + path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{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/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) + /// - Remark: Generated from `#/paths/orgs/{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: Components.Schemas.ActionsHostedRunner { + public var json: Components.Schemas.ActionsForkPrContributorApproval { get throws { switch self { case let .json(body): @@ -14906,33 +14498,56 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateHostedRunnerForOrg.Output.Created.Body) { + public init(body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/200`. /// - /// 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: `200 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 `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateHostedRunnerForOrg.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{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 ) } @@ -14969,20 +14584,22 @@ public enum Operations { } } } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// Set fork PR contributor approval permissions for an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// Sets the fork PR contributor approval policy for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. - public enum 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/hosted-runners/images/github-owned/GET/path`. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{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/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/images/github-owned/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14992,102 +14609,118 @@ 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.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers + public var headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) + } + public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers = .init() + path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.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/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 - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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.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 + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{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/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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.ActionsGetHostedRunnersGithubOwnedImagesForOrg.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 ) } @@ -15124,20 +14757,20 @@ public enum Operations { } } } - /// Get partner images for GitHub-hosted runners in an organization + /// Get private repo fork PR workflow settings for an organization /// - /// Get the list of partner 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/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 `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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/partner/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{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/partner/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -15147,27 +14780,27 @@ 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.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers + public var headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -15175,38 +14808,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/partner/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{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/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) + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { get throws { switch self { case let .json(body): @@ -15216,26 +14826,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.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.ActionsGetHostedRunnersPartnerImagesForOrg.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/partner/get(actions/get-hosted-runners-partner-images-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{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.ActionsGetHostedRunnersPartnerImagesForOrg.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.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok { + public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -15248,6 +14858,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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. @@ -15279,20 +14935,20 @@ public enum Operations { } } } - /// 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 enum ActionsGetHostedRunnersLimitsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-limits-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{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/limits/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{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/limits/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -15302,43 +14958,87 @@ 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.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetHostedRunnersLimitsForOrg.Input.Headers + public var headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetHostedRunnersLimitsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersLimitsForOrg.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/limits/GET/responses/200/content`. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//orgs/{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`. + case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent) + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//orgs/{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 .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/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/orgs/{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.ActionsHostedRunnerLimits { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -15348,33 +15048,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body + /// Creates a new `Forbidden`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body) { self.body = body } } - /// Response + /// Forbidden - Fork PR workflow settings for private repositories are managed by the enterprise owner /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/403`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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 ) } @@ -15411,20 +15157,22 @@ public enum Operations { } } } - /// Get GitHub-hosted runners machine specs for an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Get the list of machine specs available for GitHub-hosted runners 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)." /// - /// - 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 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" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/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/hosted-runners/machine-sizes/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -15434,66 +15182,93 @@ 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.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/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/permissions/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.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.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.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 self.headers = headers } } @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`. + /// - 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/hosted-runners/machine-sizes/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/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] + /// - 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] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - machineSpecs: + /// - repositories: public init( - totalCount: Swift.Int, - machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + totalCount: Swift.Double, + repositories: [Components.Schemas.Repository] ) { self.totalCount = totalCount - self.machineSpecs = machineSpecs + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case machineSpecs = "machine_specs" + case repositories } } - /// - 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) + /// - 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.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -15503,26 +15278,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body + public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)/responses/200`. + /// - 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.ActionsGetHostedRunnersMachineSpecsForOrg.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.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -15566,20 +15341,23 @@ public enum Operations { } } } - /// Get platforms for GitHub-hosted runners in an organization + /// Set selected repositories enabled for GitHub Actions in an organization /// - /// Get the list of platforms available for GitHub-hosted runners for 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)." /// - /// - 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 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" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/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/hosted-runners/platforms/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -15589,102 +15367,74 @@ 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 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.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers + public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers = .init() + path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.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/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 - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// 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//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersPlatformsForOrg.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.ActionsGetHostedRunnersPlatformsForOrg.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 ) } @@ -15695,158 +15445,166 @@ 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 a GitHub-hosted runner for an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Gets a GitHub-hosted runner 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 `manage_runners: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/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 /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/hosted-runners/{hosted_runner_id}/GET/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/hosted-runners/{hosted_runner_id}/GET/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 GitHub-hosted runner. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId + /// - 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. - /// - 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 - } - } - 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] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.repositoryId = repositoryId } } - public var headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers + public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() - ) { + public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.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/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 - } - } - /// 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 - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// 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`. + /// + /// 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.ActionsEnableSelectedRepositoryGithubActionsOrganization.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.ActionsGetHostedRunnerForOrg.Output.Ok.Body - /// Creates a new `Ok`. + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// 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 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/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/permissions/repositories/{repository_id}/DELETE/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: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body + /// - org: The organization name. The name is not case sensitive. + /// - repositoryId: The unique identifier of the repository. public init( - headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId ) { - self.headers = headers - self.body = body + self.org = org + self.repositoryId = repositoryId } } + public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.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/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. /// - /// 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: `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`. + /// + /// 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 `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnerForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.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 ) } @@ -15857,154 +15615,69 @@ 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 a GitHub-hosted runner for an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Updates a GitHub-hosted runner for an organization. - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// 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)." /// - /// - 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 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 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/hosted-runners/{hosted_runner_id}/PATCH/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/hosted-runners/{hosted_runner_id}/PATCH/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 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. - /// - 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.ActionsUpdateHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/header`. + 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] + 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.ActionsGetAllowedActionsOrganization.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.ActionsGetAllowedActionsOrganization.Input.Path, + headers: Operations.ActionsGetAllowedActionsOrganization.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`. + /// - 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/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) + /// - 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.ActionsHostedRunner { + public var json: Components.Schemas.SelectedActions { get throws { switch self { case let .json(body): @@ -16014,26 +15687,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + public var body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. + /// - 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.ActionsUpdateHostedRunnerForOrg.Output.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.ActionsUpdateHostedRunnerForOrg.Output.Ok { + public var ok: Operations.ActionsGetAllowedActionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -16077,111 +15750,82 @@ public enum Operations { } } } - /// Delete a GitHub-hosted runner for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Deletes a GitHub-hosted runner 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)." /// - /// - 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 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/hosted-runners/{hosted_runner_id}/DELETE/path`. + /// - 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/hosted-runners/{hosted_runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/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}/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. - /// - 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.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] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } + 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 headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers + public var body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsSetAllowedActionsOrganization.Input.Path, + body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? = nil ) { self.path = path - self.headers = headers + self.body = body } } @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 - } - } - } - } - /// 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 - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - 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//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. /// - /// 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: `204 noContent`. + case noContent(Operations.ActionsSetAllowedActionsOrganization.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted { + /// - 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`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetAllowedActionsOrganization.Output.NoContent { get throws { switch self { - case let .accepted(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "noContent", response: self ) } @@ -16192,48 +15836,23 @@ 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 permissions for an organization + /// Get self-hosted runners settings for an organization /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Gets the settings for self-hosted runners 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 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 enum ActionsGetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/get-github-actions-permissions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16243,27 +15862,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.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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.ActionsGetGithubActionsPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -16271,15 +15890,15 @@ 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/permissions/self-hosted-runners/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/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.ActionsOrganizationPermissions { + public var json: Components.Schemas.SelfHostedRunnersSettings { get throws { switch self { case let .json(body): @@ -16289,26 +15908,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.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.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body) { 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/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetGithubActionsPermissionsOrganization.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.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -16321,6 +15940,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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. @@ -16352,22 +16017,22 @@ public enum Operations { } } } - /// Set GitHub Actions permissions for an organization + /// Set self-hosted runners settings for an organization /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in 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 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 enum ActionsSetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/set-github-actions-permissions-organization" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16377,80 +16042,189 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody`. + public var path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/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.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/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? + /// The policy that controls whether self-hosted runners can be used in the organization + /// + /// - Remark: Generated from `#/paths/orgs/{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/orgs/{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: - /// - allowedActions: - public init( - enabledRepositories: Components.Schemas.EnabledRepositories, - allowedActions: Components.Schemas.AllowedActions? = nil - ) { + /// - 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 - 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) + /// - Remark: Generated from `#/paths/orgs/{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.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 NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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 + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } + } } - public var body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body - /// Creates a new `Input`. + /// Conflict /// - /// - 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/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/409`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent) - /// Response + /// - 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}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/422`. /// - /// 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: `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 `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .noContent(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unprocessableContent", response: self ) } @@ -16461,23 +16235,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 + ] + } + } } - /// List selected repositories enabled for GitHub Actions in an organization + /// List repositories allowed to use self-hosted runners in 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 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 `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/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16487,16 +16286,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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{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/orgs/{org}/actions/permissions/repositories/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{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/orgs/{org}/actions/permissions/repositories/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -16511,19 +16310,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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16531,9 +16330,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.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path self.query = query @@ -16542,22 +16341,22 @@ 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/permissions/self-hosted-runners/repositories/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/permissions/self-hosted-runners/repositories/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/permissions/self-hosted-runners/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{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: /// - repositories: public init( - totalCount: Swift.Double, - repositories: [Components.Schemas.Repository] + totalCount: Swift.Int? = nil, + repositories: [Components.Schemas.Repository]? = nil ) { self.totalCount = totalCount self.repositories = repositories @@ -16567,13 +16366,13 @@ public enum Operations { case repositories } } - /// - 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/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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -16583,26 +16382,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body) { 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/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.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.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -16615,6 +16414,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{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//orgs/{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. @@ -16646,23 +16491,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)." + /// 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 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/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 `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16672,19 +16516,31 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody`. + public var path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/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.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs to enable for GitHub Actions. + /// IDs of repositories that can use repository-level self-hosted runners /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/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. + /// - selectedRepositoryIds: IDs of repositories that can use repository-level self-hosted runners public init(selectedRepositoryIds: [Swift.Int]) { self.selectedRepositoryIds = selectedRepositoryIds } @@ -16692,20 +16548,23 @@ public enum Operations { 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) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + public var body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + 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 } } @@ -16714,15 +16573,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// No content /// - /// - 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/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent) - /// Response + case noContent(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - 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/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 { @@ -16732,7 +16591,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent { + public var noContent: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -16745,86 +16604,70 @@ public enum Operations { } } } - /// Undocumented response. + /// Forbidden /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// 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 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/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/permissions/repositories/{repository_id}/PUT/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 - ) { - self.org = org - self.repositoryId = repositoryId + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } } } - public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path - /// Creates a new `Input`. + /// Resource not found /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.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/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/404`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/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.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response + /// - 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/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/422`. /// - /// 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: `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 `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .noContent(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unprocessableContent", response: self ) } @@ -16835,27 +16678,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 + ] + } + } } - /// Disable a selected repository for GitHub Actions in an organization + /// Add a repository to the list of repositories allowed to use self-hosted runners 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)." + /// 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 `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 `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/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`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/repository_id`. public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// @@ -16870,13 +16738,30 @@ public enum Operations { self.repositoryId = repositoryId } } - public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path + public var path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/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.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -16884,15 +16769,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// No content /// - /// - 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/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response + case noContent(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - 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/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 { @@ -16902,7 +16787,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent { + public var noContent: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -16915,110 +16800,93 @@ public enum Operations { } } } - /// Undocumented response. + /// Forbidden /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// 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 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/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/permissions/selected-actions/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } } } - 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`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } } } - public var headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers - /// Creates a new `Input`. + /// Conflict /// - /// - 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 - } - } + /// - Remark: Generated from `#/paths//orgs/{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 + ) } } - /// 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 + /// Validation failed, or the endpoint has been spammed. /// - /// - 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/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetAllowedActionsOrganization.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.ActionsGetAllowedActionsOrganization.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 ) } @@ -17055,49 +16923,64 @@ public enum Operations { } } } - /// Set allowed actions and reusable workflows for an organization + /// Remove a repository from the list of repositories allowed to use self-hosted runners in 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)." + /// 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/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 `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{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/permissions/selected-actions/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{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/permissions/selected-actions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{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. - public init(org: Components.Parameters.Org) { + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { self.org = org + self.repositoryId = repositoryId } } - 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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_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 body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? + public var headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.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.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path - self.body = body + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -17105,15 +16988,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// No content /// - /// - 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/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.ActionsSetAllowedActionsOrganization.Output.NoContent) - /// Response + case noContent(Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - 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/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 { @@ -17123,7 +17006,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetAllowedActionsOrganization.Output.NoContent { + public var noContent: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -17136,11 +17019,128 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{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 + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-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//orgs/{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//orgs/{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 + ) + } + } + } /// 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 default workflow permissions for an organization /// diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index 74a949268d..ce3846695d 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -1979,7 +1979,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/pagination-after`. public typealias PaginationAfter = Swift.String - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias Enterprise = Swift.String @@ -2198,14 +2198,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -2414,14 +2414,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -3095,14 +3095,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -3231,7 +3231,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -3242,7 +3242,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -3453,7 +3453,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -3464,7 +3464,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4159,7 +4159,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4170,7 +4170,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4384,7 +4384,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4395,7 +4395,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4615,7 +4615,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4626,7 +4626,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4875,7 +4875,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4886,7 +4886,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -6277,14 +6277,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided. + /// An array of repository IDs to detach from configurations. Up to 250 IDs can be provided. /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided. + /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 250 IDs can be provided. public init(selectedRepositoryIds: [Swift.Int]? = nil) { self.selectedRepositoryIds = selectedRepositoryIds } diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 825226c91c..80a6639d85 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -672,6 +672,20 @@ public struct Client: APIProtocol { name: "epss_percentage", value: input.query.epssPercentage ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "artifact_registry_url", + value: input.query.artifactRegistryUrl + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "package_registry", + value: input.query.packageRegistry + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index e1ca39536a..05ed8da682 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -4187,7 +4187,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias Enterprise = Swift.String @@ -4312,6 +4312,16 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-name`. public typealias SecretName = Swift.String + /// A comma-separated list of Artifact Registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry-urls`. + public typealias DependabotAlertCommaSeparatedArtifactRegistryUrls = Swift.String + /// A comma-separated list of Package Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. + /// + /// Can be: `jfrog-artifactory` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-package-registry`. + public typealias DependabotAlertCommaSeparatedPackageRegistry = Swift.String /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. /// /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. @@ -4523,14 +4533,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -5611,6 +5621,16 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/epss_percentage`. public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? + /// A comma-separated list of Artifact Registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/artifact_registry_url`. + public var artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? + /// A comma-separated list of Package Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. + /// + /// Can be: `jfrog-artifactory` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/package_registry`. + public var packageRegistry: Components.Parameters.DependabotAlertCommaSeparatedPackageRegistry? /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. @@ -5720,6 +5740,8 @@ public enum Operations { /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - epssPercentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - artifactRegistryUrl: A comma-separated list of Artifact Registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// - packageRegistry: A comma-separated list of Package Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. /// - has: Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. @@ -5735,6 +5757,8 @@ public enum Operations { ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, package: Components.Parameters.DependabotAlertCommaSeparatedPackages? = nil, epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, + artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? = nil, + packageRegistry: Components.Parameters.DependabotAlertCommaSeparatedPackageRegistry? = nil, has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, @@ -5750,6 +5774,8 @@ public enum Operations { self.ecosystem = ecosystem self.package = package self.epssPercentage = epssPercentage + self.artifactRegistryUrl = artifactRegistryUrl + self.packageRegistry = packageRegistry self.has = has self.scope = scope self.sort = sort diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 5316f43b1f..2b39b85bc6 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -2793,7 +2793,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias Enterprise = Swift.String @@ -3116,14 +3116,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 7187214c51..30ab35c5db 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 7187214c51f81537dd0b72ccc8c1af762d73f2c6 +Subproject commit 30ab35c5db4a05519ceed2e41292cdb7af182f1c